mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/hlsl: Ignore 'inline' modifier for functions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
30be83f911
commit
18c1477464
Notes:
Alexandre Julliard
2023-08-28 22:16:40 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/301
@ -356,6 +356,7 @@ struct hlsl_attribute
|
|||||||
#define HLSL_MODIFIER_COLUMN_MAJOR 0x00000400
|
#define HLSL_MODIFIER_COLUMN_MAJOR 0x00000400
|
||||||
#define HLSL_STORAGE_IN 0x00000800
|
#define HLSL_STORAGE_IN 0x00000800
|
||||||
#define HLSL_STORAGE_OUT 0x00001000
|
#define HLSL_STORAGE_OUT 0x00001000
|
||||||
|
#define HLSL_MODIFIER_INLINE 0x00002000
|
||||||
|
|
||||||
#define HLSL_TYPE_MODIFIERS_MASK (HLSL_MODIFIER_PRECISE | HLSL_MODIFIER_VOLATILE | \
|
#define HLSL_TYPE_MODIFIERS_MASK (HLSL_MODIFIER_PRECISE | HLSL_MODIFIER_VOLATILE | \
|
||||||
HLSL_MODIFIER_CONST | HLSL_MODIFIER_ROW_MAJOR | \
|
HLSL_MODIFIER_CONST | HLSL_MODIFIER_ROW_MAJOR | \
|
||||||
|
@ -5129,6 +5129,9 @@ func_prototype_no_attrs:
|
|||||||
struct hlsl_ir_var *var;
|
struct hlsl_ir_var *var;
|
||||||
struct hlsl_type *type;
|
struct hlsl_type *type;
|
||||||
|
|
||||||
|
/* Functions are unconditionally inlined. */
|
||||||
|
modifiers &= ~HLSL_MODIFIER_INLINE;
|
||||||
|
|
||||||
if (modifiers & ~HLSL_MODIFIERS_MAJORITY_MASK)
|
if (modifiers & ~HLSL_MODIFIERS_MAJORITY_MASK)
|
||||||
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_MODIFIER,
|
||||||
"Only majority modifiers are allowed on functions.");
|
"Only majority modifiers are allowed on functions.");
|
||||||
@ -5970,6 +5973,10 @@ var_modifiers:
|
|||||||
{
|
{
|
||||||
$$ = add_modifiers(ctx, $2, HLSL_STORAGE_IN | HLSL_STORAGE_OUT, &@1);
|
$$ = add_modifiers(ctx, $2, HLSL_STORAGE_IN | HLSL_STORAGE_OUT, &@1);
|
||||||
}
|
}
|
||||||
|
| KW_INLINE var_modifiers
|
||||||
|
{
|
||||||
|
$$ = add_modifiers(ctx, $2, HLSL_MODIFIER_INLINE, &@1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
complex_initializer:
|
complex_initializer:
|
||||||
|
@ -298,7 +298,7 @@ probe all rgba (2.0, 3.0, 6.0, 7.0)
|
|||||||
|
|
||||||
% Inline modifier
|
% Inline modifier
|
||||||
|
|
||||||
[pixel shader todo]
|
[pixel shader]
|
||||||
inline float func(float a)
|
inline float func(float a)
|
||||||
{
|
{
|
||||||
return a + 1;
|
return a + 1;
|
||||||
@ -312,12 +312,12 @@ float4 main() : sv_target
|
|||||||
}
|
}
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
todo draw quad
|
draw quad
|
||||||
todo probe all rgba (2.0, 3.0, 6.0, 7.0)
|
probe all rgba (2.0, 3.0, 6.0, 7.0)
|
||||||
|
|
||||||
% Inline modifier used on entry point
|
% Inline modifier used on entry point
|
||||||
|
|
||||||
[pixel shader todo]
|
[pixel shader]
|
||||||
float func(float a)
|
float func(float a)
|
||||||
{
|
{
|
||||||
return a + 1;
|
return a + 1;
|
||||||
@ -331,5 +331,5 @@ inline float4 main() : sv_target
|
|||||||
}
|
}
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
todo draw quad
|
draw quad
|
||||||
todo probe all rgba (2.0, 3.0, 6.0, 7.0)
|
probe all rgba (2.0, 3.0, 6.0, 7.0)
|
||||||
|
Reference in New Issue
Block a user