diff options
author | Francisco Jerez <[email protected]> | 2014-02-12 17:15:21 +0100 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2014-02-12 18:44:05 +0100 |
commit | 87acc7c650e765751eb787db7d23cc242670c68a (patch) | |
tree | 0ccd1816bcf00d176021e43be133a9044deba451 /src/glsl/builtin_variables.cpp | |
parent | 6057300ec68be3cbccdd3e6512aba833c63c2bb8 (diff) |
glsl: Add built-in constants for ARB_shader_image_load_store.
v2: Add them on GLSL version 4.20 too.
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/builtin_variables.cpp')
-rw-r--r-- | src/glsl/builtin_variables.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp index cc423383df8..2fa509f2765 100644 --- a/src/glsl/builtin_variables.cpp +++ b/src/glsl/builtin_variables.cpp @@ -711,6 +711,26 @@ builtin_variable_generator::generate_constants() * in ast_cs_input_layout::hir(). */ } + + if (state->is_version(420, 0) || + state->ARB_shader_image_load_store_enable) { + add_const("gl_MaxImageUnits", + state->Const.MaxImageUnits); + add_const("gl_MaxCombinedImageUnitsAndFragmentOutputs", + state->Const.MaxCombinedImageUnitsAndFragmentOutputs); + add_const("gl_MaxImageSamples", + state->Const.MaxImageSamples); + add_const("gl_MaxVertexImageUniforms", + state->Const.MaxVertexImageUniforms); + add_const("gl_MaxTessControlImageUniforms", 0); + add_const("gl_MaxTessEvaluationImageUniforms", 0); + add_const("gl_MaxGeometryImageUniforms", + state->Const.MaxGeometryImageUniforms); + add_const("gl_MaxFragmentImageUniforms", + state->Const.MaxFragmentImageUniforms); + add_const("gl_MaxCombinedImageUniforms", + state->Const.MaxCombinedImageUniforms); + } } |