[GPU] Misc GCC build fixes

This commit is contained in:
Joel Linn 2021-05-05 17:02:45 +02:00 committed by Rick Gibbed
parent 5284075cf9
commit 6dfa36d1b8
5 changed files with 4 additions and 51 deletions

View File

@ -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);

View File

@ -230,8 +230,8 @@ class RenderTargetCache {
};
uint32_t key = 0;
struct Hasher {
size_t operator()(const RenderTargetKey& key) const {
return std::hash<uint32_t>{}(key.key);
size_t operator()(const RenderTargetKey& render_target_key) const {
return std::hash<uint32_t>{}(render_target_key.key);
}
};
bool operator==(const RenderTargetKey& other_key) const {

View File

@ -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;

View File

@ -99,37 +99,6 @@ inline xenos::TextureFormat ColorFormatToTextureFormat(
return static_cast<xenos::TextureFormat>(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);
}
}

View File

@ -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.