diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2014-01-25 02:17:21 -0800 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2014-02-20 10:33:08 -0800 |
commit | 313402048fdad05d3401340129b9e412878d8957 (patch) | |
tree | 88cf5b3d86665917902e0547a6a306d05954a54c /src/glsl/linker.cpp | |
parent | 02dc74fbd72d82a21506a5984a92e5db08fcfc5c (diff) | |
download | external_mesa3d-313402048fdad05d3401340129b9e412878d8957.zip external_mesa3d-313402048fdad05d3401340129b9e412878d8957.tar.gz external_mesa3d-313402048fdad05d3401340129b9e412878d8957.tar.bz2 |
glsl/linker: produce gl_shader_program Geom.Invocations
Grab the parsed invocation count, check for consistency
during linking, and finally save the result in
gl_shader_program Geom.Invocations.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r-- | src/glsl/linker.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 7d605d7..f6b2661 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1206,6 +1206,7 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, unsigned num_shaders) { linked_shader->Geom.VerticesOut = 0; + linked_shader->Geom.Invocations = 0; linked_shader->Geom.InputType = PRIM_UNKNOWN; linked_shader->Geom.OutputType = PRIM_UNKNOWN; @@ -1259,6 +1260,18 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, } linked_shader->Geom.VerticesOut = shader->Geom.VerticesOut; } + + if (shader->Geom.Invocations != 0) { + if (linked_shader->Geom.Invocations != 0 && + linked_shader->Geom.Invocations != shader->Geom.Invocations) { + linker_error(prog, "geometry shader defined with conflicting " + "invocation count (%d and %d)\n", + linked_shader->Geom.Invocations, + shader->Geom.Invocations); + return; + } + linked_shader->Geom.Invocations = shader->Geom.Invocations; + } } /* Just do the intrastage -> interstage propagation right now, @@ -1285,6 +1298,11 @@ link_gs_inout_layout_qualifiers(struct gl_shader_program *prog, return; } prog->Geom.VerticesOut = linked_shader->Geom.VerticesOut; + + if (linked_shader->Geom.Invocations == 0) + linked_shader->Geom.Invocations = 1; + + prog->Geom.Invocations = linked_shader->Geom.Invocations; } |