[virglrenderer-devel] [PATCH 1/4] vrend_shader: fixup typo in indirect image-handling

Erik Faye-Lund erik.faye-lund at collabora.com
Mon Aug 6 18:38:09 UTC 2018


When emitting an image array, the code errorously used the loop
counter instead of the image entry for looking up the resource.

The rest of the code uses idx, which seems like the right thing
to do. So let's match that instead.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
---

This seems to be a typo in 4472641b ("shader: add image support to
shader parsing. (v3)") that was missed during code-review.

I spotted this while reading the code, so I don't know if there were any
real-world fallout from this. But I wouldn't be too surprised if there
were.

Please review :)

 src/vrend_shader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vrend_shader.c b/src/vrend_shader.c
index bc846d1..67c12a5 100644
--- a/src/vrend_shader.c
+++ b/src/vrend_shader.c
@@ -4684,7 +4684,7 @@ static char *emit_ios(struct dump_ctx *ctx, char *glsl_hdr)
          formatstr = get_internalformat_string(ctx->images[idx].decl.Format, &itype);
          ptc = vrend_shader_samplerreturnconv(itype);
          sname = tgsi_proc_to_prefix(ctx->prog_type);
-         stc = vrend_shader_samplertypeconv(ctx->images[i].decl.Resource, &is_shad);
+         stc = vrend_shader_samplertypeconv(ctx->images[idx].decl.Resource, &is_shad);
          snprintf(buf, 255, "%s%s%suniform %cimage%s %simg%d[%d];\n", formatstr, writeonly, volatile_str, ptc, stc, sname, idx, ctx->image_arrays[i].array_size);
          STRCAT_WITH_RET(glsl_hdr, buf);
       }
-- 
2.18.0



More information about the virglrenderer-devel mailing list