diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index a40683d6..b247c791 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -3026,7 +3026,7 @@ static struct hlsl_ir_function_decl *find_function_call(struct hlsl_ctx *ctx, { 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; } compatible_match = decl; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 09e0e66c..f451e693 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -163,6 +163,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_HLSL_INVALID_OUTPUT_PRIMITIVE = 5037, VKD3D_SHADER_ERROR_HLSL_INVALID_PARTITIONING = 5038, 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_DIVISION_BY_ZERO = 5301, diff --git a/tests/hlsl/function-overload.shader_test b/tests/hlsl/function-overload.shader_test index 5fc1d1f9..6f666f4a 100644 --- a/tests/hlsl/function-overload.shader_test +++ b/tests/hlsl/function-overload.shader_test @@ -41,7 +41,7 @@ todo(sm<6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.1, 0.2) -[pixel shader fail todo] +[pixel shader fail] float func(int arg) { return 1.0; @@ -96,7 +96,7 @@ float4 main() : sv_target % ...but invoking them is considered ambiguous and fails. -[pixel shader fail todo] +[pixel shader fail] void func(float arg) {} void func(float1 arg) {} @@ -108,7 +108,7 @@ float4 main() : sv_target return 1.0; } -[pixel shader fail todo] +[pixel shader fail] void func(float arg) {} void func(float1 arg) {} @@ -123,7 +123,7 @@ float4 main() : sv_target % This holds true even if one variant isn't actually defined. -[pixel shader fail todo] +[pixel shader fail] void func(float 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. -[pixel shader fail todo] +[pixel shader fail] float4 func(float3 x) { @@ -154,7 +154,7 @@ float4 main() : sv_target } % Even if one axis has less narrowing. -[pixel shader fail todo] +[pixel shader fail] 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. -[pixel shader fail todo] +[pixel shader fail] float4 func(float2x2 x) { @@ -365,7 +365,7 @@ float4 main() : sv_target return func(float4(0, 0, 0, 0)); } -[pixel shader fail todo] +[pixel shader fail] float4 func(float1x3 x) { @@ -384,7 +384,7 @@ float4 main() : sv_target % Structs are evaluated on a per-component basis. -[pixel shader fail todo] +[pixel shader fail] struct a { float4 a; @@ -421,7 +421,7 @@ float4 main() : sv_target % Arrays are evaluated on a per component basis. -[pixel shader fail todo] +[pixel shader fail] float4 func(float4 x[1]) {