diff options
| author | 2019-01-30 12:35:56 -0500 | |
|---|---|---|
| committer | 2019-01-30 12:35:56 -0500 | |
| commit | 92b18345a898d8f373ea7d23050b2c36d3d88103 (patch) | |
| tree | badb452a20aa6d0ed2546ad8f989a7df3b07c733 /src | |
| parent | Merge pull request #2070 from ReinUsesLisp/cubearray-view (diff) | |
| parent | Add more info into textures' object labels (diff) | |
| download | yuzu-92b18345a898d8f373ea7d23050b2c36d3d88103.tar.gz yuzu-92b18345a898d8f373ea7d23050b2c36d3d88103.tar.xz yuzu-92b18345a898d8f373ea7d23050b2c36d3d88103.zip | |
Merge pull request #1485 from FernandoS27/render-info
Add more info into textures' object labels
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 52 |
2 files changed, 57 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index c44e2aca2..2b9c4628f 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -128,6 +128,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only, | |||
| 128 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); | 128 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); |
| 129 | params.unaligned_height = config.tic.Height(); | 129 | params.unaligned_height = config.tic.Height(); |
| 130 | params.target = SurfaceTargetFromTextureType(config.tic.texture_type); | 130 | params.target = SurfaceTargetFromTextureType(config.tic.texture_type); |
| 131 | params.identity = SurfaceClass::Uploaded; | ||
| 131 | 132 | ||
| 132 | switch (params.target) { | 133 | switch (params.target) { |
| 133 | case SurfaceTarget::Texture1D: | 134 | case SurfaceTarget::Texture1D: |
| @@ -195,6 +196,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only, | |||
| 195 | params.height = config.height; | 196 | params.height = config.height; |
| 196 | params.unaligned_height = config.height; | 197 | params.unaligned_height = config.height; |
| 197 | params.target = SurfaceTarget::Texture2D; | 198 | params.target = SurfaceTarget::Texture2D; |
| 199 | params.identity = SurfaceClass::RenderTarget; | ||
| 198 | params.depth = 1; | 200 | params.depth = 1; |
| 199 | params.max_mip_level = 1; | 201 | params.max_mip_level = 1; |
| 200 | params.is_layered = false; | 202 | params.is_layered = false; |
| @@ -230,6 +232,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only, | |||
| 230 | params.height = zeta_height; | 232 | params.height = zeta_height; |
| 231 | params.unaligned_height = zeta_height; | 233 | params.unaligned_height = zeta_height; |
| 232 | params.target = SurfaceTarget::Texture2D; | 234 | params.target = SurfaceTarget::Texture2D; |
| 235 | params.identity = SurfaceClass::DepthBuffer; | ||
| 233 | params.depth = 1; | 236 | params.depth = 1; |
| 234 | params.max_mip_level = 1; | 237 | params.max_mip_level = 1; |
| 235 | params.is_layered = false; | 238 | params.is_layered = false; |
| @@ -258,6 +261,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only, | |||
| 258 | params.height = config.height; | 261 | params.height = config.height; |
| 259 | params.unaligned_height = config.height; | 262 | params.unaligned_height = config.height; |
| 260 | params.target = SurfaceTarget::Texture2D; | 263 | params.target = SurfaceTarget::Texture2D; |
| 264 | params.identity = SurfaceClass::Copy; | ||
| 261 | params.depth = 1; | 265 | params.depth = 1; |
| 262 | params.max_mip_level = 1; | 266 | params.max_mip_level = 1; |
| 263 | params.rt = {}; | 267 | params.rt = {}; |
| @@ -575,8 +579,7 @@ CachedSurface::CachedSurface(const SurfaceParams& params) | |||
| 575 | 579 | ||
| 576 | ApplyTextureDefaults(SurfaceTargetToGL(params.target), params.max_mip_level); | 580 | ApplyTextureDefaults(SurfaceTargetToGL(params.target), params.max_mip_level); |
| 577 | 581 | ||
| 578 | LabelGLObject(GL_TEXTURE, texture.handle, params.addr, | 582 | OpenGL::LabelGLObject(GL_TEXTURE, texture.handle, params.addr, params.IdentityString()); |
| 579 | SurfaceParams::SurfaceTargetName(params.target)); | ||
| 580 | 583 | ||
| 581 | // Clamp size to mapped GPU memory region | 584 | // Clamp size to mapped GPU memory region |
| 582 | // TODO(bunnei): Super Mario Odyssey maps a 0x40000 byte region and then uses it for a 0x80000 | 585 | // TODO(bunnei): Super Mario Odyssey maps a 0x40000 byte region and then uses it for a 0x80000 |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index dae0feb20..8d7d6722c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -35,6 +35,14 @@ using PixelFormat = VideoCore::Surface::PixelFormat; | |||
| 35 | using ComponentType = VideoCore::Surface::ComponentType; | 35 | using ComponentType = VideoCore::Surface::ComponentType; |
| 36 | 36 | ||
| 37 | struct SurfaceParams { | 37 | struct SurfaceParams { |
| 38 | |||
| 39 | enum class SurfaceClass { | ||
| 40 | Uploaded, | ||
| 41 | RenderTarget, | ||
| 42 | DepthBuffer, | ||
| 43 | Copy, | ||
| 44 | }; | ||
| 45 | |||
| 38 | static std::string SurfaceTargetName(SurfaceTarget target) { | 46 | static std::string SurfaceTargetName(SurfaceTarget target) { |
| 39 | switch (target) { | 47 | switch (target) { |
| 40 | case SurfaceTarget::Texture1D: | 48 | case SurfaceTarget::Texture1D: |
| @@ -210,6 +218,48 @@ struct SurfaceParams { | |||
| 210 | /// Initializes parameters for caching, should be called after everything has been initialized | 218 | /// Initializes parameters for caching, should be called after everything has been initialized |
| 211 | void InitCacheParameters(Tegra::GPUVAddr gpu_addr); | 219 | void InitCacheParameters(Tegra::GPUVAddr gpu_addr); |
| 212 | 220 | ||
| 221 | std::string TargetName() const { | ||
| 222 | switch (target) { | ||
| 223 | case SurfaceTarget::Texture1D: | ||
| 224 | return "1D"; | ||
| 225 | case SurfaceTarget::Texture2D: | ||
| 226 | return "2D"; | ||
| 227 | case SurfaceTarget::Texture3D: | ||
| 228 | return "3D"; | ||
| 229 | case SurfaceTarget::Texture1DArray: | ||
| 230 | return "1DArray"; | ||
| 231 | case SurfaceTarget::Texture2DArray: | ||
| 232 | return "2DArray"; | ||
| 233 | case SurfaceTarget::TextureCubemap: | ||
| 234 | return "Cube"; | ||
| 235 | default: | ||
| 236 | LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", static_cast<u32>(target)); | ||
| 237 | UNREACHABLE(); | ||
| 238 | return fmt::format("TUK({})", static_cast<u32>(target)); | ||
| 239 | } | ||
| 240 | } | ||
| 241 | |||
| 242 | std::string ClassName() const { | ||
| 243 | switch (identity) { | ||
| 244 | case SurfaceClass::Uploaded: | ||
| 245 | return "UP"; | ||
| 246 | case SurfaceClass::RenderTarget: | ||
| 247 | return "RT"; | ||
| 248 | case SurfaceClass::DepthBuffer: | ||
| 249 | return "DB"; | ||
| 250 | case SurfaceClass::Copy: | ||
| 251 | return "CP"; | ||
| 252 | default: | ||
| 253 | LOG_CRITICAL(HW_GPU, "Unimplemented surface_class={}", static_cast<u32>(identity)); | ||
| 254 | UNREACHABLE(); | ||
| 255 | return fmt::format("CUK({})", static_cast<u32>(identity)); | ||
| 256 | } | ||
| 257 | } | ||
| 258 | |||
| 259 | std::string IdentityString() const { | ||
| 260 | return ClassName() + '_' + TargetName() + '_' + (is_tiled ? 'T' : 'L'); | ||
| 261 | } | ||
| 262 | |||
| 213 | bool is_tiled; | 263 | bool is_tiled; |
| 214 | u32 block_width; | 264 | u32 block_width; |
| 215 | u32 block_height; | 265 | u32 block_height; |
| @@ -223,6 +273,7 @@ struct SurfaceParams { | |||
| 223 | u32 depth; | 273 | u32 depth; |
| 224 | u32 unaligned_height; | 274 | u32 unaligned_height; |
| 225 | SurfaceTarget target; | 275 | SurfaceTarget target; |
| 276 | SurfaceClass identity; | ||
| 226 | u32 max_mip_level; | 277 | u32 max_mip_level; |
| 227 | bool is_layered; | 278 | bool is_layered; |
| 228 | bool is_array; | 279 | bool is_array; |
| @@ -256,6 +307,7 @@ struct SurfaceReserveKey : Common::HashableStruct<OpenGL::SurfaceParams> { | |||
| 256 | static SurfaceReserveKey Create(const OpenGL::SurfaceParams& params) { | 307 | static SurfaceReserveKey Create(const OpenGL::SurfaceParams& params) { |
| 257 | SurfaceReserveKey res; | 308 | SurfaceReserveKey res; |
| 258 | res.state = params; | 309 | res.state = params; |
| 310 | res.state.identity = {}; // Ignore the origin of the texture | ||
| 259 | res.state.gpu_addr = {}; // Ignore GPU vaddr in caching | 311 | res.state.gpu_addr = {}; // Ignore GPU vaddr in caching |
| 260 | res.state.rt = {}; // Ignore rt config in caching | 312 | res.state.rt = {}; // Ignore rt config in caching |
| 261 | return res; | 313 | return res; |