summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-05-14 13:36:27 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-05-14 11:40:00 +0000
commit76118c14eb57fd21982e6cfc0c936a7ed0711463 (patch)
tree5e74d0e7a6457c234fa63ec901f100cc9b4033f5
parent7e50bc49595f6c200aed42088cbbb71e0a8542ad (diff)
Disable uniform buffers for glsl output altogether
Regardless of the GLSL version. This allows the QRhi GL backend to have a single code path when it comes to uniforms, and it does not need to worry about uniform buffers for GLSL >=140 and >=300es. Change-Id: If4bbfc12d57b5b1fc6382dec5a65130c357f5c2e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/shadertools/qspirvshader.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shadertools/qspirvshader.cpp b/src/shadertools/qspirvshader.cpp
index 7e0057e..5402f7b 100644
--- a/src/shadertools/qspirvshader.cpp
+++ b/src/shadertools/qspirvshader.cpp
@@ -394,6 +394,9 @@ QByteArray QSpirvShader::translateToGLSL(int version, GlslFlags flags) const
options.fragment.default_float_precision = flags.testFlag(FragDefaultMediump)
? spirv_cross::CompilerGLSL::Options::Mediump
: spirv_cross::CompilerGLSL::Options::Highp;
+ // The gl backend of QRhi is not prepared for UBOs atm. Have a uniform (heh)
+ // behavior regardless of the GLSL version.
+ options.emit_uniform_buffer_as_plain_uniforms = true;
d->glslGen->set_common_options(options);
const std::string glsl = d->glslGen->compile();