vkd3d-shader/hlsl: Use hlsl_error() instead of hlsl_fixme() for ambiguous function calls.

This changes the return code, and some tests start passing as a result.
This commit is contained in:
Henri Verbeet 2024-12-02 15:18:15 +01:00
parent 1c93d706d7
commit d0e4331640
Notes: Henri Verbeet 2024-12-03 14:56:39 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1290
3 changed files with 12 additions and 11 deletions

View File

@ -3026,7 +3026,7 @@ static struct hlsl_ir_function_decl *find_function_call(struct hlsl_ctx *ctx,
{ {
if (compatible_match) if (compatible_match)
{ {
hlsl_fixme(ctx, loc, "Prioritize between multiple compatible function overloads."); hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_AMBIGUOUS_CALL, "Ambiguous function call.");
break; break;
} }
compatible_match = decl; compatible_match = decl;

View File

@ -163,6 +163,7 @@ enum vkd3d_shader_error
VKD3D_SHADER_ERROR_HLSL_INVALID_OUTPUT_PRIMITIVE = 5037, VKD3D_SHADER_ERROR_HLSL_INVALID_OUTPUT_PRIMITIVE = 5037,
VKD3D_SHADER_ERROR_HLSL_INVALID_PARTITIONING = 5038, VKD3D_SHADER_ERROR_HLSL_INVALID_PARTITIONING = 5038,
VKD3D_SHADER_ERROR_HLSL_MISPLACED_SAMPLER_STATE = 5039, VKD3D_SHADER_ERROR_HLSL_MISPLACED_SAMPLER_STATE = 5039,
VKD3D_SHADER_ERROR_HLSL_AMBIGUOUS_CALL = 5040,
VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300, VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300,
VKD3D_SHADER_WARNING_HLSL_DIVISION_BY_ZERO = 5301, VKD3D_SHADER_WARNING_HLSL_DIVISION_BY_ZERO = 5301,

View File

@ -41,7 +41,7 @@ todo(sm<6) draw quad
probe (0, 0) rgba (0.1, 0.2, 0.1, 0.2) probe (0, 0) rgba (0.1, 0.2, 0.1, 0.2)
[pixel shader fail todo] [pixel shader fail]
float func(int arg) float func(int arg)
{ {
return 1.0; return 1.0;
@ -96,7 +96,7 @@ float4 main() : sv_target
% ...but invoking them is considered ambiguous and fails. % ...but invoking them is considered ambiguous and fails.
[pixel shader fail todo] [pixel shader fail]
void func(float arg) {} void func(float arg) {}
void func(float1 arg) {} void func(float1 arg) {}
@ -108,7 +108,7 @@ float4 main() : sv_target
return 1.0; return 1.0;
} }
[pixel shader fail todo] [pixel shader fail]
void func(float arg) {} void func(float arg) {}
void func(float1 arg) {} void func(float1 arg) {}
@ -123,7 +123,7 @@ float4 main() : sv_target
% This holds true even if one variant isn't actually defined. % This holds true even if one variant isn't actually defined.
[pixel shader fail todo] [pixel shader fail]
void func(float arg); void func(float arg);
void func(float1 arg) {} void func(float1 arg) {}
@ -136,7 +136,7 @@ float4 main() : sv_target
} }
% Narrows have the same priority, regardless of how much narrowing is done. % Narrows have the same priority, regardless of how much narrowing is done.
[pixel shader fail todo] [pixel shader fail]
float4 func(float3 x) float4 func(float3 x)
{ {
@ -154,7 +154,7 @@ float4 main() : sv_target
} }
% Even if one axis has less narrowing. % Even if one axis has less narrowing.
[pixel shader fail todo] [pixel shader fail]
float4 func(float4x3 x) float4 func(float4x3 x)
{ {
@ -348,7 +348,7 @@ todo(sm<6) probe (0, 0) rgba(2.0, 2.0, 2.0, 2.0)
% Some matrices are implicitly compatible with vectors and will ambiguate with them. % Some matrices are implicitly compatible with vectors and will ambiguate with them.
[pixel shader fail todo] [pixel shader fail]
float4 func(float2x2 x) float4 func(float2x2 x)
{ {
@ -365,7 +365,7 @@ float4 main() : sv_target
return func(float4(0, 0, 0, 0)); return func(float4(0, 0, 0, 0));
} }
[pixel shader fail todo] [pixel shader fail]
float4 func(float1x3 x) float4 func(float1x3 x)
{ {
@ -384,7 +384,7 @@ float4 main() : sv_target
% Structs are evaluated on a per-component basis. % Structs are evaluated on a per-component basis.
[pixel shader fail todo] [pixel shader fail]
struct a struct a
{ {
float4 a; float4 a;
@ -421,7 +421,7 @@ float4 main() : sv_target
% Arrays are evaluated on a per component basis. % Arrays are evaluated on a per component basis.
[pixel shader fail todo] [pixel shader fail]
float4 func(float4 x[1]) float4 func(float4 x[1])
{ {