diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 3 | ||||
| -rw-r--r-- | src/video_core/textures/texture.h | 12 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index df99dd521..1a44de332 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -51,6 +51,7 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 51 | params.type = GetFormatType(params.pixel_format); | 51 | params.type = GetFormatType(params.pixel_format); |
| 52 | params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format)); | 52 | params.width = Common::AlignUp(config.tic.Width(), GetCompressionFactor(params.pixel_format)); |
| 53 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); | 53 | params.height = Common::AlignUp(config.tic.Height(), GetCompressionFactor(params.pixel_format)); |
| 54 | params.depth = config.tic.Depth(); | ||
| 54 | params.unaligned_height = config.tic.Height(); | 55 | params.unaligned_height = config.tic.Height(); |
| 55 | params.size_in_bytes = params.SizeInBytes(); | 56 | params.size_in_bytes = params.SizeInBytes(); |
| 56 | params.cache_width = Common::AlignUp(params.width, 16); | 57 | params.cache_width = Common::AlignUp(params.width, 16); |
| @@ -70,6 +71,7 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 70 | params.type = GetFormatType(params.pixel_format); | 71 | params.type = GetFormatType(params.pixel_format); |
| 71 | params.width = config.width; | 72 | params.width = config.width; |
| 72 | params.height = config.height; | 73 | params.height = config.height; |
| 74 | params.depth = 1; | ||
| 73 | params.unaligned_height = config.height; | 75 | params.unaligned_height = config.height; |
| 74 | params.size_in_bytes = params.SizeInBytes(); | 76 | params.size_in_bytes = params.SizeInBytes(); |
| 75 | params.cache_width = Common::AlignUp(params.width, 16); | 77 | params.cache_width = Common::AlignUp(params.width, 16); |
| @@ -88,9 +90,9 @@ static VAddr TryGetCpuAddr(Tegra::GPUVAddr gpu_addr) { | |||
| 88 | params.pixel_format = PixelFormatFromDepthFormat(format); | 90 | params.pixel_format = PixelFormatFromDepthFormat(format); |
| 89 | params.component_type = ComponentTypeFromDepthFormat(format); | 91 | params.component_type = ComponentTypeFromDepthFormat(format); |
| 90 | params.type = GetFormatType(params.pixel_format); | 92 | params.type = GetFormatType(params.pixel_format); |
| 91 | params.size_in_bytes = params.SizeInBytes(); | ||
| 92 | params.width = zeta_width; | 93 | params.width = zeta_width; |
| 93 | params.height = zeta_height; | 94 | params.height = zeta_height; |
| 95 | params.depth = 1; | ||
| 94 | params.unaligned_height = zeta_height; | 96 | params.unaligned_height = zeta_height; |
| 95 | params.size_in_bytes = params.SizeInBytes(); | 97 | params.size_in_bytes = params.SizeInBytes(); |
| 96 | params.cache_width = Common::AlignUp(params.width, 16); | 98 | params.cache_width = Common::AlignUp(params.width, 16); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 6693b5cda..56022ea01 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -662,7 +662,7 @@ struct SurfaceParams { | |||
| 662 | ASSERT(width % compression_factor == 0); | 662 | ASSERT(width % compression_factor == 0); |
| 663 | ASSERT(height % compression_factor == 0); | 663 | ASSERT(height % compression_factor == 0); |
| 664 | return (width / compression_factor) * (height / compression_factor) * | 664 | return (width / compression_factor) * (height / compression_factor) * |
| 665 | GetFormatBpp(pixel_format) / CHAR_BIT; | 665 | GetFormatBpp(pixel_format) * depth / CHAR_BIT; |
| 666 | } | 666 | } |
| 667 | 667 | ||
| 668 | /// Creates SurfaceParams from a texture configuration | 668 | /// Creates SurfaceParams from a texture configuration |
| @@ -691,6 +691,7 @@ struct SurfaceParams { | |||
| 691 | SurfaceType type; | 691 | SurfaceType type; |
| 692 | u32 width; | 692 | u32 width; |
| 693 | u32 height; | 693 | u32 height; |
| 694 | u32 depth; | ||
| 694 | u32 unaligned_height; | 695 | u32 unaligned_height; |
| 695 | size_t size_in_bytes; | 696 | size_t size_in_bytes; |
| 696 | SurfaceTarget target; | 697 | SurfaceTarget target; |
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index c6bd2f4b9..c2fb824b2 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -170,8 +170,12 @@ struct TICEntry { | |||
| 170 | BitField<0, 16, u32> width_minus_1; | 170 | BitField<0, 16, u32> width_minus_1; |
| 171 | BitField<23, 4, TextureType> texture_type; | 171 | BitField<23, 4, TextureType> texture_type; |
| 172 | }; | 172 | }; |
| 173 | u16 height_minus_1; | 173 | union { |
| 174 | INSERT_PADDING_BYTES(10); | 174 | BitField<0, 16, u32> height_minus_1; |
| 175 | BitField<16, 15, u32> depth_minus_1; | ||
| 176 | }; | ||
| 177 | |||
| 178 | INSERT_PADDING_BYTES(8); | ||
| 175 | 179 | ||
| 176 | GPUVAddr Address() const { | 180 | GPUVAddr Address() const { |
| 177 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | address_low); | 181 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | address_low); |
| @@ -192,6 +196,10 @@ struct TICEntry { | |||
| 192 | return height_minus_1 + 1; | 196 | return height_minus_1 + 1; |
| 193 | } | 197 | } |
| 194 | 198 | ||
| 199 | u32 Depth() const { | ||
| 200 | return depth_minus_1 + 1; | ||
| 201 | } | ||
| 202 | |||
| 195 | u32 BlockHeight() const { | 203 | u32 BlockHeight() const { |
| 196 | ASSERT(header_version == TICHeaderVersion::BlockLinear || | 204 | ASSERT(header_version == TICHeaderVersion::BlockLinear || |
| 197 | header_version == TICHeaderVersion::BlockLinearColorKey); | 205 | header_version == TICHeaderVersion::BlockLinearColorKey); |