From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- libs/vkd3d-shader/hlsl.y | 43 +++++++++++++++++++++++++++ tests/hlsl/technique-fx_2.shader_test | 6 ++-- tests/hlsl/technique-fx_4.shader_test | 4 +-- tests/hlsl/technique-fx_5.shader_test | 4 +-- 4 files changed, 50 insertions(+), 7 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 8acfc6667..3c30c0cb7 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -4955,6 +4955,7 @@ static void check_duplicated_switch_cases(struct hlsl_ctx *ctx, const struct hls
%type <name> any_identifier %type <name> var_identifier +%type <name> technique_name
%type <parameter> parameter
@@ -4996,8 +4997,50 @@ hlsl_prog: destroy_block($2); } | hlsl_prog preproc_directive + | hlsl_prog technique | hlsl_prog ';'
+technique_name: + %empty + { + $$ = NULL; + } + | any_identifier + +pass_list: + %empty + +technique9: + KW_TECHNIQUE technique_name '{' pass_list '}' + { + hlsl_fixme(ctx, &@$, "Unsupported 'technique' declaration."); + } + +technique10: + KW_TECHNIQUE10 technique_name '{' pass_list '}' + { + if (ctx->profile->type == VKD3D_SHADER_TYPE_EFFECT && ctx->profile->major_version == 2) + hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, + "The 'technique10' keyword is invalid for this profile."); + + hlsl_fixme(ctx, &@$, "Unsupported 'technique10' declaration."); + } + +technique11: + KW_TECHNIQUE11 technique_name '{' pass_list '}' + { + if (ctx->profile->type == VKD3D_SHADER_TYPE_EFFECT && ctx->profile->major_version == 2) + hlsl_error(ctx, &@1, VKD3D_SHADER_ERROR_HLSL_INVALID_SYNTAX, + "The 'technique11' keyword is invalid for this profile."); + + hlsl_fixme(ctx, &@$, "Unsupported 'technique11' declaration."); + } + +technique: + technique9 + | technique10 + | technique11 + buffer_declaration: buffer_type any_identifier colon_attribute { diff --git a/tests/hlsl/technique-fx_2.shader_test b/tests/hlsl/technique-fx_2.shader_test index 6e130747d..90c734d53 100644 --- a/tests/hlsl/technique-fx_2.shader_test +++ b/tests/hlsl/technique-fx_2.shader_test @@ -76,7 +76,7 @@ technique10 float4 f;
% fx_5_0 keyword fails with fx_2_0 profile -[effect fail] +[effect fail todo] technique { } @@ -85,7 +85,7 @@ technique11 { }
-[effect fail] +[effect fail todo] technique { } @@ -94,7 +94,7 @@ tEchnique10 { }
-[effect fail] +[effect fail todo] technique { } diff --git a/tests/hlsl/technique-fx_4.shader_test b/tests/hlsl/technique-fx_4.shader_test index 230553e58..fb8a3e675 100644 --- a/tests/hlsl/technique-fx_4.shader_test +++ b/tests/hlsl/technique-fx_4.shader_test @@ -46,7 +46,7 @@ technique11 { }
-[effect fail] +[effect fail todo] technique { } @@ -55,7 +55,7 @@ tEchnique10 { }
-[effect fail] +[effect fail todo] technique { } diff --git a/tests/hlsl/technique-fx_5.shader_test b/tests/hlsl/technique-fx_5.shader_test index f0b511986..aeea1a84f 100644 --- a/tests/hlsl/technique-fx_5.shader_test +++ b/tests/hlsl/technique-fx_5.shader_test @@ -46,7 +46,7 @@ technique11 { }
-[effect fail] +[effect fail todo] technique { } @@ -55,7 +55,7 @@ tEchnique10 { }
-[effect fail] +[effect fail todo] technique { }