Fix #1924: Promote SPV_EXT_physical_storage_buffer to KHR when required.
If the semantics that require the KHR form over the EXT form are seen (OpBitcast between a vector and a pointer) promote the requested extension from the EXT to the KHR.
This commit is contained in:
parent
1ff0c181bb
commit
ee8e9c1522
@ -6275,6 +6275,9 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, OpDecora
|
|||||||
break;
|
break;
|
||||||
case glslang::EOpConvPtrToUvec2:
|
case glslang::EOpConvPtrToUvec2:
|
||||||
case glslang::EOpConvUvec2ToPtr:
|
case glslang::EOpConvUvec2ToPtr:
|
||||||
|
if (builder.isVector(operand))
|
||||||
|
builder.promoteIncorporatedExtension(spv::E_SPV_EXT_physical_storage_buffer,
|
||||||
|
spv::E_SPV_KHR_physical_storage_buffer, spv::Spv_1_5);
|
||||||
convOp = spv::OpBitcast;
|
convOp = spv::OpBitcast;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -106,11 +106,20 @@ public:
|
|||||||
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
|
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
|
||||||
void setEmitOpLines() { emitOpLines = true; }
|
void setEmitOpLines() { emitOpLines = true; }
|
||||||
void addExtension(const char* ext) { extensions.insert(ext); }
|
void addExtension(const char* ext) { extensions.insert(ext); }
|
||||||
|
void removeExtension(const char* ext)
|
||||||
|
{
|
||||||
|
extensions.erase(ext);
|
||||||
|
}
|
||||||
void addIncorporatedExtension(const char* ext, SpvVersion incorporatedVersion)
|
void addIncorporatedExtension(const char* ext, SpvVersion incorporatedVersion)
|
||||||
{
|
{
|
||||||
if (getSpvVersion() < static_cast<unsigned>(incorporatedVersion))
|
if (getSpvVersion() < static_cast<unsigned>(incorporatedVersion))
|
||||||
addExtension(ext);
|
addExtension(ext);
|
||||||
}
|
}
|
||||||
|
void promoteIncorporatedExtension(const char* baseExt, const char* promoExt, SpvVersion incorporatedVersion)
|
||||||
|
{
|
||||||
|
removeExtension(baseExt);
|
||||||
|
addIncorporatedExtension(promoExt, incorporatedVersion);
|
||||||
|
}
|
||||||
void addInclude(const std::string& name, const std::string& text)
|
void addInclude(const std::string& name, const std::string& text)
|
||||||
{
|
{
|
||||||
spv::Id incId = getStringId(name);
|
spv::Id incId = getStringId(name);
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
spv.bufferhandleUvec2.frag
|
spv.bufferhandleUvec2.frag
|
||||||
Validation failed
|
|
||||||
// Module Version 10000
|
// Module Version 10000
|
||||||
// Generated by (magic number): 80007
|
// Generated by (magic number): 80007
|
||||||
// Id's are bound by 71
|
// Id's are bound by 71
|
||||||
|
|
||||||
Capability Shader
|
Capability Shader
|
||||||
Capability PhysicalStorageBufferAddressesEXT
|
Capability PhysicalStorageBufferAddressesEXT
|
||||||
Extension "SPV_EXT_physical_storage_buffer"
|
Extension "SPV_KHR_physical_storage_buffer"
|
||||||
Extension "SPV_KHR_storage_buffer_storage_class"
|
Extension "SPV_KHR_storage_buffer_storage_class"
|
||||||
1: ExtInstImport "GLSL.std.450"
|
1: ExtInstImport "GLSL.std.450"
|
||||||
MemoryModel PhysicalStorageBuffer64EXT GLSL450
|
MemoryModel PhysicalStorageBuffer64EXT GLSL450
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user