diff --git a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp index c1ff3d2f2..294e08f32 100644 --- a/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp +++ b/src/shader_recompiler/ir/passes/resource_tracking_pass.cpp @@ -621,7 +621,6 @@ void PatchImageInstruction(IR::Block& block, IR::Inst& inst, Info& info, Descrip auto image = info.ReadUdSharp(tsharp); if (!image.Valid()) { LOG_ERROR(Render_Vulkan, "Shader compiled with unbound image!"); - image = AmdGpu::Image::Null(); } ASSERT(image.GetType() != AmdGpu::ImageType::Invalid); const bool is_storage = IsImageStorageInstruction(inst); diff --git a/src/video_core/amdgpu/resource.h b/src/video_core/amdgpu/resource.h index a78a68391..fd311595e 100644 --- a/src/video_core/amdgpu/resource.h +++ b/src/video_core/amdgpu/resource.h @@ -176,18 +176,6 @@ struct Image { u64 lod_hw_cnt_en : 1; u64 : 43; - static constexpr Image Null() { - Image image{}; - image.data_format = u64(DataFormat::Format8_8_8_8); - image.dst_sel_x = 4; - image.dst_sel_y = 5; - image.dst_sel_z = 6; - image.dst_sel_w = 7; - image.tiling_index = u64(TilingMode::Texture_MicroTiled); - image.type = u64(ImageType::Color2D); - return image; - } - bool Valid() const { return (type & 0x8u) != 0; } @@ -269,18 +257,21 @@ struct Image { } ImageType GetType() const noexcept { - return static_cast(type); + return Valid() ? static_cast(type) : ImageType::Color2D; } DataFormat GetDataFmt() const noexcept { - return static_cast(data_format); + return Valid() ? static_cast(data_format) : DataFormat::Format8_8_8_8; } NumberFormat GetNumberFmt() const noexcept { - return static_cast(num_format); + return Valid() ? static_cast(num_format) : NumberFormat::Unorm; } TilingMode GetTilingMode() const { + if (!Valid()) { + return TilingMode::Texture_MicroTiled; + } if (tiling_index >= 0 && tiling_index <= 7) { return tiling_index == 5 ? TilingMode::Texture_MicroTiled : TilingMode::Depth_MacroTiled;