diff options
author | bunnei <bunneidev@gmail.com> | 2019-04-09 23:20:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-09 23:20:43 +0200 |
commit | bc7e1498352d99368de3cbf3645e3e6c50f600b8 (patch) | |
tree | ec9b6ab236da4b72f55249072542f13da8f74ddd /src/video_core/renderer_opengl/gl_rasterizer_cache.h | |
parent | Merge pull request #2368 from FernandoS27/fix-lop (diff) | |
parent | gl_backend: Align Pixel Storage (diff) | |
download | yuzu-bc7e1498352d99368de3cbf3645e3e6c50f600b8.tar yuzu-bc7e1498352d99368de3cbf3645e3e6c50f600b8.tar.gz yuzu-bc7e1498352d99368de3cbf3645e3e6c50f600b8.tar.bz2 yuzu-bc7e1498352d99368de3cbf3645e3e6c50f600b8.tar.lz yuzu-bc7e1498352d99368de3cbf3645e3e6c50f600b8.tar.xz yuzu-bc7e1498352d99368de3cbf3645e3e6c50f600b8.tar.zst yuzu-bc7e1498352d99368de3cbf3645e3e6c50f600b8.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer_cache.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index ad4fd3ad2..db280dbb3 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -11,6 +11,7 @@ #include <vector> #include "common/alignment.h" +#include "common/bit_util.h" #include "common/common_types.h" #include "common/hash.h" #include "common/math_util.h" @@ -205,6 +206,13 @@ struct SurfaceParams { return bd; } + u32 RowAlign(u32 mip_level) const { + const u32 m_width = MipWidth(mip_level); + const u32 bytes_per_pixel = GetBytesPerPixel(pixel_format); + const u32 l2 = Common::CountTrailingZeroes32(m_width * bytes_per_pixel); + return (1U << l2); + } + /// Creates SurfaceParams from a texture configuration static SurfaceParams CreateForTexture(const Tegra::Texture::FullTextureInfo& config, const GLShader::SamplerEntry& entry); |