diff options
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 20a8e1cda..29d61eccd 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -52,12 +52,28 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 52 | params.type = GetFormatType(params.pixel_format); | 52 | params.type = GetFormatType(params.pixel_format); |
| 53 | params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format)); | 53 | params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format)); |
| 54 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); | 54 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); |
| 55 | params.depth = config.tic.Depth(); | ||
| 56 | params.unaligned_height = config.tic.Height(); | 55 | params.unaligned_height = config.tic.Height(); |
| 57 | params.size_in_bytes = params.SizeInBytes(); | ||
| 58 | params.cache_width = Common::AlignUp(params.width, 8); | 56 | params.cache_width = Common::AlignUp(params.width, 8); |
| 59 | params.cache_height = Common::AlignUp(params.height, 8); | 57 | params.cache_height = Common::AlignUp(params.height, 8); |
| 60 | params.target = SurfaceTargetFromTextureType(config.tic.texture_type); | 58 | params.target = SurfaceTargetFromTextureType(config.tic.texture_type); |
| 59 | |||
| 60 | switch (params.target) { | ||
| 61 | case SurfaceTarget::Texture1D: | ||
| 62 | case SurfaceTarget::Texture2D: | ||
| 63 | params.depth = 1; | ||
| 64 | break; | ||
| 65 | case SurfaceTarget::Texture3D: | ||
| 66 | case SurfaceTarget::Texture2DArray: | ||
| 67 | params.depth = config.tic.Depth(); | ||
| 68 | break; | ||
| 69 | default: | ||
| 70 | LOG_CRITICAL(HW_GPU, "Unknown depth for target={}", static_cast<u32>(params.target)); | ||
| 71 | UNREACHABLE(); | ||
| 72 | params.depth = 1; | ||
| 73 | break; | ||
| 74 | } | ||
| 75 | |||
| 76 | params.size_in_bytes = params.SizeInBytes(); | ||
| 61 | return params; | 77 | return params; |
| 62 | } | 78 | } |
| 63 | 79 | ||
| @@ -72,12 +88,12 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 72 | params.type = GetFormatType(params.pixel_format); | 88 | params.type = GetFormatType(params.pixel_format); |
| 73 | params.width = config.width; | 89 | params.width = config.width; |
| 74 | params.height = config.height; | 90 | params.height = config.height; |
| 75 | params.depth = 1; | ||
| 76 | params.unaligned_height = config.height; | 91 | params.unaligned_height = config.height; |
| 77 | params.size_in_bytes = params.SizeInBytes(); | ||
| 78 | params.cache_width = Common::AlignUp(params.width, 8); | 92 | params.cache_width = Common::AlignUp(params.width, 8); |
| 79 | params.cache_height = Common::AlignUp(params.height, 8); | 93 | params.cache_height = Common::AlignUp(params.height, 8); |
| 80 | params.target = SurfaceTarget::Texture2D; | 94 | params.target = SurfaceTarget::Texture2D; |
| 95 | params.depth = 1; | ||
| 96 | params.size_in_bytes = params.SizeInBytes(); | ||
| 81 | return params; | 97 | return params; |
| 82 | } | 98 | } |
| 83 | 99 | ||
| @@ -93,12 +109,12 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 93 | params.type = GetFormatType(params.pixel_format); | 109 | params.type = GetFormatType(params.pixel_format); |
| 94 | params.width = zeta_width; | 110 | params.width = zeta_width; |
| 95 | params.height = zeta_height; | 111 | params.height = zeta_height; |
| 96 | params.depth = 1; | ||
| 97 | params.unaligned_height = zeta_height; | 112 | params.unaligned_height = zeta_height; |
| 98 | params.size_in_bytes = params.SizeInBytes(); | ||
| 99 | params.cache_width = Common::AlignUp(params.width, 8); | 113 | params.cache_width = Common::AlignUp(params.width, 8); |
| 100 | params.cache_height = Common::AlignUp(params.height, 8); | 114 | params.cache_height = Common::AlignUp(params.height, 8); |
| 101 | params.target = SurfaceTarget::Texture2D; | 115 | params.target = SurfaceTarget::Texture2D; |
| 116 | params.depth = 1; | ||
| 117 | params.size_in_bytes = params.SizeInBytes(); | ||
| 102 | return params; | 118 | return params; |
| 103 | } | 119 | } |
| 104 | 120 | ||