Makes emitting shaders from fx.c easier, and brings parsing failures
upfront.
Non-effect target profiles don't perform any type checks on
ConstructGSWithSO(), nor use shader objects in any way, but they do
check if the argument count is correct.
So we create a GeometryShader object with NULL decl and profile when
targeting non-effect profiles, so our type checks still work and
implicit conversions aren't attempted.
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));
}
The following conditional identities are applied:
c ? x : x -> x
false ? x : y -> y; true ? x : y -> x
c ? true : false -> c; c ? false : true -> !c
!c ? x : y -> c ? y : x
Lastly, for expression chains x, y in a conditional expression
c ? x : y,
we evaluate all conditionals in the expression chains with the
condition c, assuming c is true (for x), or false (for y).
Instead of storing the list inside struct hlsl_ctx. The source file
names in the list are used by the location information that the HLSL
frontend produces, and end up being referenced by the vsir program. If
we want the vsir program to be able to outlive the hlsl_ctx, its
location information can't reference data owned by the hlsl_ctx.