diff options
author | Kenneth Graunke <[email protected]> | 2017-02-10 20:40:22 -0800 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-02-23 19:34:58 +0000 |
commit | 84a2f46cacfab79bc38f1b1212425f14228e94a3 (patch) | |
tree | d36947acd7179f8db9bfa8657be7206ba2c2093c | |
parent | 1db3cebcbd300d3a0f07229c99c423324eef8fef (diff) |
mesa: Do (TCS && !TES) draw time validation in ES as well.
Now that we have OES_tessellation_shader, the same situation can occur
in ES too, not just GL core profile.
Having a TCS but no TES may confuse drivers - i965 crashes, for example.
This prevents regressions in
ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage
with some SSO pipeline validation changes I'm making.
v2: Add an ES spec citation (suggested by Alejandro)
Cc: "17.0" <[email protected]>
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Alejandro PiƱeiro <[email protected]>
(cherry picked from commit 05a56893aa2570cb1f6e61e3c9cf365266ea1d3a)
-rw-r--r-- | src/mesa/main/api_validate.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 5f051dbec6f..52c721a383f 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -238,6 +238,32 @@ check_valid_to_render(struct gl_context *ctx, const char *function) return false; } + /* 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." + * + * The OpenGL spec argues that this is allowed because a tess ctrl shader + * without a tess eval shader can be used with transform feedback. + * However, glBeginTransformFeedback doesn't allow GL_PATCHES and + * therefore doesn't allow tessellation. + * + * Further investigation showed that this is indeed a spec bug and + * a tess ctrl shader without a tess eval shader shouldn't have been + * allowed, because there is no API in GL 4.0 that can make use this + * to produce something useful. + * + * Also, all vendors except one don't support a tess ctrl shader without + * a tess eval shader anyway. + */ + if (ctx->TessCtrlProgram._Current && !ctx->TessEvalProgram._Current) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(tess eval shader is missing)", function); + return false; + } + switch (ctx->API) { case API_OPENGLES2: /* For ES2, we can draw if we have a vertex program/shader). */ @@ -262,25 +288,6 @@ check_valid_to_render(struct gl_context *ctx, const char *function) return false; } - /* The spec argues that this is allowed because a tess ctrl shader - * without a tess eval shader can be used with transform feedback. - * However, glBeginTransformFeedback doesn't allow GL_PATCHES and - * therefore doesn't allow tessellation. - * - * Further investigation showed that this is indeed a spec bug and - * a tess ctrl shader without a tess eval shader shouldn't have been - * allowed, because there is no API in GL 4.0 that can make use this - * to produce something useful. - * - * Also, all vendors except one don't support a tess ctrl shader without - * a tess eval shader anyway. - */ - if (ctx->TessCtrlProgram._Current && !ctx->TessEvalProgram._Current) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "%s(tess eval shader is missing)", function); - return false; - } - /* Section 7.3 (Program Objects) of the OpenGL 4.5 Core Profile spec * says: * |