Proper support for fragment output variables for GLSL ES shader version 300.
TRAC #22704
Signed-off-by: Geoff Lang
Signed-off-by: Nicolas Capens
Authored-by: Jamie Madill
diff --git a/src/libGLESv2/Shader.cpp b/src/libGLESv2/Shader.cpp
index 5329e6f..c18706a 100644
--- a/src/libGLESv2/Shader.cpp
+++ b/src/libGLESv2/Shader.cpp
@@ -706,5 +706,26 @@
compileToHLSL(mFragmentCompiler);
parseVaryings();
mVaryings.sort(compareVarying);
+
+ const char *hlsl = getHLSL();
+ if (hlsl)
+ {
+ void *activeOutputVariables;
+ ShGetInfoPointer(mFragmentCompiler, SH_ACTIVE_OUTPUT_VARIABLES_ARRAY, &activeOutputVariables);
+ mActiveOutputVariables = *(sh::ActiveShaderVariables*)activeOutputVariables;
+ }
}
+
+void FragmentShader::uncompile()
+{
+ Shader::uncompile();
+
+ mActiveOutputVariables.clear();
+}
+
+const sh::ActiveShaderVariables &FragmentShader::getOutputVariables() const
+{
+ return mActiveOutputVariables;
+}
+
}