diff --git a/Test/baseLegalResults/hlsl.aliasOpaque.frag.out b/Test/baseLegalResults/hlsl.aliasOpaque.frag.out index 7ce3058dce..621fae5186 100644 --- a/Test/baseLegalResults/hlsl.aliasOpaque.frag.out +++ b/Test/baseLegalResults/hlsl.aliasOpaque.frag.out @@ -1,4 +1,5 @@ hlsl.aliasOpaque.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 87 diff --git a/Test/baseLegalResults/hlsl.array.flatten.frag.out b/Test/baseLegalResults/hlsl.array.flatten.frag.out deleted file mode 100644 index 62e05963d2..0000000000 --- a/Test/baseLegalResults/hlsl.array.flatten.frag.out +++ /dev/null @@ -1,59 +0,0 @@ -hlsl.array.flatten.frag -// Module Version 10000 -// Generated by (magic number): 80005 -// Id's are bound by 180 - - Capability Shader - Capability Sampled1D - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 110 - ExecutionMode 4 OriginUpperLeft - Source HLSL 500 - Name 4 "main" - Name 42 "g_tex" - Name 47 "g_samp" - Name 110 "ps_output.color" - Decorate 42(g_tex) DescriptorSet 0 - Decorate 47(g_samp) DescriptorSet 0 - Decorate 110(ps_output.color) Location 0 - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 11: TypeImage 6(float) 1D sampled format:Unknown - 12: TypeInt 32 0 - 13: 12(int) Constant 3 - 14: TypeArray 11 13 - 16: TypeSampler - 17: TypeArray 16 13 - 30: TypeInt 32 1 - 35: 30(int) Constant 1 - 41: TypePointer UniformConstant 14 - 42(g_tex): 41(ptr) Variable UniformConstant - 43: TypePointer UniformConstant 11 - 46: TypePointer UniformConstant 17 - 47(g_samp): 46(ptr) Variable UniformConstant - 48: TypePointer UniformConstant 16 - 51: TypeSampledImage 11 - 53: 6(float) Constant 1045220557 - 109: TypePointer Output 7(fvec4) -110(ps_output.color): 109(ptr) Variable Output - 4(main): 2 Function None 3 - 5: Label - 139: 43(ptr) AccessChain 42(g_tex) 35 - 140: 11 Load 139 - 141: 48(ptr) AccessChain 47(g_samp) 35 - 142: 16 Load 141 - 143: 51 SampledImage 140 142 - 144: 7(fvec4) ImageSampleImplicitLod 143 53 - 133: 14 Load 42(g_tex) - 173: 11 CompositeExtract 133 2 - 134: 17 Load 47(g_samp) - 179: 16 CompositeExtract 134 2 - 150: 51 SampledImage 173 179 - 151: 7(fvec4) ImageSampleImplicitLod 150 53 - 136: 7(fvec4) FAdd 144 151 - Store 110(ps_output.color) 136 - Return - FunctionEnd diff --git a/Test/baseLegalResults/hlsl.flattenOpaque.frag.out b/Test/baseLegalResults/hlsl.flattenOpaque.frag.out index 16f060dc0c..1e90a0869a 100644 --- a/Test/baseLegalResults/hlsl.flattenOpaque.frag.out +++ b/Test/baseLegalResults/hlsl.flattenOpaque.frag.out @@ -1,4 +1,5 @@ hlsl.flattenOpaque.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 185 diff --git a/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out b/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out index c181243f21..d5800557e1 100644 --- a/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out +++ b/Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out @@ -1,4 +1,5 @@ hlsl.flattenOpaqueInit.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 134 diff --git a/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out b/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out index aca925fff6..054d4bda8f 100644 --- a/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out +++ b/Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out @@ -1,4 +1,5 @@ hlsl.flattenOpaqueInitMix.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 80 diff --git a/Test/baseLegalResults/hlsl.flattenSubset.frag.out b/Test/baseLegalResults/hlsl.flattenSubset.frag.out index 01d6699f23..bbffe8ae07 100755 --- a/Test/baseLegalResults/hlsl.flattenSubset.frag.out +++ b/Test/baseLegalResults/hlsl.flattenSubset.frag.out @@ -1,4 +1,5 @@ hlsl.flattenSubset.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 66 diff --git a/Test/baseLegalResults/hlsl.flattenSubset2.frag.out b/Test/baseLegalResults/hlsl.flattenSubset2.frag.out index bb1ec4b449..ea93e7a1e9 100755 --- a/Test/baseLegalResults/hlsl.flattenSubset2.frag.out +++ b/Test/baseLegalResults/hlsl.flattenSubset2.frag.out @@ -1,4 +1,5 @@ hlsl.flattenSubset2.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 53 diff --git a/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out b/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out index 104a729062..0ec29fb05f 100755 --- a/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out +++ b/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out @@ -1,4 +1,5 @@ hlsl.partialFlattenLocal.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 169 diff --git a/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out b/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out index 1bee2bd4f5..8497977c27 100755 --- a/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out +++ b/Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out @@ -1,4 +1,5 @@ hlsl.partialFlattenMixed.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80005 // Id's are bound by 36 diff --git a/Test/baseLegalResults/hlsl.samplecmp.dualmode.frag.out b/Test/baseLegalResults/hlsl.samplecmp.dualmode.frag.out deleted file mode 100644 index 8577f73a08..0000000000 --- a/Test/baseLegalResults/hlsl.samplecmp.dualmode.frag.out +++ /dev/null @@ -1,28 +0,0 @@ -hlsl.samplecmp.dualmode.frag -// Module Version 10000 -// Generated by (magic number): 80005 -// Id's are bound by 42 - - Capability Shader - Capability Sampled1D - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 41 - ExecutionMode 4 OriginUpperLeft - Source HLSL 500 - Name 4 "main" - Name 41 "@entryPointOutput" - Decorate 41(@entryPointOutput) Location 0 - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 36: 6(float) Constant 0 - 37: 7(fvec4) ConstantComposite 36 36 36 36 - 40: TypePointer Output 7(fvec4) -41(@entryPointOutput): 40(ptr) Variable Output - 4(main): 2 Function None 3 - 5: Label - Store 41(@entryPointOutput) 37 - Return - FunctionEnd diff --git a/Test/baseResults/hlsl.aliasOpaque.frag.out b/Test/baseResults/hlsl.aliasOpaque.frag.out index 0e1841c5a6..f729efac9d 100755 --- a/Test/baseResults/hlsl.aliasOpaque.frag.out +++ b/Test/baseResults/hlsl.aliasOpaque.frag.out @@ -1,4 +1,5 @@ hlsl.aliasOpaque.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence diff --git a/Test/baseResults/hlsl.flattenOpaque.frag.out b/Test/baseResults/hlsl.flattenOpaque.frag.out index d6abea3239..699acc068a 100755 --- a/Test/baseResults/hlsl.flattenOpaque.frag.out +++ b/Test/baseResults/hlsl.flattenOpaque.frag.out @@ -1,4 +1,5 @@ hlsl.flattenOpaque.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence diff --git a/Test/baseResults/hlsl.flattenOpaqueInit.vert.out b/Test/baseResults/hlsl.flattenOpaqueInit.vert.out index 916d638887..df5a1c62f5 100755 --- a/Test/baseResults/hlsl.flattenOpaqueInit.vert.out +++ b/Test/baseResults/hlsl.flattenOpaqueInit.vert.out @@ -1,4 +1,5 @@ hlsl.flattenOpaqueInit.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 0:? Sequence 0:5 Function Definition: lookUp(struct-FxaaTex-p1-t211; ( temp 4-component vector of float) diff --git a/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out b/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out index b0cc8de4cf..c973b7568d 100755 --- a/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out +++ b/Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out @@ -1,4 +1,5 @@ hlsl.flattenOpaqueInitMix.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 0:? Sequence 0:5 Function Definition: lookUp(struct-FxaaTex-p1-t21-f11; ( temp 4-component vector of float) diff --git a/Test/baseResults/hlsl.flattenSubset.frag.out b/Test/baseResults/hlsl.flattenSubset.frag.out index 4e104d8fb0..2a7d21c454 100755 --- a/Test/baseResults/hlsl.flattenSubset.frag.out +++ b/Test/baseResults/hlsl.flattenSubset.frag.out @@ -1,4 +1,5 @@ hlsl.flattenSubset.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence diff --git a/Test/baseResults/hlsl.flattenSubset2.frag.out b/Test/baseResults/hlsl.flattenSubset2.frag.out index fb5001561d..4454e433aa 100755 --- a/Test/baseResults/hlsl.flattenSubset2.frag.out +++ b/Test/baseResults/hlsl.flattenSubset2.frag.out @@ -1,4 +1,5 @@ hlsl.flattenSubset2.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence diff --git a/Test/baseResults/hlsl.partialFlattenLocal.vert.out b/Test/baseResults/hlsl.partialFlattenLocal.vert.out index 5f44aa99d7..a8303e04fa 100755 --- a/Test/baseResults/hlsl.partialFlattenLocal.vert.out +++ b/Test/baseResults/hlsl.partialFlattenLocal.vert.out @@ -1,4 +1,5 @@ hlsl.partialFlattenLocal.vert +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 0:? Sequence 0:12 Function Definition: @main(vf4; ( temp 4-component vector of float) diff --git a/Test/baseResults/hlsl.samplecmp.dualmode.frag.out b/Test/baseResults/hlsl.samplecmp.dualmode.frag.out index beecd01c29..191e918f9e 100644 --- a/Test/baseResults/hlsl.samplecmp.dualmode.frag.out +++ b/Test/baseResults/hlsl.samplecmp.dualmode.frag.out @@ -1,4 +1,5 @@ hlsl.samplecmp.dualmode.frag +WARNING: AST will form illegal SPIR-V; need to transform to legalize Shader version: 500 gl_FragCoord origin is upper left 0:? Sequence diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp index 2bf2e53f2c..2c92bdb7fb 100644 --- a/gtests/Hlsl.FromFile.cpp +++ b/gtests/Hlsl.FromFile.cpp @@ -92,6 +92,7 @@ INSTANTIATE_TEST_CASE_P( ToSpirv, HlslCompileTest, ::testing::ValuesIn(std::vector{ {"hlsl.amend.frag", "f1"}, + {"hlsl.aliasOpaque.frag", "main"}, {"hlsl.array.frag", "PixelShaderFunction"}, {"hlsl.array.implicit-size.frag", "PixelShaderFunction"}, {"hlsl.array.multidim.frag", "main"}, @@ -152,6 +153,11 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.float1.frag", "PixelShaderFunction"}, {"hlsl.float4.frag", "PixelShaderFunction"}, {"hlsl.flatten.return.frag", "main"}, + {"hlsl.flattenOpaque.frag", "main"}, + {"hlsl.flattenOpaqueInit.vert", "main"}, + {"hlsl.flattenOpaqueInitMix.vert", "main"}, + {"hlsl.flattenSubset.frag", "main"}, + {"hlsl.flattenSubset2.frag", "main"}, {"hlsl.forLoop.frag", "PixelShaderFunction"}, {"hlsl.gather.array.dx10.frag", "main"}, {"hlsl.gather.basic.dx10.frag", "main"}, @@ -248,6 +254,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.params.default.frag", "main"}, {"hlsl.params.default.negative.frag", "main"}, {"hlsl.partialInit.frag", "PixelShaderFunction"}, + {"hlsl.partialFlattenLocal.vert", "main"}, {"hlsl.PointSize.geom", "main"}, {"hlsl.PointSize.vert", "main"}, {"hlsl.pp.vert", "main"}, @@ -273,6 +280,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.samplebias.offsetarray.dx10.frag", "main"}, {"hlsl.samplecmp.array.dx10.frag", "main"}, {"hlsl.samplecmp.basic.dx10.frag", "main"}, + {"hlsl.samplecmp.dualmode.frag", "main"}, {"hlsl.samplecmp.offset.dx10.frag", "main"}, {"hlsl.samplecmp.offsetarray.dx10.frag", "main"}, {"hlsl.samplecmp.negative.frag", "main"}, @@ -361,32 +369,22 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.typeGraphCopy.vert", "main"}, {"hlsl.typedef.frag", "PixelShaderFunction"}, {"hlsl.whileLoop.frag", "PixelShaderFunction"}, - {"hlsl.void.frag", "PixelShaderFunction"}, - {"hlsl.aliasOpaque.frag", "main"}, - {"hlsl.flattenOpaque.frag", "main"}, - {"hlsl.flattenOpaqueInit.vert", "main"}, - {"hlsl.flattenOpaqueInitMix.vert", "main"}, - {"hlsl.flattenSubset.frag", "main"}, - {"hlsl.flattenSubset2.frag", "main"}, - {"hlsl.partialFlattenLocal.vert", "main"}, - {"hlsl.samplecmp.dualmode.frag", "main"}, + {"hlsl.void.frag", "PixelShaderFunction"} }), FileNameAsCustomTestSuffix ); // clang-format on -#ifndef ENABLE_OPT // clang-format off INSTANTIATE_TEST_CASE_P( ToSpirv, HlslCompileAndFlattenTest, ::testing::ValuesIn(std::vector{ {"hlsl.array.flatten.frag", "main"}, - {"hlsl.partialFlattenMixed.vert", "main"} + {"hlsl.partialFlattenMixed.vert", "main"}, }), FileNameAsCustomTestSuffix ); // clang-format on -#endif #ifdef ENABLE_OPT // clang-format off @@ -400,9 +398,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.flattenSubset.frag", "main"}, {"hlsl.flattenSubset2.frag", "main"}, {"hlsl.partialFlattenLocal.vert", "main"}, - {"hlsl.array.flatten.frag", "main"}, - {"hlsl.partialFlattenMixed.vert", "main"}, - {"hlsl.samplecmp.dualmode.frag", "main"} + {"hlsl.partialFlattenMixed.vert", "main"} }), FileNameAsCustomTestSuffix ); diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 969619cfa7..2395dafe94 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -9885,12 +9885,10 @@ void HlslParseContext::finish() addPatchConstantInvocation(); fixTextureShadowModes(); -#ifndef ENABLE_OPT // Communicate out (esp. for command line) that we formed AST that will make // illegal AST SPIR-V and it needs transforms to legalize it. if (intermediate.needsLegalization()) infoSink.info << "WARNING: AST will form illegal SPIR-V; need to transform to legalize"; -#endif TParseContextBase::finish(); }