SPV: Issue #180: push_constants don't have descriptor sets.
This commit is contained in:
parent
2107c76a08
commit
f7497e289b
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant
|
||||||
|
@ -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", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user