Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
2c65069e
Unverified
Commit
2c65069e
authored
Mar 06, 2018
by
John Kessenich
Committed by
GitHub
Mar 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1274 from greg-lunarg/legal2
Legalization: Omit legalization warning when spirv-opt is linked.
parents
fa9b465b
fd50f6a4
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
106 additions
and
19 deletions
+106
-19
hlsl.aliasOpaque.frag.out
Test/baseLegalResults/hlsl.aliasOpaque.frag.out
+0
-1
hlsl.array.flatten.frag.out
Test/baseLegalResults/hlsl.array.flatten.frag.out
+59
-0
hlsl.flattenOpaque.frag.out
Test/baseLegalResults/hlsl.flattenOpaque.frag.out
+0
-1
hlsl.flattenOpaqueInit.vert.out
Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
+0
-1
hlsl.flattenOpaqueInitMix.vert.out
Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
+0
-1
hlsl.flattenSubset.frag.out
Test/baseLegalResults/hlsl.flattenSubset.frag.out
+0
-1
hlsl.flattenSubset2.frag.out
Test/baseLegalResults/hlsl.flattenSubset2.frag.out
+0
-1
hlsl.partialFlattenLocal.vert.out
Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out
+0
-1
hlsl.partialFlattenMixed.vert.out
Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out
+0
-1
hlsl.samplecmp.dualmode.frag.out
Test/baseLegalResults/hlsl.samplecmp.dualmode.frag.out
+28
-0
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+17
-11
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+2
-0
No files found.
Test/baseLegalResults/hlsl.aliasOpaque.frag.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.array.flatten.frag.out
0 → 100644
View file @
2c65069e
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
Test/baseLegalResults/hlsl.flattenOpaque.frag.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.flattenOpaqueInit.vert.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.flattenOpaqueInitMix.vert.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.flattenSubset.frag.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.flattenSubset2.frag.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.partialFlattenMixed.vert.out
View file @
2c65069e
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
...
...
Test/baseLegalResults/hlsl.samplecmp.dualmode.frag.out
0 → 100644
View file @
2c65069e
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
gtests/Hlsl.FromFile.cpp
View file @
2c65069e
...
...
@@ -92,7 +92,6 @@ 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"
},
...
...
@@ -153,11 +152,6 @@ 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"
},
...
...
@@ -254,7 +248,6 @@ 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"
},
...
...
@@ -280,7 +273,6 @@ 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"
},
...
...
@@ -369,22 +361,34 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.typeGraphCopy.vert"
,
"main"
},
{
"hlsl.typedef.frag"
,
"PixelShaderFunction"
},
{
"hlsl.whileLoop.frag"
,
"PixelShaderFunction"
},
{
"hlsl.void.frag"
,
"PixelShaderFunction"
}
{
"hlsl.void.frag"
,
"PixelShaderFunction"
},
#ifndef ENABLE_OPT
{
"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"
},
#endif
}),
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
...
...
@@ -398,7 +402,9 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.flattenSubset.frag"
,
"main"
},
{
"hlsl.flattenSubset2.frag"
,
"main"
},
{
"hlsl.partialFlattenLocal.vert"
,
"main"
},
{
"hlsl.partialFlattenMixed.vert"
,
"main"
}
{
"hlsl.array.flatten.frag"
,
"main"
},
{
"hlsl.partialFlattenMixed.vert"
,
"main"
},
{
"hlsl.samplecmp.dualmode.frag"
,
"main"
}
}),
FileNameAsCustomTestSuffix
);
...
...
hlsl/hlslParseHelper.cpp
View file @
2c65069e
...
...
@@ -9885,10 +9885,12 @@ 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
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment