diff options
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 63ed92a5d..db7b3f1b2 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -238,11 +238,13 @@ void SetupCapabilities(const Profile& profile, const Info& info, EmitContext& ct | |||
| 238 | ctx.AddCapability(spv::Capability::SubgroupVoteKHR); | 238 | ctx.AddCapability(spv::Capability::SubgroupVoteKHR); |
| 239 | } | 239 | } |
| 240 | } | 240 | } |
| 241 | if (info.uses_typeless_image_reads && profile.support_typeless_image_loads) { | ||
| 242 | ctx.AddCapability(spv::Capability::StorageImageReadWithoutFormat); | ||
| 243 | } | ||
| 241 | // TODO: Track this usage | 244 | // TODO: Track this usage |
| 242 | ctx.AddCapability(spv::Capability::ImageGatherExtended); | 245 | ctx.AddCapability(spv::Capability::ImageGatherExtended); |
| 243 | ctx.AddCapability(spv::Capability::ImageQuery); | 246 | ctx.AddCapability(spv::Capability::ImageQuery); |
| 244 | ctx.AddCapability(spv::Capability::SampledBuffer); | 247 | ctx.AddCapability(spv::Capability::SampledBuffer); |
| 245 | ctx.AddCapability(spv::Capability::StorageImageReadWithoutFormat); | ||
| 246 | } | 248 | } |
| 247 | } // Anonymous namespace | 249 | } // Anonymous namespace |
| 248 | 250 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index dd261fd47..17266ce77 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |||
| @@ -388,6 +388,10 @@ Id EmitImageGradient(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, I | |||
| 388 | 388 | ||
| 389 | Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords) { | 389 | Id EmitImageRead(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id coords) { |
| 390 | const auto info{inst->Flags<IR::TextureInstInfo>()}; | 390 | const auto info{inst->Flags<IR::TextureInstInfo>()}; |
| 391 | if (info.image_format == ImageFormat::Typeless && !ctx.profile.support_typeless_image_loads) { | ||
| 392 | // LOG_WARNING(..., "Typeless image read not supported by host"); | ||
| 393 | return ctx.ConstantNull(ctx.U32[4]); | ||
| 394 | } | ||
| 391 | return Emit(&EmitContext::OpImageSparseRead, &EmitContext::OpImageRead, ctx, inst, ctx.U32[4], | 395 | return Emit(&EmitContext::OpImageSparseRead, &EmitContext::OpImageRead, ctx, inst, ctx.U32[4], |
| 392 | Image(ctx, index, info), coords, std::nullopt, std::span<const Id>{}); | 396 | Image(ctx, index, info), coords, std::nullopt, std::span<const Id>{}); |
| 393 | } | 397 | } |