summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer_cache.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-13 05:44:18 +0200
committerbunnei <bunneidev@gmail.com>2018-10-16 17:31:01 +0200
commit58be4dff79ab48a4e052714250386bc61ef08982 (patch)
tree95a9f5013f26bbcc7944e05bf6a8ebc415c0901b /src/video_core/renderer_opengl/gl_rasterizer_cache.h
parentgl_rasterizer_cache: Remove unused FlushSurface method. (diff)
downloadyuzu-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.h15
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;
}