summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-02-01 23:02:03 -0800
committerKenneth Graunke <[email protected]>2017-02-12 21:09:19 -0800
commit365afbdaef8f47bf8a434defcf3eed2b5bdfb4ce (patch)
tree3c259457362d5ad182d332294d310fdbca8bf4bf /src/mesa/main
parent05a56893aa2570cb1f6e61e3c9cf365266ea1d3a (diff)
mesa: Do a draw time check for TES && !TCS in ES 3.x.
ES 3.x requires both TCS and TES to be present. We already checked the TCS && !TES case above, so we just have to check !TCS && TES here. Note that this is allowed in OpenGL, just not ES. This fixes a subcase of: dEQP-GLES31.functional.debug.negative_coverage.*.tessellation.single_tessellation_stage Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/api_validate.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index e7c439c431a..1e8a714067b 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -264,6 +264,20 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
switch (ctx->API) {
case API_OPENGLES2:
+ /* Section 11.2 (Tessellation) of the ES 3.2 spec says:
+ *
+ * "An INVALID_OPERATION error is generated by any command that
+ * transfers vertices to the GL if the current program state has
+ * one but not both of a tessellation control shader and tessellation
+ * evaluation shader."
+ */
+ if (_mesa_is_gles3(ctx) &&
+ ctx->TessEvalProgram._Current && !ctx->TessCtrlProgram._Current) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(tess ctrl shader is missing)", function);
+ return false;
+ }
+
/* For ES2, we can draw if we have a vertex program/shader). */
return ctx->VertexProgram._Current != NULL;