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
f7497e28
Commit
f7497e28
authored
Mar 08, 2016
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SPV: Issue #180: push_constants don't have descriptor sets.
parent
2107c76a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
6 deletions
+9
-6
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+2
-2
spv.pushConstant.vert.out
Test/baseResults/spv.pushConstant.vert.out
+0
-1
vulkan.vert.out
Test/baseResults/vulkan.vert.out
+2
-1
vulkan.vert
Test/vulkan.vert
+3
-2
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+2
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
f7497e28
...
@@ -521,9 +521,9 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy
...
@@ -521,9 +521,9 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy
// descriptor set.
// descriptor set.
bool
IsDescriptorResource
(
const
glslang
::
TType
&
type
)
bool
IsDescriptorResource
(
const
glslang
::
TType
&
type
)
{
{
// uniform and buffer blocks are included
// uniform and buffer blocks are included
, unless it is a push_constant
if
(
type
.
getBasicType
()
==
glslang
::
EbtBlock
)
if
(
type
.
getBasicType
()
==
glslang
::
EbtBlock
)
return
type
.
getQualifier
().
isUniformOrBuffer
();
return
type
.
getQualifier
().
isUniformOrBuffer
()
&&
!
type
.
getQualifier
().
layoutPushConstant
;
// non block...
// non block...
// basically samplerXXX/subpass/sampler/texture are all included
// basically samplerXXX/subpass/sampler/texture are all included
...
...
Test/baseResults/spv.pushConstant.vert.out
View file @
f7497e28
...
@@ -24,7 +24,6 @@ Linked vertex stage:
...
@@ -24,7 +24,6 @@ Linked vertex stage:
MemberDecorate 11(Material) 0 Offset 0
MemberDecorate 11(Material) 0 Offset 0
MemberDecorate 11(Material) 1 Offset 4
MemberDecorate 11(Material) 1 Offset 4
Decorate 11(Material) Block
Decorate 11(Material) Block
Decorate 13(matInst) DescriptorSet 0
2: TypeVoid
2: TypeVoid
3: TypeFunction 2
3: TypeFunction 2
6: TypeInt 32 1
6: TypeInt 32 1
...
...
Test/baseResults/vulkan.vert.out
View file @
f7497e28
...
@@ -22,7 +22,8 @@ ERROR: 0:25: 'packed' : not allowed when using GLSL for Vulkan
...
@@ -22,7 +22,8 @@ ERROR: 0:25: 'packed' : not allowed when using GLSL for Vulkan
ERROR: 0:32: 'initializer' : can't use with types containing arrays sized with a specialization constant
ERROR: 0:32: 'initializer' : can't use with types containing arrays sized with a specialization constant
ERROR: 0:34: '=' : can't use with types containing arrays sized with a specialization constant
ERROR: 0:34: '=' : can't use with types containing arrays sized with a specialization constant
ERROR: 0:35: '==' : can't use with types containing arrays sized with a specialization constant
ERROR: 0:35: '==' : can't use with types containing arrays sized with a specialization constant
ERROR: 22 compilation errors. No code generated.
ERROR: 0:39: 'set' : cannot be used with push_constant
ERROR: 23 compilation errors. No code generated.
...
...
Test/vulkan.vert
View file @
f7497e28
...
@@ -34,4 +34,6 @@ void foo()
...
@@ -34,4 +34,6 @@ void foo()
a1
=
a2
;
// ERROR, can't assign, even though the same type
a1
=
a2
;
// ERROR, can't assign, even though the same type
if
(
a1
==
a2
)
// ERROR, can't compare either
if
(
a1
==
a2
)
// ERROR, can't compare either
++
color
;
++
color
;
}
}
\ No newline at end of file
layout
(
set
=
1
,
push_constant
)
uniform
badpc
{
int
a
;
}
badpcI
;
// ERROR, no descriptor set with push_constant
glslang/MachineIndependent/ParseHelper.cpp
View file @
f7497e28
...
@@ -4483,6 +4483,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
...
@@ -4483,6 +4483,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
if
(
qualifier
.
layoutPushConstant
)
{
if
(
qualifier
.
layoutPushConstant
)
{
if
(
qualifier
.
storage
!=
EvqUniform
)
if
(
qualifier
.
storage
!=
EvqUniform
)
error
(
loc
,
"can only be used with a uniform"
,
"push_constant"
,
""
);
error
(
loc
,
"can only be used with a uniform"
,
"push_constant"
,
""
);
if
(
qualifier
.
hasSet
())
error
(
loc
,
"cannot be used with push_constant"
,
"set"
,
""
);
}
}
}
}
...
...
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