diff options
author | Rohan Garg <rohan.garg@collabora.com> | 2021-09-13 10:07:49 +0200 |
---|---|---|
committer | Gert Wollny <gw.fossdev@gmail.com> | 2021-09-16 06:45:25 +0000 |
commit | a758b61afed65a43bffce196fce48e2b3ef5d0a3 (patch) | |
tree | d3e7aae5d93c77b486da0d1676a4fb48ed4d5b2b | |
parent | cada1db3d4a551e0801cfa1c2ca37173f77ea4cc (diff) | |
download | virglrenderer-a758b61afed65a43bffce196fce48e2b3ef5d0a3.tar.gz |
vrend_shader: Make the emission of uniform atomic_uint more concise
Cleanup and make things a little more concise by handling atomic_uint
arrays separately.
Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
-rw-r--r-- | src/vrend_shader.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 84e1dd44..8b2b7ea8 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -6081,10 +6081,10 @@ static int emit_ios_common(const struct dump_ctx *ctx, } for (i = 0; i < ctx->num_abo; i++){ + emit_hdrf(glsl_strbufs, "layout (binding = %d, offset = %d) uniform atomic_uint ac%d_%d", ctx->abo_idx[i], ctx->abo_offsets[i] * 4, ctx->abo_idx[i], ctx->abo_offsets[i] * 4); if (ctx->abo_sizes[i] > 1) - emit_hdrf(glsl_strbufs, "layout (binding = %d, offset = %d) uniform atomic_uint ac%d_%d[%d];\n", ctx->abo_idx[i], ctx->abo_offsets[i] * 4, ctx->abo_idx[i], ctx->abo_offsets[i] * 4, ctx->abo_sizes[i]); - else - emit_hdrf(glsl_strbufs, "layout (binding = %d, offset = %d) uniform atomic_uint ac%d_%d;\n", ctx->abo_idx[i], ctx->abo_offsets[i] * 4, ctx->abo_idx[i], ctx->abo_offsets[i] * 4); + emit_hdrf(glsl_strbufs, "[%d]", ctx->abo_sizes[i]); + emit_hdrf(glsl_strbufs, ";\n"); } if (ctx->info.indirect_files & (1 << TGSI_FILE_BUFFER)) { |