From 81802e27d0fd678525ba0c56020a164df39e8443 Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Tue, 5 Sep 2023 12:22:13 -0300 Subject: [PATCH] vkd3d-shader/spirv: Use vsir_register_init() in spirv_compiler_emit_resource_declaration(). --- libs/vkd3d-shader/spirv.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index f9ffd709..296d3e77 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5917,13 +5917,10 @@ static void spirv_compiler_emit_resource_declaration(struct spirv_compiler *comp const struct vkd3d_spirv_resource_type *resource_type_info; enum vkd3d_shader_component_type sampled_type; struct vkd3d_symbol resource_symbol; + struct vkd3d_shader_register reg; - struct vkd3d_shader_register reg = - { - .type = is_uav ? VKD3DSPR_UAV : VKD3DSPR_RESOURCE, - .idx[0].offset = register_id, - .idx_count = 1, - }; + vsir_register_init(®, is_uav ? VKD3DSPR_UAV : VKD3DSPR_RESOURCE, VKD3D_DATA_FLOAT, 1); + reg.idx[0].offset = register_id; if (resource_type == VKD3D_SHADER_RESOURCE_TEXTURE_2DMS && sample_count == 1) resource_type = VKD3D_SHADER_RESOURCE_TEXTURE_2D;