For example, a HLSL shader like this:
tbuffer t0
{
float4 data;
};
float4 main() : sv_target
{
return data;
}
would be compiled to the following:
ps_4_0
dcl_resource_buffer (mixed,mixed,mixed,mixed) t0
dcl_output o0.xyzw
dcl_temps 1
ld r0.xyzw, l(0, 0, 0, 0), t0.xyzw
mov o0.xyzw, r0.xyzw
ret
VSIR_DATA_MIXED used to be mapped to VKD3D_SHADER_COMPONENT_UINT by
vkd3d_component_type_from_data_type(), but we no longer use that.
Found by Giovanni Mascellani.
This achieves two things:
- The GLSL backend no longer needs to handle this by itself. Likwise, the
MSL backend won't have to either.
- We no longer handle division by zero for DXIL UDiv and URem instructions,
which leave this undefined.
These correspond to the DXIL SDiv and SRem instructions, for which division by
zero is undefined. Division by zero is also undefined for DXIL UDiv and URem;
addressing those is slightly more involved.
Callers to shader_glsl_print_register_name() expect this. In particular, this
fixes translation of instructions such as
store_uav_typed u0.xyzw, vThreadID.xyxx, l(2.00000000e+00)
which is currently translated as the invalid
imageStore(cs_image_0, ivec4(gl_GlobalInvocationID).xy, vec4(uintBitsToFloat(0x40000000u), 0, 0, 0));