From d45043d3b859b73f56c2379f3bba3bda29e8108d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 30 Jan 2021 23:22:10 -0500 Subject: [PATCH] mesa: don't report 1 for GL_VALIDATE_STATUS if user didn't validate pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dEQP expects GL_VALIDATE_STATUS to be set to 0 if the user didn't call glValidateProgramPipeline even if the pipeline is valid, but we will validate pipeline objects in state changes, not draw calls. This will fix a failure in this test caused by the next commit: dEQP-GLES31.functional.state_query.program_pipeline.validate_status_get_program_pipelineiv Reviewed-by: Zoltán Böszörményi Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/main/mtypes.h | 1 + src/mesa/main/pipelineobj.c | 5 +++-- src/mesa/main/uniform_query.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e2d41978fd3..d3ef0d4cb83 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3236,6 +3236,7 @@ struct gl_pipeline_object GLbitfield Flags; /**< Mask of GLSL_x flags */ GLboolean EverBound; /**< Has the pipeline object been created */ GLboolean Validated; /**< Pipeline Validation status */ + GLboolean UserValidated; /**< Validation status initiated by the user */ GLchar *InfoLog; }; diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index 5dedebd3cf5..50b9619d8f2 100644 --- a/src/mesa/main/pipelineobj.c +++ b/src/mesa/main/pipelineobj.c @@ -253,7 +253,7 @@ use_program_stages(struct gl_context *ctx, struct gl_shader_program *shProg, if ((stages & GL_COMPUTE_SHADER_BIT) != 0) use_program_stage(ctx, GL_COMPUTE_SHADER, shProg, pipe); - pipe->Validated = false; + pipe->Validated = pipe->UserValidated = false; } void GLAPIENTRY @@ -734,7 +734,7 @@ _mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) strlen(pipe->InfoLog) + 1 : 0; return; case GL_VALIDATE_STATUS: - *params = pipe->Validated; + *params = pipe->UserValidated; return; case GL_VERTEX_SHADER: *params = pipe->CurrentProgram[MESA_SHADER_VERTEX] @@ -1055,6 +1055,7 @@ _mesa_ValidateProgramPipeline(GLuint pipeline) } _mesa_validate_program_pipeline(ctx, pipe); + pipe->UserValidated = pipe->Validated; } void GLAPIENTRY diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp index 82ebe7dad02..9d368ce27bb 100644 --- a/src/mesa/main/uniform_query.cpp +++ b/src/mesa/main/uniform_query.cpp @@ -1013,7 +1013,7 @@ validate_uniform(GLint location, GLsizei count, const GLvoid *values, /* We need to reset the validate flag on changes to samplers in case * two different sampler types are set to the same texture unit. */ - ctx->_Shader->Validated = GL_FALSE; + ctx->_Shader->Validated = ctx->_Shader->UserValidated = GL_FALSE; } if (uni->type->is_image()) {