summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pipelineobj.c
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2015-11-24 11:44:13 +1100
committerTimothy Arceri <t_arceri@yahoo.com.au>2015-11-24 20:59:48 +1100
commit2571a768d6cacfbc7e434dfc2b6d01bdf5be21a6 (patch)
treeeba956c50613f677a1ba41d8fc6e020cecf3ede0 /src/mesa/main/pipelineobj.c
parent3c4aa7aff2a976e94c2b6b7bf273edd617080ca3 (diff)
downloadexternal_mesa3d-2571a768d6cacfbc7e434dfc2b6d01bdf5be21a6.zip
external_mesa3d-2571a768d6cacfbc7e434dfc2b6d01bdf5be21a6.tar.gz
external_mesa3d-2571a768d6cacfbc7e434dfc2b6d01bdf5be21a6.tar.bz2
glsl: implement recent spec update to SSO validation
Enables 200+ dEQP SSO tests to proceed past validation, and fixes a ES31-CTS.sepshaderobjs.PipelineApi subtest. V2: split out change that reverts a previous patch into its own commit, move variable declaration to top of function, and fix some formatting all suggested by Ian. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Cc: "11.1" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/mesa/main/pipelineobj.c')
-rw-r--r--src/mesa/main/pipelineobj.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
index f079c50..0439129 100644
--- a/src/mesa/main/pipelineobj.c
+++ b/src/mesa/main/pipelineobj.c
@@ -761,6 +761,7 @@ _mesa_validate_program_pipeline(struct gl_context* ctx,
GLboolean IsBound)
{
unsigned i;
+ bool program_empty = true;
pipe->Validated = GL_FALSE;
@@ -857,6 +858,29 @@ _mesa_validate_program_pipeline(struct gl_context* ctx,
}
}
+ /* Section 11.1.3.11 (Validation) of the OpenGL 4.5 spec says:
+ *
+ * "An INVALID_OPERATION error is generated by any command that trans-
+ * fers vertices to the GL or launches compute work if the current set
+ * of active program objects cannot be executed, for reasons including:
+ *
+ * ...
+ *
+ * - There is no current program object specified by UseProgram,
+ * there is a current program pipeline object, and that object is
+ * empty (no executable code is installed for any stage).
+ */
+ for (i = 0; i < MESA_SHADER_STAGES; i++) {
+ if (pipe->CurrentProgram[i]) {
+ program_empty = false;
+ break;
+ }
+ }
+
+ if (program_empty) {
+ goto err;
+ }
+
/* Section 2.11.11 (Shader Execution), subheading "Validation," of the
* OpenGL 4.1 spec says:
*