mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
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
@@ -9922,11 +9922,11 @@ static void spirv_compiler_emit_bufinfo(struct spirv_compiler *compiler,
|
||||
static void spirv_compiler_emit_resinfo(struct spirv_compiler *compiler,
|
||||
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;
|
||||
const struct vkd3d_shader_dst_param *dst = instruction->dst;
|
||||
const struct vkd3d_shader_src_param *src = instruction->src;
|
||||
uint32_t type_id, lod_id, val_id, miplevel_count_id;
|
||||
enum vkd3d_shader_component_type component_type;
|
||||
uint32_t constituents[VKD3D_VEC4_SIZE];
|
||||
unsigned int i, size_component_count;
|
||||
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,
|
||||
type_id, constituents, i + 2);
|
||||
|
||||
if (!(instruction->flags & VKD3DSI_RESINFO_UINT))
|
||||
{
|
||||
component_type = VKD3D_SHADER_COMPONENT_FLOAT;
|
||||
|
||||
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
|
||||
{
|
||||
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 = spirv_compiler_emit_swizzle(compiler, val_id, VKD3DSP_WRITEMASK_ALL,
|
||||
|
@@ -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;
|
||||
|
||||
return;
|
||||
|
Reference in New Issue
Block a user