spirv: Define StorageImageWriteWithoutFormat capability when used
This commit is contained in:
parent
a33014022e
commit
23b8714732
|
@ -244,6 +244,9 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct
|
||||||
if (info.uses_typeless_image_reads && profile.support_typeless_image_loads) {
|
if (info.uses_typeless_image_reads && profile.support_typeless_image_loads) {
|
||||||
ctx.AddCapability(spv::Capability::StorageImageReadWithoutFormat);
|
ctx.AddCapability(spv::Capability::StorageImageReadWithoutFormat);
|
||||||
}
|
}
|
||||||
|
if (info.uses_typeless_image_writes) {
|
||||||
|
ctx.AddCapability(spv::Capability::StorageImageWriteWithoutFormat);
|
||||||
|
}
|
||||||
// TODO: Track this usage
|
// TODO: Track this usage
|
||||||
ctx.AddCapability(spv::Capability::ImageGatherExtended);
|
ctx.AddCapability(spv::Capability::ImageGatherExtended);
|
||||||
ctx.AddCapability(spv::Capability::ImageQuery);
|
ctx.AddCapability(spv::Capability::ImageQuery);
|
||||||
|
|
|
@ -436,6 +436,11 @@ void VisitUsages(Info& info, IR::Inst& inst) {
|
||||||
inst.GetAssociatedPseudoOperation(IR::Opcode::GetSparseFromOp) != nullptr;
|
inst.GetAssociatedPseudoOperation(IR::Opcode::GetSparseFromOp) != nullptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case IR::Opcode::ImageWrite: {
|
||||||
|
const auto flags{inst.Flags<IR::TextureInstInfo>()};
|
||||||
|
info.uses_typeless_image_writes |= flags.image_format == ImageFormat::Typeless;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case IR::Opcode::SubgroupEqMask:
|
case IR::Opcode::SubgroupEqMask:
|
||||||
case IR::Opcode::SubgroupLtMask:
|
case IR::Opcode::SubgroupLtMask:
|
||||||
case IR::Opcode::SubgroupLeMask:
|
case IR::Opcode::SubgroupLeMask:
|
||||||
|
|
|
@ -129,6 +129,7 @@ struct Info {
|
||||||
bool uses_subgroup_mask{};
|
bool uses_subgroup_mask{};
|
||||||
bool uses_fswzadd{};
|
bool uses_fswzadd{};
|
||||||
bool uses_typeless_image_reads{};
|
bool uses_typeless_image_reads{};
|
||||||
|
bool uses_typeless_image_writes{};
|
||||||
bool uses_shared_increment{};
|
bool uses_shared_increment{};
|
||||||
bool uses_shared_decrement{};
|
bool uses_shared_decrement{};
|
||||||
bool uses_global_increment{};
|
bool uses_global_increment{};
|
||||||
|
|
Loading…
Reference in New Issue