vkd3d-shader: Parse a 'single' modifier.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov
2024-02-25 02:51:58 +01:00
committed by Alexandre Julliard
parent cf7c05f431
commit e0ef45c0a3
Notes: Alexandre Julliard 2024-03-12 22:58:37 +01:00
Approved-by: Matteo Bruni (@Mystral)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/701
3 changed files with 63 additions and 0 deletions

View File

@@ -29,11 +29,71 @@ float4 main() : sv_target
return foo;
}
[pixel shader fail(sm>=6)]
// The 'single' modifier is not a keyword. It's meaningful only for fx_5_0.
single cbuffer cb
{
float4 single;
};
float4 main() : sv_target
{
return single;
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader fail(sm>=6)]
// 'single' modifier is usable when there is a variable with the same name
cbuffer cb
{
float4 single;
};
single cbuffer cb2
{
float4 var;
};
float4 main() : sv_target
{
return single;
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader]
typedef float4 single;
single var;
float4 main() : sv_target
{
return var;
}
[test]
uniform 0 float4 1.0 2.0 3.0 4.0
draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader fail]
typedef float4 single;
single cbuffer cb
{
float4 var;
};
float4 main() : sv_target
{
return var;
}
% SM1 buffer offset allocation follows different rules than SM4.
% Those would have to be tested separately.
[require]