mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/hlsl: Support case-insensitive lookup for builtin 'float' type.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
parent
df2d6d35e2
commit
dd36215a00
Notes:
Alexandre Julliard
2023-02-23 22:20:00 +01:00
Approved-by: Zebediah Figura (@zfigura) Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/101
@ -609,6 +609,7 @@ static const char * get_case_insensitive_typename(const char *name)
|
||||
static const char *const names[] =
|
||||
{
|
||||
"dword",
|
||||
"float",
|
||||
};
|
||||
unsigned int i;
|
||||
|
||||
@ -2838,7 +2839,7 @@ static void declare_predefined_types(struct hlsl_ctx *ctx)
|
||||
effect_types[] =
|
||||
{
|
||||
{"dword", HLSL_CLASS_SCALAR, HLSL_TYPE_UINT, 1, 1},
|
||||
{"FLOAT", HLSL_CLASS_SCALAR, HLSL_TYPE_FLOAT, 1, 1},
|
||||
{"float", HLSL_CLASS_SCALAR, HLSL_TYPE_FLOAT, 1, 1},
|
||||
{"VECTOR", HLSL_CLASS_VECTOR, HLSL_TYPE_FLOAT, 4, 1},
|
||||
{"MATRIX", HLSL_CLASS_MATRIX, HLSL_TYPE_FLOAT, 4, 4},
|
||||
{"STRING", HLSL_CLASS_OBJECT, HLSL_TYPE_STRING, 1, 1},
|
||||
|
@ -1,20 +1,25 @@
|
||||
[pixel shader]
|
||||
typedef float2 Dword;
|
||||
typedef float3 dWord;
|
||||
typedef float2 fLoat;
|
||||
|
||||
float4 f()
|
||||
{
|
||||
typedef Dword dword;
|
||||
typedef fLoat float;
|
||||
dword v1 = {1, 2};
|
||||
float v2 = {2, 3};
|
||||
DWORD v4 = 4;
|
||||
return float4(v1.x, v1.y, 3, v4);
|
||||
return float4(v1.x, v2.x, v2.y, v4);
|
||||
}
|
||||
|
||||
float4 f2()
|
||||
{
|
||||
typedef dword dword;
|
||||
dword v = 1;
|
||||
return float4(v, v, v, v);
|
||||
typedef float float;
|
||||
dword v1 = 1;
|
||||
float v2 = 1;
|
||||
return float4(v1, v2, v1, v1);
|
||||
}
|
||||
|
||||
float4 main() : SV_TARGET
|
||||
@ -42,3 +47,11 @@ float4 main() : sv_target
|
||||
{
|
||||
return float4(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
[pixel shader fail]
|
||||
typedef float2 float;
|
||||
|
||||
float4 main() : sv_target
|
||||
{
|
||||
return float4(0, 0, 0, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user