Emission of code into individual block instruction arrays was done to
enable construction of a control flow graph. A graph is constructed from
the flat instruction array in a later pass, so blocks are not needed.
It is possible to emit instructions directly into the array in struct
vsir_program instead of from sm6_function_emit_instructions(), but since
the patch constant function occurs first in DXIL hull shaders, this would
reverse the current order of functions in the flat array. That may be
acceptable, but it is left for a later patch in case any issues arise.
In some scenarios this resource load is NULL, and we are still doing
&load->node on it.
vkd3d/libs/vkd3d-shader/hlsl.c:2195:12: runtime error: member access
within null pointer of type 'struct hlsl_ir_resource_load'
This happens in tests/hlsl/sampler-state.shader_test, in the following
test:
[pixel shader fail]
Texture2D tex;
float4 main(): sv_target
{
return tex.Sample(sampler_state {}, float2(0, 0));
}
Instead of an int3.
Gather operations expect an offset with only two components.
Currently the following field (which is the gather channel) is
parsed as a third component, which leads to wrong and invalid
results.
This fixes a crash on a shader from WRC Generations.