vkd3d-shader/ir: Consistently use VSIR_DATA_U32 for resinfo_uint destination operands.

Much like we do for sample_info_uint.
This commit is contained in:
Henri Verbeet
2025-07-22 21:02:23 +02:00
parent b88be5b92b
commit f02405350e
Notes: Henri Verbeet 2025-07-23 17:31:10 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1641
2 changed files with 6 additions and 14 deletions

View File

@@ -9922,11 +9922,11 @@ static void spirv_compiler_emit_bufinfo(struct spirv_compiler *compiler,
static void spirv_compiler_emit_resinfo(struct spirv_compiler *compiler, static void spirv_compiler_emit_resinfo(struct spirv_compiler *compiler,
const struct vkd3d_shader_instruction *instruction) const struct vkd3d_shader_instruction *instruction)
{ {
enum vkd3d_shader_component_type component_type = VKD3D_SHADER_COMPONENT_UINT;
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
const struct vkd3d_shader_dst_param *dst = instruction->dst; const struct vkd3d_shader_dst_param *dst = instruction->dst;
const struct vkd3d_shader_src_param *src = instruction->src; const struct vkd3d_shader_src_param *src = instruction->src;
uint32_t type_id, lod_id, val_id, miplevel_count_id; uint32_t type_id, lod_id, val_id, miplevel_count_id;
enum vkd3d_shader_component_type component_type;
uint32_t constituents[VKD3D_VEC4_SIZE]; uint32_t constituents[VKD3D_VEC4_SIZE];
unsigned int i, size_component_count; unsigned int i, size_component_count;
struct vkd3d_shader_image image; struct vkd3d_shader_image image;
@@ -9967,19 +9967,10 @@ static void spirv_compiler_emit_resinfo(struct spirv_compiler *compiler,
val_id = vkd3d_spirv_build_op_composite_construct(builder, val_id = vkd3d_spirv_build_op_composite_construct(builder,
type_id, constituents, i + 2); type_id, constituents, i + 2);
component_type = VKD3D_SHADER_COMPONENT_FLOAT; if (!(instruction->flags & VKD3DSI_RESINFO_UINT))
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_FLOAT, VKD3D_VEC4_SIZE);
if (instruction->flags == VKD3DSI_RESINFO_UINT)
{
/* SSA registers must match the specified result type. */
if (!register_is_ssa(&dst->reg))
val_id = vkd3d_spirv_build_op_bitcast(builder, type_id, val_id);
else
component_type = VKD3D_SHADER_COMPONENT_UINT;
}
else
{ {
component_type = VKD3D_SHADER_COMPONENT_FLOAT;
type_id = vkd3d_spirv_get_type_id(builder, component_type, VKD3D_VEC4_SIZE);
val_id = vkd3d_spirv_build_op_convert_utof(builder, type_id, val_id); val_id = vkd3d_spirv_build_op_convert_utof(builder, type_id, val_id);
} }
val_id = spirv_compiler_emit_swizzle(compiler, val_id, VKD3DSP_WRITEMASK_ALL, val_id = spirv_compiler_emit_swizzle(compiler, val_id, VKD3DSP_WRITEMASK_ALL,

View File

@@ -2742,7 +2742,8 @@ static void shader_sm4_read_instruction(struct vkd3d_shader_sm4_parser *sm4, str
} }
} }
if (ins->opcode == VSIR_OP_SAMPLE_INFO && ins->flags & VKD3DSI_SAMPLE_INFO_UINT) if ((ins->opcode == VSIR_OP_SAMPLE_INFO && ins->flags & VKD3DSI_SAMPLE_INFO_UINT)
|| (ins->opcode == VSIR_OP_RESINFO && ins->flags & VKD3DSI_RESINFO_UINT))
ins->dst[0].reg.data_type = VSIR_DATA_U32; ins->dst[0].reg.data_type = VSIR_DATA_U32;
return; return;