summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-08-17 17:42:30 +0300
committerFrancisco Jerez <[email protected]>2015-08-20 12:28:48 +0300
commit307c382c1b514629c342587d2f320f5491de9b65 (patch)
treef62e7419e844862a4a8d3309c44c2aafd5c9eb78
parenta976b7255b2c84e6cccefb447029add02ddf86ae (diff)
glsl: Define image-related built-in constants required by GLSL ES 3.1.
Reviewed-by: Tapani Pälli <[email protected]>
-rw-r--r--src/glsl/builtin_variables.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
index 4966ba3ff4e..dd7804f7b8c 100644
--- a/src/glsl/builtin_variables.cpp
+++ b/src/glsl/builtin_variables.cpp
@@ -744,23 +744,31 @@ builtin_variable_generator::generate_constants()
*/
}
- if (state->is_version(420, 0) ||
+ if (state->is_version(420, 310) ||
state->ARB_shader_image_load_store_enable) {
add_const("gl_MaxImageUnits",
state->Const.MaxImageUnits);
- add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs",
- state->Const.MaxCombinedShaderOutputResources);
- add_const("gl_MaxImageSamples",
- state->Const.MaxImageSamples);
add_const("gl_MaxVertexImageUniforms",
state->Const.MaxVertexImageUniforms);
- add_const("gl_MaxGeometryImageUniforms",
- state->Const.MaxGeometryImageUniforms);
add_const("gl_MaxFragmentImageUniforms",
state->Const.MaxFragmentImageUniforms);
add_const("gl_MaxCombinedImageUniforms",
state->Const.MaxCombinedImageUniforms);
+ if (!state->es_shader) {
+ add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs",
+ state->Const.MaxCombinedShaderOutputResources);
+ add_const("gl_MaxImageSamples",
+ state->Const.MaxImageSamples);
+ add_const("gl_MaxGeometryImageUniforms",
+ state->Const.MaxGeometryImageUniforms);
+ }
+
+ if (state->is_version(450, 310)) {
+ add_const("gl_MaxCombinedShaderOutputResources",
+ state->Const.MaxCombinedShaderOutputResources);
+ }
+
if (state->is_version(400, 0) ||
state->ARB_tessellation_shader_enable) {
add_const("gl_MaxTessControlImageUniforms",