aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
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/shaderapi.c
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/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c18
1 files changed, 16 insertions, 2 deletions
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: