summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-05-28 22:08:55 +0200
committerMarek Olšák <marek.olsak@amd.com>2015-07-23 00:59:26 +0200
commit206af9d049cab6e794db5abf63e3d11281343423 (patch)
treed4ae9d6c6cc0f7ee1d99e58569713371c9eaf13c /src/mesa/main/api_validate.c
parent3d528e7c476f25f24bca35d09d1f4c2b00123234 (diff)
downloadexternal_mesa3d-206af9d049cab6e794db5abf63e3d11281343423.zip
external_mesa3d-206af9d049cab6e794db5abf63e3d11281343423.tar.gz
external_mesa3d-206af9d049cab6e794db5abf63e3d11281343423.tar.bz2
mesa: don't allow drawing with tess ctrl shader and without tess eval shader
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 2e211c7..53c8fb8 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -69,6 +69,25 @@ 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:
*