openglshader: fixed ocio opengl incompatibility

This commit is contained in:
itsmattkc
2020-04-23 23:43:29 +10:00
parent d3e7678c13
commit c4fe5786a3
+9 -2
View File
@@ -83,7 +83,14 @@ OpenGLShaderPtr OpenGLShader::CreateOCIO(QOpenGLContext* ctx,
0, GL_RGB, GL_FLOAT, ocio_lut_data);
// Create OCIO shader code
QString shader_text(processor->getGpuShaderText(shaderDesc));
QString shader_text;
// Workaround since OCIO doesn't support the GLSL version we use
shader_text.append(QStringLiteral("#define texture2D texture\n"
"#define texture3D texture\n"));
// Append OCIO shader code
shader_text.append(processor->getGpuShaderText(shaderDesc));
QString shader_call;
@@ -100,7 +107,7 @@ OpenGLShaderPtr OpenGLShader::CreateOCIO(QOpenGLContext* ctx,
shader_text.append(CodeAlphaReassociate(reassociate_func_name));
// Make OCIO call pass through disassociate and reassociate function
shader_call = QStringLiteral("%3(%1(%2(col), ove_ociolut));").arg(ocio_func_name,
shader_call = QStringLiteral("%3(%1(%2(col*1.001), ove_ociolut));").arg(ocio_func_name,
disassociate_func_name,
reassociate_func_name);