mesa: Only validate SSO shader IO in OpenGL ES or debug context

v2: Move later in series to avoid issues with Gallium drivers and debug
contexts.  Suggested by Ilia.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Suggested-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
This commit is contained in:
Ian Romanick 2016-05-19 10:27:12 -07:00
parent 3722c76001
commit 326a269c77
2 changed files with 16 additions and 5 deletions

View file

@ -906,7 +906,8 @@ _mesa_validate_program_pipeline(struct gl_context* ctx,
/* Validate inputs against outputs, this cannot be done during linking
* since programs have been linked separately from each other.
*
* From OpenGL 4.5 Core spec:
* Section 11.1.3.11 (Validation) of the OpenGL 4.5 Core Profile spec says:
*
* "Separable program objects may have validation failures that cannot be
* detected without the complete program pipeline. Mismatched interfaces,
* improper usage of program objects together, and the same
@ -914,8 +915,21 @@ _mesa_validate_program_pipeline(struct gl_context* ctx,
* program objects."
*
* OpenGL ES 3.1 specification has the same text.
*
* Section 11.1.3.11 (Validation) of the OpenGL ES spec also says:
*
* An INVALID_OPERATION error is generated by any command that transfers
* vertices to the GL or launches compute work if the current set of
* active program objects cannot be executed, for reasons including:
*
* * The current program pipeline object contains a shader interface
* that doesn't have an exact match (see section 7.4.1)
*
* Based on this, only perform the most-strict checking on ES or when the
* application has created a debug context.
*/
if (!_mesa_validate_pipeline_io(pipe))
if ((_mesa_is_gles(ctx) || (ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) &&
!_mesa_validate_pipeline_io(pipe))
return GL_FALSE;
pipe->Validated = GL_TRUE;

View file

@ -1377,9 +1377,6 @@ validate_io(struct gl_shader_program *producer,
if (producer == consumer)
return true;
if (!producer->IsES && !consumer->IsES)
return true;
bool valid = true;
gl_shader_variable const **outputs =