Merge branch 'jeffbolznv-missing_descriptor_indexing_extension'

This commit is contained in:
John Kessenich 2018-07-18 18:11:16 -06:00
commit 34e56891b0

View File

@ -911,6 +911,7 @@ void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TTyp
{ {
if (indexType.getQualifier().isNonUniform()) { if (indexType.getQualifier().isNonUniform()) {
// deal with an asserted non-uniform index // deal with an asserted non-uniform index
// SPV_EXT_descriptor_indexing already added in TranslateNonUniformDecoration
if (baseType.getBasicType() == glslang::EbtSampler) { if (baseType.getBasicType() == glslang::EbtSampler) {
if (baseType.getQualifier().hasAttachment()) if (baseType.getQualifier().hasAttachment())
builder.addCapability(spv::CapabilityInputAttachmentArrayNonUniformIndexingEXT); builder.addCapability(spv::CapabilityInputAttachmentArrayNonUniformIndexingEXT);
@ -931,15 +932,19 @@ void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TTyp
} else { } else {
// assume a dynamically uniform index // assume a dynamically uniform index
if (baseType.getBasicType() == glslang::EbtSampler) { if (baseType.getBasicType() == glslang::EbtSampler) {
if (baseType.getQualifier().hasAttachment()) if (baseType.getQualifier().hasAttachment()) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addCapability(spv::CapabilityInputAttachmentArrayDynamicIndexingEXT); builder.addCapability(spv::CapabilityInputAttachmentArrayDynamicIndexingEXT);
else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) } else if (baseType.isImage() && baseType.getSampler().dim == glslang::EsdBuffer) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addCapability(spv::CapabilityStorageTexelBufferArrayDynamicIndexingEXT); builder.addCapability(spv::CapabilityStorageTexelBufferArrayDynamicIndexingEXT);
else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) } else if (baseType.isTexture() && baseType.getSampler().dim == glslang::EsdBuffer) {
builder.addExtension("SPV_EXT_descriptor_indexing");
builder.addCapability(spv::CapabilityUniformTexelBufferArrayDynamicIndexingEXT); builder.addCapability(spv::CapabilityUniformTexelBufferArrayDynamicIndexingEXT);
} }
} }
} }
}
// Return whether or not the given type is something that should be tied to a // Return whether or not the given type is something that should be tied to a
// descriptor set. // descriptor set.