diff options
| author | 2021-04-11 02:37:03 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:27 -0400 | |
| commit | ab543f18213133b3076b81f30df386d5cb470e49 (patch) | |
| tree | 7d34e2e5e168225a4e1d5a6750eae31174d2a530 /src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |
| parent | shader: Move LaneId to the warp emission file and fix AMD (diff) | |
| download | yuzu-ab543f18213133b3076b81f30df386d5cb470e49.tar.gz yuzu-ab543f18213133b3076b81f30df386d5cb470e49.tar.xz yuzu-ab543f18213133b3076b81f30df386d5cb470e49.zip | |
spirv: Guard against typeless image reads on unsupported devices
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_image.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 | } |