diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-09-10 19:40:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-10 19:40:47 +0200 |
commit | 5b8fdedf4d5602467e5a61d2a51558c7b9f28bac (patch) | |
tree | f45a2d629ffb29467ad8739e5745d932015663eb /src | |
parent | Merge pull request #11456 from liamwhite/worse-integrity-verification (diff) | |
parent | shader_recompiler: always declare image format for image buffers (diff) | |
download | yuzu-5b8fdedf4d5602467e5a61d2a51558c7b9f28bac.tar yuzu-5b8fdedf4d5602467e5a61d2a51558c7b9f28bac.tar.gz yuzu-5b8fdedf4d5602467e5a61d2a51558c7b9f28bac.tar.bz2 yuzu-5b8fdedf4d5602467e5a61d2a51558c7b9f28bac.tar.lz yuzu-5b8fdedf4d5602467e5a61d2a51558c7b9f28bac.tar.xz yuzu-5b8fdedf4d5602467e5a61d2a51558c7b9f28bac.tar.zst yuzu-5b8fdedf4d5602467e5a61d2a51558c7b9f28bac.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index bec5db173..238fb40e3 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -74,6 +74,11 @@ spv::ImageFormat GetImageFormat(ImageFormat format) { throw InvalidArgument("Invalid image format {}", format); } +spv::ImageFormat GetImageFormatForBuffer(ImageFormat format) { + const auto spv_format = GetImageFormat(format); + return spv_format == spv::ImageFormat::Unknown ? spv::ImageFormat::R32ui : spv_format; +} + Id ImageType(EmitContext& ctx, const ImageDescriptor& desc) { const spv::ImageFormat format{GetImageFormat(desc.format)}; const Id type{ctx.U32[1]}; @@ -1271,7 +1276,7 @@ void EmitContext::DefineImageBuffers(const Info& info, u32& binding) { if (desc.count != 1) { throw NotImplementedException("Array of image buffers"); } - const spv::ImageFormat format{GetImageFormat(desc.format)}; + const spv::ImageFormat format{GetImageFormatForBuffer(desc.format)}; const Id image_type{TypeImage(U32[1], spv::Dim::Buffer, false, false, false, 2, format)}; const Id pointer_type{TypePointer(spv::StorageClass::UniformConstant, image_type)}; const Id id{AddGlobalVariable(pointer_type, spv::StorageClass::UniformConstant)}; |