summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-04-25 00:01:06 +0200
committerbunnei <bunneidev@gmail.com>2018-04-25 04:31:46 +0200
commitf1a4a004fb8423091b48ceffdbd1e696372d4dc4 (patch)
treed325f360cccc55883840c8e27e3969d2acae2371 /src
parentgl_rasterizer_cache: Use GPU PAGE_BITS/SIZE, not CPU. (diff)
downloadyuzu-f1a4a004fb8423091b48ceffdbd1e696372d4dc4.tar
yuzu-f1a4a004fb8423091b48ceffdbd1e696372d4dc4.tar.gz
yuzu-f1a4a004fb8423091b48ceffdbd1e696372d4dc4.tar.bz2
yuzu-f1a4a004fb8423091b48ceffdbd1e696372d4dc4.tar.lz
yuzu-f1a4a004fb8423091b48ceffdbd1e696372d4dc4.tar.xz
yuzu-f1a4a004fb8423091b48ceffdbd1e696372d4dc4.tar.zst
yuzu-f1a4a004fb8423091b48ceffdbd1e696372d4dc4.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp6
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h2
2 files changed, 4 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 aef1c5979..501d15e98 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -82,7 +82,7 @@ static u16 GetResolutionScaleFactor() {
template <bool morton_to_gl, PixelFormat format>
void MortonCopy(u32 stride, u32 block_height, u32 height, u8* gl_buffer, Tegra::GPUVAddr base,
Tegra::GPUVAddr start, Tegra::GPUVAddr end) {
- constexpr u32 bytes_per_pixel = SurfaceParams::GetFormatBpp(format) / 8;
+ constexpr u32 bytes_per_pixel = SurfaceParams::GetFormatBpp(format) / CHAR_BIT;
constexpr u32 gl_bytes_per_pixel = CachedSurface::GetGLBytesPerPixel(format);
const auto& gpu = Core::System::GetInstance().GPU();
@@ -358,9 +358,9 @@ bool CachedSurface::CanFill(const SurfaceParams& dest_surface,
boost::icl::last_next(fill_interval) <= end && // dest_surface is within our fill range
dest_surface.FromInterval(fill_interval).GetInterval() ==
fill_interval) { // make sure interval is a rectangle in dest surface
- if (fill_size * 8 != dest_surface.GetFormatBpp()) {
+ if (fill_size * CHAR_BIT != dest_surface.GetFormatBpp()) {
// Check if bits repeat for our fill_size
- const u32 dest_bytes_per_pixel = std::max(dest_surface.GetFormatBpp() / 8, 1u);
+ const u32 dest_bytes_per_pixel = std::max(dest_surface.GetFormatBpp() / CHAR_BIT, 1u);
std::vector<u8> fill_test(fill_size * dest_bytes_per_pixel);
for (u32 i = 0; i < dest_bytes_per_pixel; ++i)
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index dfddcce90..55f1bdee8 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -374,7 +374,7 @@ struct CachedSurface : SurfaceParams {
if (format == PixelFormat::Invalid)
return 0;
- return SurfaceParams::GetFormatBpp(format) / 8;
+ return SurfaceParams::GetFormatBpp(format) / CHAR_BIT;
}
std::unique_ptr<u8[]> gl_buffer;