vkd3d-shader/ir: Pass a uint32_t write mask to vkd3d_write_mask_32_from_64().

This commit is contained in:
Henri Verbeet 2023-12-05 22:42:32 +01:00 committed by Alexandre Julliard
parent 3759186193
commit 21491d1bbb
Notes: Alexandre Julliard 2023-12-13 23:23:35 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/522
3 changed files with 5 additions and 5 deletions

View File

@ -1317,7 +1317,7 @@ static void shader_dump_dst_param(struct vkd3d_d3d_asm_compiler *compiler,
static const char write_mask_chars[] = "xyzw";
if (param->reg.data_type == VKD3D_DATA_DOUBLE)
write_mask = vkd3d_write_mask_32_from_64(write_mask);
write_mask = vsir_write_mask_32_from_64(write_mask);
shader_addline(buffer, ".%s", compiler->colours.write_mask);
if (write_mask & VKD3DSP_WRITEMASK_0)

View File

@ -3932,7 +3932,7 @@ static uint32_t spirv_compiler_emit_load_reg(struct spirv_compiler *compiler,
assert(reg_info.component_type != VKD3D_SHADER_COMPONENT_DOUBLE);
spirv_compiler_emit_dereference_register(compiler, reg, &reg_info);
write_mask32 = (reg->data_type == VKD3D_DATA_DOUBLE) ? vkd3d_write_mask_32_from_64(write_mask) : write_mask;
write_mask32 = (reg->data_type == VKD3D_DATA_DOUBLE) ? vsir_write_mask_32_from_64(write_mask) : write_mask;
/* Intermediate value (no storage class). */
if (reg_info.storage_class == SpvStorageClassMax)
@ -4149,7 +4149,7 @@ static void spirv_compiler_emit_store_reg(struct spirv_compiler *compiler,
if (component_type != reg_info.component_type)
{
if (reg->data_type == VKD3D_DATA_DOUBLE)
src_write_mask = vkd3d_write_mask_32_from_64(write_mask);
src_write_mask = vsir_write_mask_32_from_64(write_mask);
type_id = vkd3d_spirv_get_type_id(builder, reg_info.component_type,
vsir_write_mask_component_count(src_write_mask));
val_id = vkd3d_spirv_build_op_bitcast(builder, type_id, val_id);

View File

@ -1550,9 +1550,9 @@ static inline uint32_t vsir_write_mask_64_from_32(uint32_t write_mask32)
return (write_mask64 & VKD3DSP_WRITEMASK_0) | ((write_mask64 & VKD3DSP_WRITEMASK_2) >> 1);
}
static inline unsigned int vkd3d_write_mask_32_from_64(unsigned int write_mask64)
static inline uint32_t vsir_write_mask_32_from_64(uint32_t write_mask64)
{
unsigned int write_mask32 = (write_mask64 | (write_mask64 << 1))
uint32_t write_mask32 = (write_mask64 | (write_mask64 << 1))
& (VKD3DSP_WRITEMASK_0 | VKD3DSP_WRITEMASK_2);
return write_mask32 | (write_mask32 << 1);
}