From 6dfa36d1b899f55d545b1685c7ad9113adbf500b Mon Sep 17 00:00:00 2001 From: Joel Linn Date: Wed, 5 May 2021 17:02:45 +0200 Subject: [PATCH] [GPU] Misc GCC build fixes --- src/xenia/gpu/dxbc.h | 2 +- src/xenia/gpu/render_target_cache.h | 4 ++-- src/xenia/gpu/texture_info.cc | 14 ------------ src/xenia/gpu/texture_info.h | 33 +---------------------------- src/xenia/gpu/xenos.h | 2 -- 5 files changed, 4 insertions(+), 51 deletions(-) diff --git a/src/xenia/gpu/dxbc.h b/src/xenia/gpu/dxbc.h index bf2fc8b86..c497b98d6 100644 --- a/src/xenia/gpu/dxbc.h +++ b/src/xenia/gpu/dxbc.h @@ -973,7 +973,7 @@ struct Src : OperandAddress { // For creating instances for use in declarations. struct DclT {}; - static constexpr DclT Dcl; + static constexpr DclT Dcl = {}; static Src R(uint32_t index, uint32_t swizzle = kXYZW) { return Src(OperandType::kTemp, swizzle, index); diff --git a/src/xenia/gpu/render_target_cache.h b/src/xenia/gpu/render_target_cache.h index bd4def049..600e248f7 100644 --- a/src/xenia/gpu/render_target_cache.h +++ b/src/xenia/gpu/render_target_cache.h @@ -230,8 +230,8 @@ class RenderTargetCache { }; uint32_t key = 0; struct Hasher { - size_t operator()(const RenderTargetKey& key) const { - return std::hash{}(key.key); + size_t operator()(const RenderTargetKey& render_target_key) const { + return std::hash{}(render_target_key.key); } }; bool operator==(const RenderTargetKey& other_key) const { diff --git a/src/xenia/gpu/texture_info.cc b/src/xenia/gpu/texture_info.cc index d190fb31e..79ac7bbd9 100644 --- a/src/xenia/gpu/texture_info.cc +++ b/src/xenia/gpu/texture_info.cc @@ -78,14 +78,6 @@ bool TextureInfo::Prepare(const xe_gpu_texture_fetch_t& fetch, info.is_tiled = fetch.tiled; info.has_packed_mips = fetch.packed_mips; - if (info.format_info()->format == xenos::TextureFormat::kUnknown) { - XELOGE("Attempting to fetch from unsupported texture format {}", - info.format); - info.memory.base_address = fetch.base_address << 12; - info.memory.mip_address = fetch.mip_address << 12; - return false; - } - info.extent = TextureExtent::Calculate(out_info, true); info.SetupMemoryInfo(fetch.base_address << 12, fetch.mip_address << 12); @@ -125,12 +117,6 @@ bool TextureInfo::PrepareResolve(uint32_t physical_address, info.is_tiled = true; info.has_packed_mips = false; - if (info.format_info()->format == xenos::TextureFormat::kUnknown) { - assert_true("Unsupported texture format"); - info.memory.base_address = physical_address; - return false; - } - info.extent = TextureExtent::Calculate(out_info, true); info.SetupMemoryInfo(physical_address, 0); return true; diff --git a/src/xenia/gpu/texture_info.h b/src/xenia/gpu/texture_info.h index 5b4ac93c2..f5b8a3728 100644 --- a/src/xenia/gpu/texture_info.h +++ b/src/xenia/gpu/texture_info.h @@ -99,37 +99,6 @@ inline xenos::TextureFormat ColorFormatToTextureFormat( return static_cast(color_format); } -inline xenos::TextureFormat ColorRenderTargetToTextureFormat( - xenos::ColorRenderTargetFormat color_format) { - switch (color_format) { - case xenos::ColorRenderTargetFormat::k_8_8_8_8: - return xenos::TextureFormat::k_8_8_8_8; - case xenos::ColorRenderTargetFormat::k_8_8_8_8_GAMMA: - return xenos::TextureFormat::k_8_8_8_8_GAMMA_EDRAM; - case xenos::ColorRenderTargetFormat::k_2_10_10_10: - case xenos::ColorRenderTargetFormat::k_2_10_10_10_AS_10_10_10_10: - return xenos::TextureFormat::k_2_10_10_10; - case xenos::ColorRenderTargetFormat::k_2_10_10_10_FLOAT: - case xenos::ColorRenderTargetFormat::k_2_10_10_10_FLOAT_AS_16_16_16_16: - return xenos::TextureFormat::k_2_10_10_10_FLOAT_EDRAM; - case xenos::ColorRenderTargetFormat::k_16_16: - return xenos::TextureFormat::k_16_16_EDRAM; - case xenos::ColorRenderTargetFormat::k_16_16_16_16: - return xenos::TextureFormat::k_16_16_16_16_EDRAM; - case xenos::ColorRenderTargetFormat::k_16_16_FLOAT: - return xenos::TextureFormat::k_16_16_FLOAT; - case xenos::ColorRenderTargetFormat::k_16_16_16_16_FLOAT: - return xenos::TextureFormat::k_16_16_16_16_FLOAT; - case xenos::ColorRenderTargetFormat::k_32_FLOAT: - return xenos::TextureFormat::k_32_FLOAT; - case xenos::ColorRenderTargetFormat::k_32_32_FLOAT: - return xenos::TextureFormat::k_32_32_FLOAT; - default: - assert_unhandled_case(color_format); - return xenos::TextureFormat::kUnknown; - } -} - inline xenos::TextureFormat DepthRenderTargetToTextureFormat( xenos::DepthRenderTargetFormat depth_format) { switch (depth_format) { @@ -139,7 +108,7 @@ inline xenos::TextureFormat DepthRenderTargetToTextureFormat( return xenos::TextureFormat::k_24_8_FLOAT; default: assert_unhandled_case(depth_format); - return xenos::TextureFormat::kUnknown; + return xenos::TextureFormat(~0); } } diff --git a/src/xenia/gpu/xenos.h b/src/xenia/gpu/xenos.h index 34784662a..5b449958f 100644 --- a/src/xenia/gpu/xenos.h +++ b/src/xenia/gpu/xenos.h @@ -479,8 +479,6 @@ enum class TextureFormat : uint32_t { k_DXT3A_AS_1_1_1_1 = 61, k_8_8_8_8_GAMMA_EDRAM = 62, k_2_10_10_10_FLOAT_EDRAM = 63, - - kUnknown = 0xFFFFFFFFu, }; // Subset of a2xx_sq_surfaceformat - formats that RTs can be resolved to.