From 3c6470e3b2590fe44bee4fa87b95ce9d4cee21b4 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 19 Apr 2024 11:40:14 +0200 Subject: [PATCH] vkd3d-shader/fx: Set UAV count in the header. Signed-off-by: Nikolay Sivov --- libs/vkd3d-shader/fx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index c55577ad..1100dd2e 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -90,6 +90,7 @@ struct fx_write_context uint32_t dsv_count; uint32_t rtv_count; uint32_t texture_count; + uint32_t uav_count; int status; bool child_effect; @@ -1029,6 +1030,7 @@ static void write_fx_4_object_variable(struct hlsl_ir_var *var, struct fx_write_ fx->texture_count += elements_count; break; case HLSL_CLASS_UAV: + fx->uav_count += elements_count; break; case HLSL_CLASS_PIXEL_SHADER: @@ -1263,7 +1265,7 @@ static int hlsl_fx_5_write(struct hlsl_ctx *ctx, struct vkd3d_shader_code *out) put_u32(&buffer, fx.shader_count); put_u32(&buffer, 0); /* Inline shader count. */ put_u32(&buffer, fx.group_count); /* Group count. */ - put_u32(&buffer, 0); /* UAV count. */ + put_u32(&buffer, fx.uav_count); put_u32(&buffer, 0); /* Interface variables count. */ put_u32(&buffer, 0); /* Interface variable element count. */ put_u32(&buffer, 0); /* Class instance elements count. */