diff options
author | tfarley <tfarleygithub@gmail.com> | 2015-06-07 05:24:11 +0200 |
---|---|---|
committer | tfarley <tfarleygithub@gmail.com> | 2015-06-09 01:19:15 +0200 |
commit | 26bc816d7ac234182fdcee83698f02ef1394bd04 (patch) | |
tree | 702ff4a96ba37e496a3828d490995122f52984dd /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Render-to-texture flush, interval math fix (diff) | |
download | yuzu-26bc816d7ac234182fdcee83698f02ef1394bd04.tar yuzu-26bc816d7ac234182fdcee83698f02ef1394bd04.tar.gz yuzu-26bc816d7ac234182fdcee83698f02ef1394bd04.tar.bz2 yuzu-26bc816d7ac234182fdcee83698f02ef1394bd04.tar.lz yuzu-26bc816d7ac234182fdcee83698f02ef1394bd04.tar.xz yuzu-26bc816d7ac234182fdcee83698f02ef1394bd04.tar.zst yuzu-26bc816d7ac234182fdcee83698f02ef1394bd04.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index faab77ff5..518f79331 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -793,10 +793,10 @@ void RasterizerOpenGL::ReloadColorBuffer() { for (int x = 0; x < fb_color_texture.width; ++x) { const u32 coarse_y = y & ~7; u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * fb_color_texture.width * bytes_per_pixel; - u32 gl_px_idx = (x + y * fb_color_texture.width) * bytes_per_pixel; + u32 gl_pixel_index = (x + y * fb_color_texture.width) * bytes_per_pixel; u8* pixel = color_buffer + dst_offset; - memcpy(&temp_fb_color_buffer[gl_px_idx], pixel, bytes_per_pixel); + memcpy(&temp_fb_color_buffer[gl_pixel_index], pixel, bytes_per_pixel); } } @@ -834,11 +834,11 @@ void RasterizerOpenGL::ReloadDepthBuffer() { for (int x = 0; x < fb_depth_texture.width; ++x) { const u32 coarse_y = y & ~7; u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * fb_depth_texture.width * bytes_per_pixel; - u32 gl_px_idx = (x + y * fb_depth_texture.width); + u32 gl_pixel_index = (x + y * fb_depth_texture.width); u8* pixel = depth_buffer + dst_offset; u32 depth_stencil = *(u32*)pixel; - ((u32*)temp_fb_depth_data)[gl_px_idx] = (depth_stencil << 8) | (depth_stencil >> 24); + ((u32*)temp_fb_depth_data)[gl_pixel_index] = (depth_stencil << 8) | (depth_stencil >> 24); } } } else { @@ -846,10 +846,10 @@ void RasterizerOpenGL::ReloadDepthBuffer() { for (int x = 0; x < fb_depth_texture.width; ++x) { const u32 coarse_y = y & ~7; u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * fb_depth_texture.width * bytes_per_pixel; - u32 gl_px_idx = (x + y * fb_depth_texture.width) * gl_bpp; + u32 gl_pixel_index = (x + y * fb_depth_texture.width) * gl_bpp; u8* pixel = depth_buffer + dst_offset; - memcpy(&temp_fb_depth_data[gl_px_idx], pixel, bytes_per_pixel); + memcpy(&temp_fb_depth_data[gl_pixel_index], pixel, bytes_per_pixel); } } } @@ -890,10 +890,10 @@ void RasterizerOpenGL::CommitColorBuffer() { for (int x = 0; x < fb_color_texture.width; ++x) { const u32 coarse_y = y & ~7; u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * fb_color_texture.width * bytes_per_pixel; - u32 gl_px_idx = x * bytes_per_pixel + y * fb_color_texture.width * bytes_per_pixel; + u32 gl_pixel_index = x * bytes_per_pixel + y * fb_color_texture.width * bytes_per_pixel; u8* pixel = color_buffer + dst_offset; - memcpy(pixel, &temp_gl_color_buffer[gl_px_idx], bytes_per_pixel); + memcpy(pixel, &temp_gl_color_buffer[gl_pixel_index], bytes_per_pixel); } } } @@ -930,10 +930,10 @@ void RasterizerOpenGL::CommitDepthBuffer() { for (int x = 0; x < fb_depth_texture.width; ++x) { const u32 coarse_y = y & ~7; u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * fb_depth_texture.width * bytes_per_pixel; - u32 gl_px_idx = (x + y * fb_depth_texture.width); + u32 gl_pixel_index = (x + y * fb_depth_texture.width); u8* pixel = depth_buffer + dst_offset; - u32 depth_stencil = ((u32*)temp_gl_depth_data)[gl_px_idx]; + u32 depth_stencil = ((u32*)temp_gl_depth_data)[gl_pixel_index]; *(u32*)pixel = (depth_stencil >> 8) | (depth_stencil << 24); } } @@ -942,10 +942,10 @@ void RasterizerOpenGL::CommitDepthBuffer() { for (int x = 0; x < fb_depth_texture.width; ++x) { const u32 coarse_y = y & ~7; u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * fb_depth_texture.width * bytes_per_pixel; - u32 gl_px_idx = (x + y * fb_depth_texture.width) * gl_bpp; + u32 gl_pixel_index = (x + y * fb_depth_texture.width) * gl_bpp; u8* pixel = depth_buffer + dst_offset; - memcpy(pixel, &temp_gl_depth_data[gl_px_idx], bytes_per_pixel); + memcpy(pixel, &temp_gl_depth_data[gl_pixel_index], bytes_per_pixel); } } } |