From 8e747d9af06e55255b5ae8f06434adfe7c54b0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 30 Jan 2021 19:01:36 -0500 Subject: [PATCH] mesa: move some uniform debug code from draws to state changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a step towards removing _mesa_valid_to_render. I don't know what this code does. This commit probably breaks it, but it doesn't seem important. We could remove the code. Reviewed-by: Zoltán Böszörményi Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mesa/main/draw_validate.c | 54 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/mesa/main/draw_validate.c b/src/mesa/main/draw_validate.c index 46846346210..0439d0aa8c4 100644 --- a/src/mesa/main/draw_validate.c +++ b/src/mesa/main/draw_validate.c @@ -183,33 +183,6 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where) return GL_FALSE; } -#ifdef DEBUG - if (ctx->_Shader->Flags & GLSL_LOG) { - struct gl_program **prog = ctx->_Shader->CurrentProgram; - - for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { - if (prog[i] == NULL || prog[i]->_Used) - continue; - - /* This is the first time this shader is being used. - * Append shader's constants/uniforms to log file. - * - * Only log data for the program target that matches the shader - * target. It's possible to have a program bound to the vertex - * shader target that also supplied a fragment shader. If that - * program isn't also bound to the fragment shader target we don't - * want to log its fragment data. - */ - _mesa_append_uniforms_to_file(prog[i]); - } - - for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { - if (prog[i] != NULL) - prog[i]->_Used = GL_TRUE; - } - } -#endif - return GL_TRUE; } @@ -521,6 +494,33 @@ _mesa_update_valid_to_render_state(struct gl_context *ctx) mask &= ~(1 << GL_PATCHES); } +#ifdef DEBUG + if (shader->Flags & GLSL_LOG) { + struct gl_program **prog = shader->CurrentProgram; + + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + if (prog[i] == NULL || prog[i]->_Used) + continue; + + /* This is the first time this shader is being used. + * Append shader's constants/uniforms to log file. + * + * Only log data for the program target that matches the shader + * target. It's possible to have a program bound to the vertex + * shader target that also supplied a fragment shader. If that + * program isn't also bound to the fragment shader target we don't + * want to log its fragment data. + */ + _mesa_append_uniforms_to_file(prog[i]); + } + + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + if (prog[i] != NULL) + prog[i]->_Used = GL_TRUE; + } + } +#endif + ctx->ValidPrimMask = mask; }