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
47e6fa1c
Commit
47e6fa1c
authored
Oct 01, 2016
by
John Kessenich
Committed by
GitHub
Oct 01, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #532 from steve-lunarg/automap-offsets
Change binding auto-map to use provided offsets.
parents
d4f48b8a
088c59d7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
24 deletions
+21
-24
spv.buffer.autoassign.frag.out
Test/baseResults/spv.buffer.autoassign.frag.out
+2
-2
spv.glsl.register.autoassign.frag.out
Test/baseResults/spv.glsl.register.autoassign.frag.out
+7
-7
spv.register.autoassign.frag.out
Test/baseResults/spv.register.autoassign.frag.out
+7
-7
iomapper.cpp
glslang/MachineIndependent/iomapper.cpp
+3
-6
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+2
-2
No files found.
Test/baseResults/spv.buffer.autoassign.frag.out
View file @
47e6fa1c
...
...
@@ -35,11 +35,11 @@ Linked fragment stage:
MemberDecorate 25 0 Offset 0
Decorate 25 Block
Decorate 27 DescriptorSet 0
Decorate 27 Binding 1
Decorate 27 Binding 1
5
MemberDecorate 31 0 Offset 0
Decorate 31 Block
Decorate 33 DescriptorSet 0
Decorate 33 Binding
2
Decorate 33 Binding
16
Decorate 41(Color) Location 0
2: TypeVoid
3: TypeFunction 2
...
...
Test/baseResults/spv.glsl.register.autoassign.frag.out
View file @
47e6fa1c
...
...
@@ -51,21 +51,21 @@ Linked fragment stage:
Decorate 21(g_sSamp1) DescriptorSet 0
Decorate 21(g_sSamp1) Binding 5
Decorate 27(g_tTex2) DescriptorSet 0
Decorate 27(g_tTex2) Binding 1
Decorate 27(g_tTex2) Binding 1
4
Decorate 29(g_sSamp2) DescriptorSet 0
Decorate 29(g_sSamp2) Binding
2
Decorate 29(g_sSamp2) Binding
6
Decorate 39(g_tTex3) DescriptorSet 0
Decorate 39(g_tTex3) Binding 13
Decorate 46(g_sSamp3) DescriptorSet 0
Decorate 46(g_sSamp3) Binding 7
Decorate 64(g_tTex4) DescriptorSet 0
Decorate 64(g_tTex4) Binding
3
Decorate 64(g_tTex4) Binding
15
Decorate 69(g_sSamp4) DescriptorSet 0
Decorate 69(g_sSamp4) Binding
4
Decorate 69(g_sSamp4) Binding
8
Decorate 84(g_tTex5) DescriptorSet 0
Decorate 84(g_tTex5) Binding 6
Decorate 84(g_tTex5) Binding
1
6
Decorate 86(g_sSamp5) DescriptorSet 0
Decorate 86(g_sSamp5) Binding
8
Decorate 86(g_sSamp5) Binding
9
MemberDecorate 93(MyStruct_t) 0 Offset 0
MemberDecorate 93(MyStruct_t) 1 Offset 4
MemberDecorate 93(MyStruct_t) 2 Offset 16
...
...
@@ -75,7 +75,7 @@ Linked fragment stage:
MemberDecorate 95(myblock) 3 Offset 64
Decorate 95(myblock) Block
Decorate 97 DescriptorSet 0
Decorate 97 Binding
19
Decorate 97 Binding
24
Decorate 119(g_tTex_unused1) DescriptorSet 0
Decorate 119(g_tTex_unused1) Binding 10
Decorate 121(g_sSamp_unused1) DescriptorSet 0
...
...
Test/baseResults/spv.register.autoassign.frag.out
View file @
47e6fa1c
...
...
@@ -51,21 +51,21 @@ Linked fragment stage:
Decorate 21(g_sSamp1) DescriptorSet 0
Decorate 21(g_sSamp1) Binding 5
Decorate 27(g_tTex2) DescriptorSet 0
Decorate 27(g_tTex2) Binding 1
Decorate 27(g_tTex2) Binding 1
4
Decorate 29(g_sSamp2) DescriptorSet 0
Decorate 29(g_sSamp2) Binding
2
Decorate 29(g_sSamp2) Binding
6
Decorate 39(g_tTex3) DescriptorSet 0
Decorate 39(g_tTex3) Binding 13
Decorate 46(g_sSamp3) DescriptorSet 0
Decorate 46(g_sSamp3) Binding 7
Decorate 64(g_tTex4) DescriptorSet 0
Decorate 64(g_tTex4) Binding
3
Decorate 64(g_tTex4) Binding
15
Decorate 69(g_sSamp4) DescriptorSet 0
Decorate 69(g_sSamp4) Binding
4
Decorate 69(g_sSamp4) Binding
8
Decorate 84(g_tTex5) DescriptorSet 0
Decorate 84(g_tTex5) Binding 6
Decorate 84(g_tTex5) Binding
1
6
Decorate 86(g_sSamp5) DescriptorSet 0
Decorate 86(g_sSamp5) Binding
8
Decorate 86(g_sSamp5) Binding
9
MemberDecorate 93(MyStruct_t) 0 Offset 0
MemberDecorate 93(MyStruct_t) 1 Offset 4
MemberDecorate 93(MyStruct_t) 2 Offset 16
...
...
@@ -75,7 +75,7 @@ Linked fragment stage:
MemberDecorate 95($Global) 3 Offset 64
Decorate 95($Global) Block
Decorate 97 DescriptorSet 0
Decorate 97 Binding
9
Decorate 97 Binding
20
Decorate 119(g_tTex_unused1) DescriptorSet 0
Decorate 119(g_tTex_unused1) Binding 10
Decorate 121(g_sSamp_unused1) DescriptorSet 0
...
...
glslang/MachineIndependent/iomapper.cpp
View file @
47e6fa1c
...
...
@@ -151,8 +151,7 @@ class TIoMappingTraverser : public TBindingTraverser {
public
:
TIoMappingTraverser
(
TIntermediate
&
i
,
TBindingMap
&
bindingMap
,
TUsedBindings
&
usedBindings
,
bool
traverseDeadCode
)
:
TBindingTraverser
(
i
,
bindingMap
,
usedBindings
,
traverseDeadCode
),
nextBinding
(
1
)
TBindingTraverser
(
i
,
bindingMap
,
usedBindings
,
traverseDeadCode
)
{
}
protected
:
...
...
@@ -172,7 +171,7 @@ protected:
if
(
intermediate
.
getAutoMapBindings
())
{
// Otherwise, find a free spot for it.
const
int
freeBinding
=
getFreeBinding
(
base
.
getType
());
const
int
freeBinding
=
getFreeBinding
(
base
.
getType
()
,
getBindingBase
(
base
.
getType
())
);
markBinding
(
base
,
freeBinding
);
base
.
getWritableType
().
getQualifier
().
layoutBinding
=
freeBinding
;
...
...
@@ -190,14 +189,12 @@ protected:
}
// Find a free binding spot
int
getFreeBinding
(
const
TType
&
)
{
int
getFreeBinding
(
const
TType
&
,
int
nextBinding
)
{
while
(
!
hasNFreeSlots
(
nextBinding
,
1
))
++
nextBinding
;
return
nextBinding
;
}
int
nextBinding
;
};
// Map I/O variables to provided offsets, and make bindings for
...
...
gtests/Spv.FromFile.cpp
View file @
47e6fa1c
...
...
@@ -281,7 +281,7 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P
(
Hlsl
,
HlslIoMap
,
::
testing
::
ValuesIn
(
std
::
vector
<
IoMapData
>
{
{
"spv.register.autoassign.frag"
,
"main_ep"
,
5
,
10
,
15
,
true
,
false
},
{
"spv.register.autoassign.frag"
,
"main_ep"
,
5
,
10
,
20
,
true
,
false
},
{
"spv.register.noautoassign.frag"
,
"main_ep"
,
5
,
10
,
15
,
false
,
false
},
{
"spv.register.autoassign-2.frag"
,
"main"
,
5
,
10
,
15
,
true
,
true
},
{
"spv.buffer.autoassign.frag"
,
"main"
,
5
,
10
,
15
,
true
,
true
},
...
...
@@ -293,7 +293,7 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P
(
Hlsl
,
GlslIoMap
,
::
testing
::
ValuesIn
(
std
::
vector
<
IoMapData
>
{
{
"spv.glsl.register.autoassign.frag"
,
"main"
,
5
,
10
,
15
,
true
,
false
},
{
"spv.glsl.register.autoassign.frag"
,
"main"
,
5
,
10
,
20
,
true
,
false
},
{
"spv.glsl.register.noautoassign.frag"
,
"main"
,
5
,
10
,
15
,
false
,
false
},
}),
FileNameAsCustomTestSuffixIoMap
...
...
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