summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-06-14 01:21:02 +0200
committerMarek Olšák <[email protected]>2015-07-23 00:59:26 +0200
commit882413f1c5926503550a42554a83f57f85fec82d (patch)
treecae0379f8c885bbed9a1c7f572190dadf94b3fa3
parent550a570c5325cc64a547fe4d6e1e75af2d0e9587 (diff)
mesa: add program interface queries for tessellation shaders
Based on a patch by Chris Forbes <[email protected]>. Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/main/shader_query.cpp8
-rw-r--r--src/mesa/main/uniforms.c21
2 files changed, 21 insertions, 8 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
index c8d3687faa6..c58d3474df7 100644
--- a/src/mesa/main/shader_query.cpp
+++ b/src/mesa/main/shader_query.cpp
@@ -827,6 +827,10 @@ stage_from_enum(GLenum ref)
switch (ref) {
case GL_REFERENCED_BY_VERTEX_SHADER:
return MESA_SHADER_VERTEX;
+ case GL_REFERENCED_BY_TESS_CONTROL_SHADER:
+ return MESA_SHADER_TESS_CTRL;
+ case GL_REFERENCED_BY_TESS_EVALUATION_SHADER:
+ return MESA_SHADER_TESS_EVAL;
case GL_REFERENCED_BY_GEOMETRY_SHADER:
return MESA_SHADER_GEOMETRY;
case GL_REFERENCED_BY_FRAGMENT_SHADER:
@@ -1012,6 +1016,8 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg,
goto invalid_enum;
/* fallthrough */
case GL_REFERENCED_BY_VERTEX_SHADER:
+ case GL_REFERENCED_BY_TESS_CONTROL_SHADER:
+ case GL_REFERENCED_BY_TESS_EVALUATION_SHADER:
case GL_REFERENCED_BY_GEOMETRY_SHADER:
case GL_REFERENCED_BY_FRAGMENT_SHADER:
switch (res->Type) {
@@ -1045,8 +1051,6 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg,
/* GL_ARB_tessellation_shader */
case GL_IS_PER_PATCH:
- case GL_REFERENCED_BY_TESS_CONTROL_SHADER:
- case GL_REFERENCED_BY_TESS_EVALUATION_SHADER:
default:
goto invalid_enum;
}
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index a577a2569f2..6ba746e2f58 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -1092,6 +1092,21 @@ mesa_bufferiv(struct gl_shader_program *shProg, GLenum type,
GL_REFERENCED_BY_VERTEX_SHADER, params,
caller);
return;
+
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_TESS_CONTROL_SHADER, params,
+ caller);
+ return;
+
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER:
+ case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER:
+ _mesa_program_resource_prop(shProg, res, index,
+ GL_REFERENCED_BY_TESS_EVALUATION_SHADER, params,
+ caller);
+ return;
+
case GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER:
case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER:
_mesa_program_resource_prop(shProg, res, index,
@@ -1104,12 +1119,6 @@ mesa_bufferiv(struct gl_shader_program *shProg, GLenum type,
GL_REFERENCED_BY_FRAGMENT_SHADER, params,
caller);
return;
- case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER:
- params[0] = GL_FALSE;
- return;
- case GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER:
- params[0] = GL_FALSE;
- return;
default:
_mesa_error(ctx, GL_INVALID_ENUM,
"%s(pname 0x%x (%s))", caller, pname,