summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2014-12-31 15:04:39 +0100
committerTony Wasserka <NeoBrainX@gmail.com>2014-12-31 16:32:55 +0100
commit195d73a385c9dd88150ed9b875e313c186e7d96e (patch)
tree3e0d63c7e2d8721a1e5c6add465b0a0c0836bce9
parentPica/VertexShader: Coding style fixes. (diff)
downloadyuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar
yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar.gz
yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar.bz2
yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar.lz
yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar.xz
yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.tar.zst
yuzu-195d73a385c9dd88150ed9b875e313c186e7d96e.zip
-rw-r--r--src/video_core/rasterizer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 9148745dc..9822b36a6 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -18,7 +18,8 @@ namespace Pica {
namespace Rasterizer {
static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) {
- u32* color_buffer = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetColorBufferPhysicalAddress())));
+ const PAddr addr = registers.framebuffer.GetColorBufferPhysicalAddress();
+ u32* color_buffer = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(addr)));
u32 value = (color.a() << 24) | (color.r() << 16) | (color.g() << 8) | color.b();
// Assuming RGBA8 format until actual framebuffer format handling is implemented
@@ -26,7 +27,8 @@ static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) {
}
static const Math::Vec4<u8> GetPixel(int x, int y) {
- u32* color_buffer_u32 = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetColorBufferPhysicalAddress())));
+ const PAddr addr = registers.framebuffer.GetColorBufferPhysicalAddress();
+ u32* color_buffer_u32 = reinterpret_cast<u32*>(Memory::GetPointer(PAddrToVAddr(addr)));
u32 value = *(color_buffer_u32 + x + y * registers.framebuffer.GetWidth());
Math::Vec4<u8> ret;
@@ -38,14 +40,16 @@ static const Math::Vec4<u8> GetPixel(int x, int y) {
}
static u32 GetDepth(int x, int y) {
- u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress())));
+ const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress();
+ u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(addr)));
// Assuming 16-bit depth buffer format until actual format handling is implemented
return *(depth_buffer + x + y * registers.framebuffer.GetWidth());
}
static void SetDepth(int x, int y, u16 value) {
- u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(registers.framebuffer.GetDepthBufferPhysicalAddress())));
+ const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress();
+ u16* depth_buffer = reinterpret_cast<u16*>(Memory::GetPointer(PAddrToVAddr(addr)));
// Assuming 16-bit depth buffer format until actual format handling is implemented
*(depth_buffer + x + y * registers.framebuffer.GetWidth()) = value;