diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 8acfc666..3c30c0cb 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 any_identifier %type var_identifier +%type technique_name %type 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 6e130747..90c734d5 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 230553e5..fb8a3e67 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 f0b51198..aeea1a84 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 { }