aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/copy_params.h18
-rw-r--r--src/video_core/texture_cache/format_lookup_table.cpp12
-rw-r--r--src/video_core/texture_cache/surface_base.cpp35
-rw-r--r--src/video_core/texture_cache/surface_base.h14
-rw-r--r--src/video_core/texture_cache/surface_params.cpp18
-rw-r--r--src/video_core/texture_cache/surface_view.h10
-rw-r--r--src/video_core/texture_cache/texture_cache.h5
7 files changed, 56 insertions, 56 deletions
diff --git a/src/video_core/texture_cache/copy_params.h b/src/video_core/texture_cache/copy_params.h
index 9c21a0649..5b475fe06 100644
--- a/src/video_core/texture_cache/copy_params.h
+++ b/src/video_core/texture_cache/copy_params.h
@@ -9,16 +9,16 @@
namespace VideoCommon {
struct CopyParams {
- constexpr CopyParams(u32 source_x, u32 source_y, u32 source_z, u32 dest_x, u32 dest_y,
- u32 dest_z, u32 source_level, u32 dest_level, u32 width, u32 height,
- u32 depth)
- : source_x{source_x}, source_y{source_y}, source_z{source_z}, dest_x{dest_x},
- dest_y{dest_y}, dest_z{dest_z}, source_level{source_level},
- dest_level{dest_level}, width{width}, height{height}, depth{depth} {}
+ constexpr CopyParams(u32 source_x_, u32 source_y_, u32 source_z_, u32 dest_x_, u32 dest_y_,
+ u32 dest_z_, u32 source_level_, u32 dest_level_, u32 width_, u32 height_,
+ u32 depth_)
+ : source_x{source_x_}, source_y{source_y_}, source_z{source_z_}, dest_x{dest_x_},
+ dest_y{dest_y_}, dest_z{dest_z_}, source_level{source_level_},
+ dest_level{dest_level_}, width{width_}, height{height_}, depth{depth_} {}
- constexpr CopyParams(u32 width, u32 height, u32 depth, u32 level)
- : source_x{}, source_y{}, source_z{}, dest_x{}, dest_y{}, dest_z{}, source_level{level},
- dest_level{level}, width{width}, height{height}, depth{depth} {}
+ constexpr CopyParams(u32 width_, u32 height_, u32 depth_, u32 level_)
+ : source_x{}, source_y{}, source_z{}, dest_x{}, dest_y{}, dest_z{}, source_level{level_},
+ dest_level{level_}, width{width_}, height{height_}, depth{depth_} {}
u32 source_x;
u32 source_y;
diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp
index 7d5a75648..7938d71eb 100644
--- a/src/video_core/texture_cache/format_lookup_table.cpp
+++ b/src/video_core/texture_cache/format_lookup_table.cpp
@@ -24,12 +24,12 @@ constexpr bool C = false; // Normal color
constexpr bool S = true; // Srgb
struct Table {
- constexpr Table(TextureFormat texture_format, bool is_srgb, ComponentType red_component,
- ComponentType green_component, ComponentType blue_component,
- ComponentType alpha_component, PixelFormat pixel_format)
- : texture_format{texture_format}, pixel_format{pixel_format}, red_component{red_component},
- green_component{green_component}, blue_component{blue_component},
- alpha_component{alpha_component}, is_srgb{is_srgb} {}
+ constexpr Table(TextureFormat texture_format_, bool is_srgb_, ComponentType red_component_,
+ ComponentType green_component_, ComponentType blue_component_,
+ ComponentType alpha_component_, PixelFormat pixel_format_)
+ : texture_format{texture_format_}, pixel_format{pixel_format_},
+ red_component{red_component_}, green_component{green_component_},
+ blue_component{blue_component_}, alpha_component{alpha_component_}, is_srgb{is_srgb_} {}
TextureFormat texture_format;
PixelFormat pixel_format;
diff --git a/src/video_core/texture_cache/surface_base.cpp b/src/video_core/texture_cache/surface_base.cpp
index b44c09d71..efbcf6723 100644
--- a/src/video_core/texture_cache/surface_base.cpp
+++ b/src/video_core/texture_cache/surface_base.cpp
@@ -25,11 +25,11 @@ StagingCache::StagingCache() = default;
StagingCache::~StagingCache() = default;
-SurfaceBaseImpl::SurfaceBaseImpl(GPUVAddr gpu_addr, const SurfaceParams& params,
- bool is_astc_supported)
- : params{params}, gpu_addr{gpu_addr}, mipmap_sizes(params.num_levels),
+SurfaceBaseImpl::SurfaceBaseImpl(GPUVAddr gpu_addr_, const SurfaceParams& params_,
+ bool is_astc_supported_)
+ : params{params_}, gpu_addr{gpu_addr_}, mipmap_sizes(params_.num_levels),
mipmap_offsets(params.num_levels) {
- is_converted = IsPixelFormatASTC(params.pixel_format) && !is_astc_supported;
+ is_converted = IsPixelFormatASTC(params.pixel_format) && !is_astc_supported_;
host_memory_size = params.GetHostSizeInBytes(is_converted);
std::size_t offset = 0;
@@ -167,27 +167,28 @@ std::vector<CopyParams> SurfaceBaseImpl::BreakDownNonLayered(const SurfaceParams
return result;
}
-void SurfaceBaseImpl::SwizzleFunc(MortonSwizzleMode mode, u8* memory, const SurfaceParams& params,
- u8* buffer, u32 level) {
- const u32 width{params.GetMipWidth(level)};
- const u32 height{params.GetMipHeight(level)};
- const u32 block_height{params.GetMipBlockHeight(level)};
- const u32 block_depth{params.GetMipBlockDepth(level)};
+void SurfaceBaseImpl::SwizzleFunc(MortonSwizzleMode mode, u8* memory,
+ const SurfaceParams& surface_params, u8* buffer, u32 level) {
+ const u32 width{surface_params.GetMipWidth(level)};
+ const u32 height{surface_params.GetMipHeight(level)};
+ const u32 block_height{surface_params.GetMipBlockHeight(level)};
+ const u32 block_depth{surface_params.GetMipBlockDepth(level)};
std::size_t guest_offset{mipmap_offsets[level]};
- if (params.is_layered) {
+ if (surface_params.is_layered) {
std::size_t host_offset = 0;
const std::size_t guest_stride = layer_size;
- const std::size_t host_stride = params.GetHostLayerSize(level);
- for (u32 layer = 0; layer < params.depth; ++layer) {
- MortonSwizzle(mode, params.pixel_format, width, block_height, height, block_depth, 1,
- params.tile_width_spacing, buffer + host_offset, memory + guest_offset);
+ const std::size_t host_stride = surface_params.GetHostLayerSize(level);
+ for (u32 layer = 0; layer < surface_params.depth; ++layer) {
+ MortonSwizzle(mode, surface_params.pixel_format, width, block_height, height,
+ block_depth, 1, surface_params.tile_width_spacing, buffer + host_offset,
+ memory + guest_offset);
guest_offset += guest_stride;
host_offset += host_stride;
}
} else {
- MortonSwizzle(mode, params.pixel_format, width, block_height, height, block_depth,
- params.GetMipDepth(level), params.tile_width_spacing, buffer,
+ MortonSwizzle(mode, surface_params.pixel_format, width, block_height, height, block_depth,
+ surface_params.GetMipDepth(level), surface_params.tile_width_spacing, buffer,
memory + guest_offset);
}
}
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h
index 173f2edba..b57135fe4 100644
--- a/src/video_core/texture_cache/surface_base.h
+++ b/src/video_core/texture_cache/surface_base.h
@@ -148,8 +148,8 @@ public:
}
protected:
- explicit SurfaceBaseImpl(GPUVAddr gpu_addr, const SurfaceParams& params,
- bool is_astc_supported);
+ explicit SurfaceBaseImpl(GPUVAddr gpu_addr_, const SurfaceParams& params_,
+ bool is_astc_supported_);
~SurfaceBaseImpl() = default;
virtual void DecorateSurfaceName() = 0;
@@ -167,8 +167,8 @@ protected:
std::vector<std::size_t> mipmap_offsets;
private:
- void SwizzleFunc(MortonSwizzleMode mode, u8* memory, const SurfaceParams& params, u8* buffer,
- u32 level);
+ void SwizzleFunc(MortonSwizzleMode mode, u8* memory, const SurfaceParams& surface_params,
+ u8* buffer, u32 level);
std::vector<CopyParams> BreakDownLayered(const SurfaceParams& in_params) const;
@@ -297,9 +297,9 @@ public:
}
protected:
- explicit SurfaceBase(const GPUVAddr gpu_addr, const SurfaceParams& params,
- bool is_astc_supported)
- : SurfaceBaseImpl(gpu_addr, params, is_astc_supported) {}
+ explicit SurfaceBase(const GPUVAddr gpu_addr_, const SurfaceParams& params_,
+ bool is_astc_supported_)
+ : SurfaceBaseImpl{gpu_addr_, params_, is_astc_supported_} {}
~SurfaceBase() = default;
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp
index 13dd16356..96f93246d 100644
--- a/src/video_core/texture_cache/surface_params.cpp
+++ b/src/video_core/texture_cache/surface_params.cpp
@@ -356,18 +356,18 @@ std::size_t SurfaceParams::GetLayerSize(bool as_host_size, bool uncompressed) co
std::size_t SurfaceParams::GetInnerMipmapMemorySize(u32 level, bool as_host_size,
bool uncompressed) const {
- const u32 width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())};
- const u32 height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())};
- const u32 depth{is_layered ? 1U : GetMipDepth(level)};
+ const u32 mip_width{GetMipmapSize(uncompressed, GetMipWidth(level), GetDefaultBlockWidth())};
+ const u32 mip_height{GetMipmapSize(uncompressed, GetMipHeight(level), GetDefaultBlockHeight())};
+ const u32 mip_depth{is_layered ? 1U : GetMipDepth(level)};
if (is_tiled) {
- return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), width, height,
- depth, GetMipBlockHeight(level),
+ return Tegra::Texture::CalculateSize(!as_host_size, GetBytesPerPixel(), mip_width,
+ mip_height, mip_depth, GetMipBlockHeight(level),
GetMipBlockDepth(level));
} else if (as_host_size || IsBuffer()) {
- return GetBytesPerPixel() * width * height * depth;
+ return GetBytesPerPixel() * mip_width * mip_height * mip_depth;
} else {
// Linear Texture Case
- return pitch * height * depth;
+ return pitch * mip_height * mip_depth;
}
}
@@ -398,9 +398,9 @@ std::string SurfaceParams::TargetName() const {
case SurfaceTarget::TextureCubeArray:
return "CubeArray";
default:
- LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", static_cast<u32>(target));
+ LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target);
UNREACHABLE();
- return fmt::format("TUK({})", static_cast<u32>(target));
+ return fmt::format("TUK({})", target);
}
}
diff --git a/src/video_core/texture_cache/surface_view.h b/src/video_core/texture_cache/surface_view.h
index 90a8bb0ae..199f72732 100644
--- a/src/video_core/texture_cache/surface_view.h
+++ b/src/video_core/texture_cache/surface_view.h
@@ -13,10 +13,10 @@
namespace VideoCommon {
struct ViewParams {
- constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer,
- u32 num_layers, u32 base_level, u32 num_levels)
- : target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level},
- num_levels{num_levels} {}
+ constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target_, u32 base_layer_,
+ u32 num_layers_, u32 base_level_, u32 num_levels_)
+ : target{target_}, base_layer{base_layer_}, num_layers{num_layers_},
+ base_level{base_level_}, num_levels{num_levels_} {}
std::size_t Hash() const;
@@ -44,7 +44,7 @@ struct ViewParams {
class ViewBase {
public:
- constexpr explicit ViewBase(const ViewParams& params) : params{params} {}
+ constexpr explicit ViewBase(const ViewParams& view_params) : params{view_params} {}
constexpr const ViewParams& GetViewParams() const {
return params;
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index ea835c59f..581d8dd5b 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -1191,9 +1191,8 @@ private:
const SurfaceParams& src_params = src->GetSurfaceParams();
const SurfaceParams& dst_params = dst->GetSurfaceParams();
if (!format_compatibility.TestCopy(src_params.pixel_format, dst_params.pixel_format)) {
- LOG_ERROR(HW_GPU, "Illegal copy between formats={{{}, {}}}",
- static_cast<int>(dst_params.pixel_format),
- static_cast<int>(src_params.pixel_format));
+ LOG_ERROR(HW_GPU, "Illegal copy between formats={{{}, {}}}", dst_params.pixel_format,
+ src_params.pixel_format);
return;
}
ImageCopy(src, dst, copy);