diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-13 05:44:18 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-10-16 17:31:01 +0200 |
commit | 58be4dff79ab48a4e052714250386bc61ef08982 (patch) | |
tree | 95a9f5013f26bbcc7944e05bf6a8ebc415c0901b /src/video_core/renderer_opengl/gl_rasterizer_cache.h | |
parent | gl_rasterizer_cache: Remove unused FlushSurface method. (diff) | |
download | yuzu-58be4dff79ab48a4e052714250386bc61ef08982.tar yuzu-58be4dff79ab48a4e052714250386bc61ef08982.tar.gz yuzu-58be4dff79ab48a4e052714250386bc61ef08982.tar.bz2 yuzu-58be4dff79ab48a4e052714250386bc61ef08982.tar.lz yuzu-58be4dff79ab48a4e052714250386bc61ef08982.tar.xz yuzu-58be4dff79ab48a4e052714250386bc61ef08982.tar.zst yuzu-58be4dff79ab48a4e052714250386bc61ef08982.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 247b58297..5dbef0c89 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -701,6 +701,14 @@ struct SurfaceParams { return SurfaceType::Invalid; } + /// Returns the sizer in bytes of the specified pixel format + static constexpr u32 GetBytesPerPixel(PixelFormat pixel_format) { + if (pixel_format == SurfaceParams::PixelFormat::Invalid) { + return 0; + } + return GetFormatBpp(pixel_format) / CHAR_BIT; + } + /// Returns the rectangle corresponding to this surface MathUtil::Rectangle<u32> GetRect() const; @@ -827,13 +835,6 @@ public: return gl_target; } - static constexpr unsigned int GetGLBytesPerPixel(SurfaceParams::PixelFormat format) { - if (format == SurfaceParams::PixelFormat::Invalid) - return 0; - - return SurfaceParams::GetFormatBpp(format) / CHAR_BIT; - } - const SurfaceParams& GetSurfaceParams() const { return params; } |