diff options
| author | 2015-05-09 15:57:29 +0200 | |
|---|---|---|
| committer | 2015-05-09 15:57:29 +0200 | |
| commit | e35e72d0a5c90c37d22328115fa0f29dd17aeaee (patch) | |
| tree | 4053db2c53a1ac77294c03782de75c91c0cf4b27 /src/video_core/rasterizer.cpp | |
| parent | Loader: Add missing include (diff) | |
| parent | Memory: Add GetPhysicalPointer helper function (diff) | |
| download | yuzu-e35e72d0a5c90c37d22328115fa0f29dd17aeaee.tar.gz yuzu-e35e72d0a5c90c37d22328115fa0f29dd17aeaee.tar.xz yuzu-e35e72d0a5c90c37d22328115fa0f29dd17aeaee.zip | |
Merge pull request #734 from yuriks/memmap
Small memory map definitions cleanup
Diffstat (limited to 'src/video_core/rasterizer.cpp')
| -rw-r--r-- | src/video_core/rasterizer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 6ec253601..3b3fef484 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp | |||
| @@ -30,7 +30,7 @@ static void DrawPixel(int x, int y, const Math::Vec4<u8>& color) { | |||
| 30 | const u32 coarse_y = y & ~7; | 30 | const u32 coarse_y = y & ~7; |
| 31 | u32 bytes_per_pixel = GPU::Regs::BytesPerPixel(GPU::Regs::PixelFormat(registers.framebuffer.color_format.Value())); | 31 | u32 bytes_per_pixel = GPU::Regs::BytesPerPixel(GPU::Regs::PixelFormat(registers.framebuffer.color_format.Value())); |
| 32 | u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * registers.framebuffer.width * bytes_per_pixel; | 32 | u32 dst_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * registers.framebuffer.width * bytes_per_pixel; |
| 33 | u8* dst_pixel = Memory::GetPointer(PAddrToVAddr(addr)) + dst_offset; | 33 | u8* dst_pixel = Memory::GetPhysicalPointer(addr) + dst_offset; |
| 34 | 34 | ||
| 35 | switch (registers.framebuffer.color_format) { | 35 | switch (registers.framebuffer.color_format) { |
| 36 | case registers.framebuffer.RGBA8: | 36 | case registers.framebuffer.RGBA8: |
| @@ -67,7 +67,7 @@ static const Math::Vec4<u8> GetPixel(int x, int y) { | |||
| 67 | const u32 coarse_y = y & ~7; | 67 | const u32 coarse_y = y & ~7; |
| 68 | u32 bytes_per_pixel = GPU::Regs::BytesPerPixel(GPU::Regs::PixelFormat(registers.framebuffer.color_format.Value())); | 68 | u32 bytes_per_pixel = GPU::Regs::BytesPerPixel(GPU::Regs::PixelFormat(registers.framebuffer.color_format.Value())); |
| 69 | u32 src_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * registers.framebuffer.width * bytes_per_pixel; | 69 | u32 src_offset = VideoCore::GetMortonOffset(x, y, bytes_per_pixel) + coarse_y * registers.framebuffer.width * bytes_per_pixel; |
| 70 | u8* src_pixel = Memory::GetPointer(PAddrToVAddr(addr)) + src_offset; | 70 | u8* src_pixel = Memory::GetPhysicalPointer(addr) + src_offset; |
| 71 | 71 | ||
| 72 | switch (registers.framebuffer.color_format) { | 72 | switch (registers.framebuffer.color_format) { |
| 73 | case registers.framebuffer.RGBA8: | 73 | case registers.framebuffer.RGBA8: |
| @@ -95,7 +95,7 @@ static const Math::Vec4<u8> GetPixel(int x, int y) { | |||
| 95 | 95 | ||
| 96 | static u32 GetDepth(int x, int y) { | 96 | static u32 GetDepth(int x, int y) { |
| 97 | const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress(); | 97 | const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress(); |
| 98 | u8* depth_buffer = Memory::GetPointer(PAddrToVAddr(addr)); | 98 | u8* depth_buffer = Memory::GetPhysicalPointer(addr); |
| 99 | 99 | ||
| 100 | y = (registers.framebuffer.height - y); | 100 | y = (registers.framebuffer.height - y); |
| 101 | 101 | ||
| @@ -122,7 +122,7 @@ static u32 GetDepth(int x, int y) { | |||
| 122 | 122 | ||
| 123 | static void SetDepth(int x, int y, u32 value) { | 123 | static void SetDepth(int x, int y, u32 value) { |
| 124 | const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress(); | 124 | const PAddr addr = registers.framebuffer.GetDepthBufferPhysicalAddress(); |
| 125 | u8* depth_buffer = Memory::GetPointer(PAddrToVAddr(addr)); | 125 | u8* depth_buffer = Memory::GetPhysicalPointer(addr); |
| 126 | 126 | ||
| 127 | y = (registers.framebuffer.height - y); | 127 | y = (registers.framebuffer.height - y); |
| 128 | 128 | ||
| @@ -361,7 +361,7 @@ static void ProcessTriangleInternal(const VertexShader::OutputVertex& v0, | |||
| 361 | s = GetWrappedTexCoord(texture.config.wrap_s, s, texture.config.width); | 361 | s = GetWrappedTexCoord(texture.config.wrap_s, s, texture.config.width); |
| 362 | t = texture.config.height - 1 - GetWrappedTexCoord(texture.config.wrap_t, t, texture.config.height); | 362 | t = texture.config.height - 1 - GetWrappedTexCoord(texture.config.wrap_t, t, texture.config.height); |
| 363 | 363 | ||
| 364 | u8* texture_data = Memory::GetPointer(PAddrToVAddr(texture.config.GetPhysicalAddress())); | 364 | u8* texture_data = Memory::GetPhysicalPointer(texture.config.GetPhysicalAddress()); |
| 365 | auto info = DebugUtils::TextureInfo::FromPicaRegister(texture.config, texture.format); | 365 | auto info = DebugUtils::TextureInfo::FromPicaRegister(texture.config, texture.format); |
| 366 | 366 | ||
| 367 | texture_color[i] = DebugUtils::LookupTexture(texture_data, s, t, info); | 367 | texture_color[i] = DebugUtils::LookupTexture(texture_data, s, t, info); |