mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
Merge pull request #1485 from FernandoS27/render-info
Add more info into textures' object labels
This commit is contained in:
commit
92b18345a8
2 changed files with 57 additions and 2 deletions
|
@ -128,6 +128,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only,
|
||||||
params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format));
|
params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format));
|
||||||
params.unaligned_height = config.tic.Height();
|
params.unaligned_height = config.tic.Height();
|
||||||
params.target = SurfaceTargetFromTextureType(config.tic.texture_type);
|
params.target = SurfaceTargetFromTextureType(config.tic.texture_type);
|
||||||
|
params.identity = SurfaceClass::Uploaded;
|
||||||
|
|
||||||
switch (params.target) {
|
switch (params.target) {
|
||||||
case SurfaceTarget::Texture1D:
|
case SurfaceTarget::Texture1D:
|
||||||
|
@ -195,6 +196,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only,
|
||||||
params.height = config.height;
|
params.height = config.height;
|
||||||
params.unaligned_height = config.height;
|
params.unaligned_height = config.height;
|
||||||
params.target = SurfaceTarget::Texture2D;
|
params.target = SurfaceTarget::Texture2D;
|
||||||
|
params.identity = SurfaceClass::RenderTarget;
|
||||||
params.depth = 1;
|
params.depth = 1;
|
||||||
params.max_mip_level = 1;
|
params.max_mip_level = 1;
|
||||||
params.is_layered = false;
|
params.is_layered = false;
|
||||||
|
@ -230,6 +232,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only,
|
||||||
params.height = zeta_height;
|
params.height = zeta_height;
|
||||||
params.unaligned_height = zeta_height;
|
params.unaligned_height = zeta_height;
|
||||||
params.target = SurfaceTarget::Texture2D;
|
params.target = SurfaceTarget::Texture2D;
|
||||||
|
params.identity = SurfaceClass::DepthBuffer;
|
||||||
params.depth = 1;
|
params.depth = 1;
|
||||||
params.max_mip_level = 1;
|
params.max_mip_level = 1;
|
||||||
params.is_layered = false;
|
params.is_layered = false;
|
||||||
|
@ -258,6 +261,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only,
|
||||||
params.height = config.height;
|
params.height = config.height;
|
||||||
params.unaligned_height = config.height;
|
params.unaligned_height = config.height;
|
||||||
params.target = SurfaceTarget::Texture2D;
|
params.target = SurfaceTarget::Texture2D;
|
||||||
|
params.identity = SurfaceClass::Copy;
|
||||||
params.depth = 1;
|
params.depth = 1;
|
||||||
params.max_mip_level = 1;
|
params.max_mip_level = 1;
|
||||||
params.rt = {};
|
params.rt = {};
|
||||||
|
@ -575,8 +579,7 @@ CachedSurface::CachedSurface(const SurfaceParams& params)
|
||||||
|
|
||||||
ApplyTextureDefaults(SurfaceTargetToGL(params.target), params.max_mip_level);
|
ApplyTextureDefaults(SurfaceTargetToGL(params.target), params.max_mip_level);
|
||||||
|
|
||||||
LabelGLObject(GL_TEXTURE, texture.handle, params.addr,
|
OpenGL::LabelGLObject(GL_TEXTURE, texture.handle, params.addr, params.IdentityString());
|
||||||
SurfaceParams::SurfaceTargetName(params.target));
|
|
||||||
|
|
||||||
// Clamp size to mapped GPU memory region
|
// Clamp size to mapped GPU memory region
|
||||||
// TODO(bunnei): Super Mario Odyssey maps a 0x40000 byte region and then uses it for a 0x80000
|
// TODO(bunnei): Super Mario Odyssey maps a 0x40000 byte region and then uses it for a 0x80000
|
||||||
|
|
|
@ -35,6 +35,14 @@ using PixelFormat = VideoCore::Surface::PixelFormat;
|
||||||
using ComponentType = VideoCore::Surface::ComponentType;
|
using ComponentType = VideoCore::Surface::ComponentType;
|
||||||
|
|
||||||
struct SurfaceParams {
|
struct SurfaceParams {
|
||||||
|
|
||||||
|
enum class SurfaceClass {
|
||||||
|
Uploaded,
|
||||||
|
RenderTarget,
|
||||||
|
DepthBuffer,
|
||||||
|
Copy,
|
||||||
|
};
|
||||||
|
|
||||||
static std::string SurfaceTargetName(SurfaceTarget target) {
|
static std::string SurfaceTargetName(SurfaceTarget target) {
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case SurfaceTarget::Texture1D:
|
case SurfaceTarget::Texture1D:
|
||||||
|
@ -210,6 +218,48 @@ struct SurfaceParams {
|
||||||
/// Initializes parameters for caching, should be called after everything has been initialized
|
/// Initializes parameters for caching, should be called after everything has been initialized
|
||||||
void InitCacheParameters(Tegra::GPUVAddr gpu_addr);
|
void InitCacheParameters(Tegra::GPUVAddr gpu_addr);
|
||||||
|
|
||||||
|
std::string TargetName() const {
|
||||||
|
switch (target) {
|
||||||
|
case SurfaceTarget::Texture1D:
|
||||||
|
return "1D";
|
||||||
|
case SurfaceTarget::Texture2D:
|
||||||
|
return "2D";
|
||||||
|
case SurfaceTarget::Texture3D:
|
||||||
|
return "3D";
|
||||||
|
case SurfaceTarget::Texture1DArray:
|
||||||
|
return "1DArray";
|
||||||
|
case SurfaceTarget::Texture2DArray:
|
||||||
|
return "2DArray";
|
||||||
|
case SurfaceTarget::TextureCubemap:
|
||||||
|
return "Cube";
|
||||||
|
default:
|
||||||
|
LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", static_cast<u32>(target));
|
||||||
|
UNREACHABLE();
|
||||||
|
return fmt::format("TUK({})", static_cast<u32>(target));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string ClassName() const {
|
||||||
|
switch (identity) {
|
||||||
|
case SurfaceClass::Uploaded:
|
||||||
|
return "UP";
|
||||||
|
case SurfaceClass::RenderTarget:
|
||||||
|
return "RT";
|
||||||
|
case SurfaceClass::DepthBuffer:
|
||||||
|
return "DB";
|
||||||
|
case SurfaceClass::Copy:
|
||||||
|
return "CP";
|
||||||
|
default:
|
||||||
|
LOG_CRITICAL(HW_GPU, "Unimplemented surface_class={}", static_cast<u32>(identity));
|
||||||
|
UNREACHABLE();
|
||||||
|
return fmt::format("CUK({})", static_cast<u32>(identity));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string IdentityString() const {
|
||||||
|
return ClassName() + '_' + TargetName() + '_' + (is_tiled ? 'T' : 'L');
|
||||||
|
}
|
||||||
|
|
||||||
bool is_tiled;
|
bool is_tiled;
|
||||||
u32 block_width;
|
u32 block_width;
|
||||||
u32 block_height;
|
u32 block_height;
|
||||||
|
@ -223,6 +273,7 @@ struct SurfaceParams {
|
||||||
u32 depth;
|
u32 depth;
|
||||||
u32 unaligned_height;
|
u32 unaligned_height;
|
||||||
SurfaceTarget target;
|
SurfaceTarget target;
|
||||||
|
SurfaceClass identity;
|
||||||
u32 max_mip_level;
|
u32 max_mip_level;
|
||||||
bool is_layered;
|
bool is_layered;
|
||||||
bool is_array;
|
bool is_array;
|
||||||
|
@ -256,6 +307,7 @@ struct SurfaceReserveKey : Common::HashableStruct<OpenGL::SurfaceParams> {
|
||||||
static SurfaceReserveKey Create(const OpenGL::SurfaceParams& params) {
|
static SurfaceReserveKey Create(const OpenGL::SurfaceParams& params) {
|
||||||
SurfaceReserveKey res;
|
SurfaceReserveKey res;
|
||||||
res.state = params;
|
res.state = params;
|
||||||
|
res.state.identity = {}; // Ignore the origin of the texture
|
||||||
res.state.gpu_addr = {}; // Ignore GPU vaddr in caching
|
res.state.gpu_addr = {}; // Ignore GPU vaddr in caching
|
||||||
res.state.rt = {}; // Ignore rt config in caching
|
res.state.rt = {}; // Ignore rt config in caching
|
||||||
return res;
|
return res;
|
||||||
|
|
Loading…
Reference in a new issue