summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-01-13 14:40:05 +1100
committerTimothy Arceri <[email protected]>2016-03-31 12:49:51 +1100
commit52caeee7e78c2bed0329dcb7a5984826fa5960a6 (patch)
treefeae178b9b661c2732be11dd25e090c8cffc45db /src
parent8765a9e0fe2987caa6af7473cbc4c55754621806 (diff)
glsl: add transform feedback built-in constants
These are new built-ins added by ARB_enhanced_layouts. Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/compiler/glsl/builtin_variables.cpp7
-rw-r--r--src/compiler/glsl/glsl_parser_extras.cpp4
-rw-r--r--src/compiler/glsl/glsl_parser_extras.h4
3 files changed, 15 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_variables.cpp b/src/compiler/glsl/builtin_variables.cpp
index 4e2de37fbba..c39ae507b62 100644
--- a/src/compiler/glsl/builtin_variables.cpp
+++ b/src/compiler/glsl/builtin_variables.cpp
@@ -812,6 +812,13 @@ builtin_variable_generator::generate_constants()
*/
}
+ if (state->has_enhanced_layouts()) {
+ add_const("gl_MaxTransformFeedbackBuffers",
+ state->Const.MaxTransformFeedbackBuffers);
+ add_const("gl_MaxTransformFeedbackInterleavedComponents",
+ state->Const.MaxTransformFeedbackInterleavedComponents);
+ }
+
if (state->is_version(420, 310) ||
state->ARB_shader_image_load_store_enable) {
add_const("gl_MaxImageUnits",
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index ea9639b728d..a8fa75395e0 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -138,6 +138,10 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
this->Const.MaxAtomicCounterBufferSize =
ctx->Const.MaxAtomicBufferSize;
+ /* ARB_enhanced_layouts constants */
+ this->Const.MaxTransformFeedbackBuffers = ctx->Const.MaxTransformFeedbackBuffers;
+ this->Const.MaxTransformFeedbackInterleavedComponents = ctx->Const.MaxTransformFeedbackInterleavedComponents;
+
/* Compute shader constants */
for (unsigned i = 0; i < ARRAY_SIZE(this->Const.MaxComputeWorkGroupCount); i++)
this->Const.MaxComputeWorkGroupCount[i] = ctx->Const.MaxComputeWorkGroupCount[i];
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 24195f97f18..86008b48519 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -383,6 +383,10 @@ struct _mesa_glsl_parse_state {
/* ARB_draw_buffers */
unsigned MaxDrawBuffers;
+ /* ARB_enhanced_layouts */
+ unsigned MaxTransformFeedbackBuffers;
+ unsigned MaxTransformFeedbackInterleavedComponents;
+
/* ARB_blend_func_extended */
unsigned MaxDualSourceDrawBuffers;