From d986bc1245c6bce36a198ec5f2952d7294ed3498 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 10 Aug 2021 13:10:15 +0200 Subject: [PATCH] shader: move shader debug output after shader creation is complete Since we patch the shaders right away only print the shader debug output after the conversion and the pathcing is finished. This requires that the tcs pass-through shader printing is moved to the according function. Signed-off-by: Gert Wollny Reviewed-by: Rohan Garg --- src/vrend_shader.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 01c0666..b74585b 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -7075,9 +7075,6 @@ static void set_strbuffers(MAYBE_UNUSED const struct vrend_context *rctx, const strarray_addstrbuf(shader, &glsl_strbufs->glsl_ver_ext); strarray_addstrbuf(shader, &glsl_strbufs->glsl_hdr); strarray_addstrbuf(shader, &glsl_strbufs->glsl_main); - VREND_DEBUG(dbg_shader_glsl, rctx, "GLSL:"); - VREND_DEBUG_EXT(dbg_shader_glsl, rctx, strarray_dump(shader)); - VREND_DEBUG(dbg_shader_glsl, rctx, "\n"); } static bool vrend_patch_vertex_shader_interpolants(MAYBE_UNUSED const struct vrend_context *rctx, @@ -7214,6 +7211,10 @@ bool vrend_convert_shader(const struct vrend_context *rctx, key->flatshade); } + VREND_DEBUG(dbg_shader_glsl, rctx, "GLSL:"); + VREND_DEBUG_EXT(dbg_shader_glsl, rctx, strarray_dump(shader)); + VREND_DEBUG(dbg_shader_glsl, rctx, "\n"); + return true; fail: strbuf_free(&ctx.glsl_strbufs.glsl_main); @@ -7322,10 +7323,6 @@ static bool vrend_patch_vertex_shader_interpolants(MAYBE_UNUSED const struct vre } } - VREND_DEBUG(dbg_shader_glsl, rctx, "GLSL:"); - VREND_DEBUG_EXT(dbg_shader_glsl, rctx, strarray_dump(prog_strings)); - VREND_DEBUG(dbg_shader_glsl, rctx, "\n"); - return true; } @@ -7530,6 +7527,11 @@ bool vrend_shader_create_passthrough_tcs(const struct vrend_context *rctx, fill_sinfo(&ctx, sinfo); set_strbuffers(rctx, &ctx.glsl_strbufs, shader); + + VREND_DEBUG(dbg_shader_glsl, rctx, "GLSL:"); + VREND_DEBUG_EXT(dbg_shader_glsl, rctx, strarray_dump(shader)); + VREND_DEBUG(dbg_shader_glsl, rctx, "\n"); + return true; fail: strbuf_free(&ctx.glsl_strbufs.glsl_main);