Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/spirv.c:
- type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_FLOAT, VKD3D_VEC4_SIZE);
- if (instruction->flags == VKD3DSI_RESINFO_UINT)
- {
val_id = vkd3d_spirv_build_op_bitcast(builder, type_id, val_id);
- }
- else
- if (instruction->flags != VKD3DSI_RESINFO_UINT_DST) {
if (instruction->flags)
FIXME("Unhandled flags %#x.\n", instruction->flags);
val_id = vkd3d_spirv_build_op_convert_utof(builder, type_id, val_id);
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_FLOAT, VKD3D_VEC4_SIZE);
if (instruction->flags == VKD3DSI_RESINFO_UINT)
{
val_id = vkd3d_spirv_build_op_bitcast(builder, type_id, val_id);
}
It doesn't look great to have both `_uint` and `_uint_dst` doing essentially the same thing in slightly different ways. I wonder why we do an explicit bitcast here, instead of just setting the return type to uint and let the general store helper deal with it. Maybe so we can pretend that the type is always float and simplify the TPF parser? If so, it's not obvious to me it's the good call, and having two flags that do essentially the same thing is one fallout of that.
Incidentally, if we end up keeping `_uint_dst` I'd rather name it `_uintDst`, so the underscore acts as a flag separator.