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
471bfed0
Commit
471bfed0
authored
Dec 06, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #606: make layout() override register.
parent
cc951f81
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
2 deletions
+120
-2
hlsl.layoutOverride.vert.out
Test/baseResults/hlsl.layoutOverride.vert.out
+104
-0
hlsl.layoutOverride.vert
Test/hlsl.layoutOverride.vert
+8
-0
Hlsl.FromFile.cpp
gtests/Hlsl.FromFile.cpp
+1
-0
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+7
-2
No files found.
Test/baseResults/hlsl.layoutOverride.vert.out
0 → 100755
View file @
471bfed0
hlsl.layoutOverride.vert
Shader version: 500
0:? Sequence
0:5 Function Definition: @main( ( temp 4-component vector of float)
0:5 Function Parameters:
0:? Sequence
0:6 Branch: Return with expression
0:6 texture ( temp 4-component vector of float)
0:6 Construct combined texture-sampler ( temp sampler2D)
0:6 'tex' (layout( set=2 binding=0) uniform texture2D)
0:6 'samp' ( uniform sampler)
0:? Constant:
0:? 0.200000
0:? 0.300000
0:5 Function Definition: main( ( temp void)
0:5 Function Parameters:
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' ( out 4-component vector of float Position)
0:5 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? 'tex' (layout( set=2 binding=0) uniform texture2D)
0:? 'samp' ( uniform sampler)
0:? '@entryPointOutput' ( out 4-component vector of float Position)
Linked vertex stage:
Shader version: 500
0:? Sequence
0:5 Function Definition: @main( ( temp 4-component vector of float)
0:5 Function Parameters:
0:? Sequence
0:6 Branch: Return with expression
0:6 texture ( temp 4-component vector of float)
0:6 Construct combined texture-sampler ( temp sampler2D)
0:6 'tex' (layout( set=2 binding=0) uniform texture2D)
0:6 'samp' ( uniform sampler)
0:? Constant:
0:? 0.200000
0:? 0.300000
0:5 Function Definition: main( ( temp void)
0:5 Function Parameters:
0:? Sequence
0:5 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' ( out 4-component vector of float Position)
0:5 Function Call: @main( ( temp 4-component vector of float)
0:? Linker Objects
0:? 'tex' (layout( set=2 binding=0) uniform texture2D)
0:? 'samp' ( uniform sampler)
0:? '@entryPointOutput' ( out 4-component vector of float Position)
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 32
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 30
Source HLSL 500
Name 4 "main"
Name 9 "@main("
Name 13 "tex"
Name 17 "samp"
Name 30 "@entryPointOutput"
Decorate 13(tex) DescriptorSet 2
Decorate 13(tex) Binding 0
Decorate 17(samp) DescriptorSet 0
Decorate 30(@entryPointOutput) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeFunction 7(fvec4)
11: TypeImage 6(float) 2D sampled format:Unknown
12: TypePointer UniformConstant 11
13(tex): 12(ptr) Variable UniformConstant
15: TypeSampler
16: TypePointer UniformConstant 15
17(samp): 16(ptr) Variable UniformConstant
19: TypeSampledImage 11
21: TypeVector 6(float) 2
22: 6(float) Constant 1045220557
23: 6(float) Constant 1050253722
24: 21(fvec2) ConstantComposite 22 23
25: 6(float) Constant 0
29: TypePointer Output 7(fvec4)
30(@entryPointOutput): 29(ptr) Variable Output
4(main): 2 Function None 3
5: Label
31: 7(fvec4) FunctionCall 9(@main()
Store 30(@entryPointOutput) 31
Return
FunctionEnd
9(@main(): 7(fvec4) Function None 8
10: Label
14: 11 Load 13(tex)
18: 15 Load 17(samp)
20: 19 SampledImage 14 18
26: 7(fvec4) ImageSampleExplicitLod 20 24 Lod 25
ReturnValue 26
FunctionEnd
Test/hlsl.layoutOverride.vert
0 → 100644
View file @
471bfed0
layout
(
set
=
2
,
binding
=
0
)
Texture2D
tex
:
register
(
t16
);
SamplerState
samp
;
float4
main
()
:
SV_Position
{
return
tex
.
Sample
(
samp
,
float2
(
0
.
2
,
0
.
3
));
}
\ No newline at end of file
gtests/Hlsl.FromFile.cpp
View file @
471bfed0
...
...
@@ -211,6 +211,7 @@ INSTANTIATE_TEST_CASE_P(
{
"hlsl.intrinsics.promote.down.frag"
,
"main"
},
{
"hlsl.intrinsics.promote.outputs.frag"
,
"main"
},
{
"hlsl.layout.frag"
,
"main"
},
{
"hlsl.layoutOverride.vert"
,
"main"
},
{
"hlsl.load.2dms.dx10.frag"
,
"main"
},
{
"hlsl.load.array.dx10.frag"
,
"main"
},
{
"hlsl.load.basic.dx10.frag"
,
"main"
},
...
...
hlsl/hlslParseHelper.cpp
View file @
471bfed0
...
...
@@ -5856,7 +5856,10 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi
case
'c'
:
case
's'
:
case
'u'
:
qualifier
.
layoutBinding
=
regNumber
+
subComponent
;
// if nothing else has set the binding, do so now
// (other mechanisms override this one)
if
(
!
qualifier
.
hasBinding
())
qualifier
.
layoutBinding
=
regNumber
+
subComponent
;
// This handles per-register layout sets numbers. For the global mode which sets
// every symbol to the same value, see setLinkageLayoutSets().
...
...
@@ -5890,7 +5893,9 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi
return
true
;
};
if
(
spaceDesc
)
{
// if nothing else has set the set, do so now
// (other mechanisms override this one)
if
(
spaceDesc
&&
!
qualifier
.
hasSet
())
{
if
(
!
crackSpace
())
{
error
(
loc
,
"expected spaceN"
,
"register"
,
""
);
return
;
...
...
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