Skip to content

Commit

Permalink
Revert "Merge pull request #1274 from greg-lunarg/legal2"
Browse files Browse the repository at this point in the history
This reverts commit 2c65069, reversing
changes made to fa9b465.
  • Loading branch information
johnkslang committed Mar 6, 2018
1 parent 663b90d commit b2ae1d0
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 104 deletions.
1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.aliasOpaque.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
59 changes: 0 additions & 59 deletions Test/baseLegalResults/hlsl.array.flatten.frag.out

This file was deleted.

1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.flattenOpaque.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.flattenSubset.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.flattenSubset2.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
28 changes: 0 additions & 28 deletions Test/baseLegalResults/hlsl.samplecmp.dualmode.frag.out

This file was deleted.

1 change: 1 addition & 0 deletions Test/baseResults/hlsl.aliasOpaque.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseResults/hlsl.flattenOpaque.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseResults/hlsl.flattenOpaqueInit.vert.out
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions Test/baseResults/hlsl.flattenOpaqueInitMix.vert.out
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions Test/baseResults/hlsl.flattenSubset.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseResults/hlsl.flattenSubset2.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions Test/baseResults/hlsl.partialFlattenLocal.vert.out
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions Test/baseResults/hlsl.samplecmp.dualmode.frag.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 11 additions & 15 deletions gtests/Hlsl.FromFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ INSTANTIATE_TEST_CASE_P(
ToSpirv, HlslCompileTest,
::testing::ValuesIn(std::vector<FileNameEntryPointPair>{
{"hlsl.amend.frag", "f1"},
{"hlsl.aliasOpaque.frag", "main"},
{"hlsl.array.frag", "PixelShaderFunction"},
{"hlsl.array.implicit-size.frag", "PixelShaderFunction"},
{"hlsl.array.multidim.frag", "main"},
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand All @@ -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"},
Expand Down Expand Up @@ -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<FileNameEntryPointPair>{
{"hlsl.array.flatten.frag", "main"},
{"hlsl.partialFlattenMixed.vert", "main"}
{"hlsl.partialFlattenMixed.vert", "main"},
}),
FileNameAsCustomTestSuffix
);
// clang-format on
#endif

#ifdef ENABLE_OPT
// clang-format off
Expand All @@ -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
);
Expand Down
2 changes: 0 additions & 2 deletions hlsl/hlslParseHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit b2ae1d0

Please sign in to comment.