mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-09 12:00:05 +00:00
SPV: Fix #1374: For an SSBO 16-bit access, only emit StorageUniformBufferBlock16 capability.
This commit is contained in:
parent
2fb966aad2
commit
1831087e48
@ -2479,17 +2479,29 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
|
||||
node->getType().containsBasicType(glslang::EbtInt16) ||
|
||||
node->getType().containsBasicType(glslang::EbtUint16);
|
||||
if (contains16BitType) {
|
||||
if (storageClass == spv::StorageClassInput || storageClass == spv::StorageClassOutput) {
|
||||
switch (storageClass) {
|
||||
case spv::StorageClassInput:
|
||||
case spv::StorageClassOutput:
|
||||
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
|
||||
builder.addCapability(spv::CapabilityStorageInputOutput16);
|
||||
} else if (storageClass == spv::StorageClassPushConstant) {
|
||||
break;
|
||||
case spv::StorageClassPushConstant:
|
||||
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
|
||||
builder.addCapability(spv::CapabilityStoragePushConstant16);
|
||||
} else if (storageClass == spv::StorageClassUniform) {
|
||||
break;
|
||||
case spv::StorageClassUniform:
|
||||
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
|
||||
builder.addCapability(spv::CapabilityStorageUniform16);
|
||||
if (node->getType().getQualifier().storage == glslang::EvqBuffer)
|
||||
builder.addCapability(spv::CapabilityStorageUniformBufferBlock16);
|
||||
else
|
||||
builder.addCapability(spv::CapabilityStorageUniform16);
|
||||
break;
|
||||
case spv::StorageClassStorageBuffer:
|
||||
addPre13Extension(spv::E_SPV_KHR_16bit_storage);
|
||||
builder.addCapability(spv::CapabilityStorageUniformBufferBlock16);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ spv.shaderBallotAMD.comp
|
||||
Capability Groups
|
||||
Capability Int16
|
||||
Capability StorageUniformBufferBlock16
|
||||
Capability StorageUniform16
|
||||
Extension "SPV_AMD_gpu_shader_half_float"
|
||||
Extension "SPV_AMD_gpu_shader_int16"
|
||||
Extension "SPV_AMD_shader_ballot"
|
||||
|
Loading…
Reference in New Issue
Block a user