Files
vkd3d/tests/hlsl/constructgswithso.shader_test
Anna (navi) Figueiredo Gomes b17923b5ba vkd3d-shader/hlsl: Store parsed values in hlsl_ir_compile().
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.
2025-12-09 15:44:30 +01:00

38 lines
1.0 KiB
Plaintext

[pixel shader]
float4 main() : sv_target { return 0; }
GeometryShader gs1 = CompileShader(gs_5_0, main());
GeometryShader gs2 = ConstructGSWithSO(gs1, "random_string", "another_string", NULL, NULL, 1);
float4 ConstructGSWithSO;
technique11
{
pass
{
SetGeometryShader(gs2);
}
}
% ConstructGSWithSO for pixel shaders parses with either 2 or 6 arguments, without doing type checking.
[pixel shader fail(sm<6)]
float4 main() : sv_target { return 0; }
GeometryShader gs1 = CompileShader(gs_5_0, main());
GeometryShader gs2 = ConstructGSWithSO(gs1);
[pixel shader]
float4 main() : sv_target { return 0; }
GeometryShader gs2 = ConstructGSWithSO("foo", "bar");
[pixel shader fail(sm<6)]
float4 main() : sv_target { return 0; }
GeometryShader gs2 = ConstructGSWithSO(1, 2, 3);
[pixel shader]
float4 main() : sv_target { return 0; }
GeometryShader gs2 = ConstructGSWithSO("foo", "bar", float2(42, 42), 3, 4, NULL);
[pixel shader fail(sm<6)]
float4 main() : sv_target { return 0; }
GeometryShader gs2 = ConstructGSWithSO(1, 2, 3, 4, 5, 6, 7);