summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2016-09-24 17:59:55 -0700
committerKenneth Graunke <[email protected]>2017-01-07 22:22:28 -0800
commita4fd84ef5f247f50a3683ecdf7f9d801a6e3cf15 (patch)
treedcf2a26e9a8cde7d6bc77fee2aaf8b655fe11adc /src/mesa/main
parent9bb89175e6487186389b69e8ee0b587d38ed8015 (diff)
mesa: Introduce a compiler enum for tessellation spacing.
It feels weird using GL_* enums in a Vulkan driver. v2: Fix the TESS_SPACING -> PIPE_TESS_SPACING conversion. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h8
-rw-r--r--src/mesa/main/shaderapi.c18
2 files changed, 19 insertions, 7 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index dadedb145ad..691323d8f3c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2279,11 +2279,9 @@ struct gl_shader_info
* in this shader.
*/
GLenum PrimitiveMode;
- /**
- * GL_EQUAL, GL_FRACTIONAL_ODD, GL_FRACTIONAL_EVEN, or 0 if it's not set
- * in this shader.
- */
- GLenum Spacing;
+
+ enum gl_tess_spacing Spacing;
+
/**
* GL_CW, GL_CCW, or 0 if it's not set in this shader.
*/
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index f198a3c6302..7771b7ce7da 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -838,8 +838,22 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname,
if (!has_tess)
break;
if (check_tes_query(ctx, shProg)) {
- *params = shProg->_LinkedShaders[MESA_SHADER_TESS_EVAL]->
- info.TessEval.Spacing;
+ const struct gl_linked_shader *tes =
+ shProg->_LinkedShaders[MESA_SHADER_TESS_EVAL];
+ switch (tes->info.TessEval.Spacing) {
+ case TESS_SPACING_EQUAL:
+ *params = GL_EQUAL;
+ break;
+ case TESS_SPACING_FRACTIONAL_ODD:
+ *params = GL_FRACTIONAL_ODD;
+ break;
+ case TESS_SPACING_FRACTIONAL_EVEN:
+ *params = GL_FRACTIONAL_EVEN;
+ break;
+ case TESS_SPACING_UNSPECIFIED:
+ *params = 0;
+ break;
+ }
}
return;
case GL_TESS_GEN_VERTEX_ORDER: