Files
vkd3d/tests/hlsl/return-semantics.shader_test
Francisco Casas 2e0cbff3a0 vkd3d-shader/hlsl: Allocate return variables before other outputs.
point-sprite.shader_test is not technically well formed since, in SM4,
the vertex output signature should be:

// Output signature:
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// sv_position              0   xyzw        0      POS   float   xyzw
// texcoord                 0   xy          1     NONE   float   xy

and the pixel input signature should be:

// Input signature:
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// texcoord                 0   xy          0     NONE   float   xy

so we are not passing "texcoord" properly to the pixel shader, even on
Windows.
2025-06-23 17:56:40 +02:00

43 lines
1.4 KiB
Plaintext

[require]
shader model >= 4.0
% The return semantic gets allocated before other output semantics.
[vertex shader]
// Output signature:
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SEMC 0 x 0 NONE float x
// SEMA 0 y 0 NONE float y
// SEMB 0 x 1 NONE float x
// SEMB 1 x 2 NONE float x
// SV_POSITION 0 xyzw 3 POS float xyzw
float main(float4 pos : POSITION, out float aa : SEMA,
out float bb[2] : SEMB, out float4 out_pos : SV_POSITION) : SEMC
{
out_pos = pos;
aa = 100;
bb[0] = 200;
bb[1] = 201;
return 300;
}
[pixel shader]
// Input signature:
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SEMC 0 x 0 NONE float x
// SEMA 0 y 0 NONE float y
// SEMB 0 x 1 NONE float x
// SEMB 1 x 2 NONE float x
float4 main(float cc : SEMC, float aa : SEMA, float bb[2] : SEMB) : sv_target
{
return float4(cc, aa, bb[0], bb[1]);
}
[test]
bug(mvk & sm>=6) draw quad
probe (0, 0) f32(300, 100, 200, 201)