From 60842b7181b65e2fe2a9de88608e427efd93c7ee Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 6 Dec 2023 00:08:25 +0100 Subject: [PATCH] vkd3d-shader/ir: Store source parameter swizzles as a uint32_t. --- libs/vkd3d-shader/spirv.c | 7 +++---- libs/vkd3d-shader/tpf.c | 2 +- libs/vkd3d-shader/vkd3d_shader_private.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 671f4689..aa8ceaa6 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -3600,8 +3600,7 @@ static uint32_t spirv_compiler_get_register_id(struct spirv_compiler *compiler, SpvStorageClassPrivate, VKD3D_SHADER_COMPONENT_FLOAT, VKD3D_VEC4_SIZE); } -static bool vkd3d_swizzle_is_equal(unsigned int dst_write_mask, - unsigned int swizzle, unsigned int write_mask) +static bool vkd3d_swizzle_is_equal(uint32_t dst_write_mask, uint32_t swizzle, uint32_t write_mask) { return vkd3d_compact_swizzle(VKD3D_SHADER_NO_SWIZZLE, dst_write_mask) == vkd3d_compact_swizzle(swizzle, write_mask); } @@ -3913,7 +3912,7 @@ static uint32_t spirv_compiler_emit_load_ssa_reg(struct spirv_compiler *compiler } static uint32_t spirv_compiler_emit_load_reg(struct spirv_compiler *compiler, - const struct vkd3d_shader_register *reg, DWORD swizzle, uint32_t write_mask) + const struct vkd3d_shader_register *reg, uint32_t swizzle, uint32_t write_mask) { struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; enum vkd3d_shader_component_type component_type; @@ -4209,7 +4208,7 @@ static void spirv_compiler_emit_store_dst(struct spirv_compiler *compiler, static void spirv_compiler_emit_store_dst_swizzled(struct spirv_compiler *compiler, const struct vkd3d_shader_dst_param *dst, uint32_t val_id, - enum vkd3d_shader_component_type component_type, DWORD swizzle) + enum vkd3d_shader_component_type component_type, uint32_t swizzle) { struct vkd3d_shader_dst_param typed_dst = *dst; val_id = spirv_compiler_emit_swizzle(compiler, diff --git a/libs/vkd3d-shader/tpf.c b/libs/vkd3d-shader/tpf.c index f859e758..2cc56663 100644 --- a/libs/vkd3d-shader/tpf.c +++ b/libs/vkd3d-shader/tpf.c @@ -5488,7 +5488,7 @@ static void write_sm4_loop(const struct tpf_writer *tpf, const struct hlsl_ir_lo static void write_sm4_gather(const struct tpf_writer *tpf, const struct hlsl_ir_node *dst, const struct hlsl_deref *resource, const struct hlsl_deref *sampler, - const struct hlsl_ir_node *coords, DWORD swizzle, const struct hlsl_ir_node *texel_offset) + const struct hlsl_ir_node *coords, uint32_t swizzle, const struct hlsl_ir_node *texel_offset) { struct vkd3d_shader_src_param *src; struct sm4_instruction instr; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 29513f16..317fa6d8 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -878,7 +878,7 @@ struct vkd3d_shader_dst_param struct vkd3d_shader_src_param { struct vkd3d_shader_register reg; - DWORD swizzle; + uint32_t swizzle; enum vkd3d_shader_src_modifier modifiers; };