From a758b61afed65a43bffce196fce48e2b3ef5d0a3 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Mon, 13 Sep 2021 10:07:49 +0200 Subject: [PATCH] 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 Reviewed-by: Gert Wollny --- src/vrend_shader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 84e1dd4..8b2b7ea 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)) {