diff options
| author | duck912 <350528965+Duck912@users.noreply.github.com> | 2026-10-31 01:45:57 -0400 |
|---|---|---|
| committer | Duck912 <350528965+Duck912@users.noreply.github.com> | 2026-11-01 14:59:07 -0500 |
| commit | cce19772ce434e462223663b88294bfd8a0f203e (patch) | |
| tree | 80d07da05e966152346f3b999636ec7e5f7b71ec /src/video_core | |
| parent | e6c0a42d11f15e623c399d14454e5ae8e1a72942 (diff) | |
nx2:vi2: crop presents to their frame size and honour RGB10A2 images
Present word 7 holds the size of the frame drawn into the image's
top-left corner, and image preference word 6 its format (1 RGBA8,
4 RGB10A2). Fire Emblem: Fortune's Weave draws 1280x720 RGB10A2 frames
into 3840x2160 images; showing the whole image as RGBA8 gave a corner
of wrongly decoded pixels.
Assisted-by: Claude Opus 5.5 (debugging, porting and drafting)
Signed-off-by: duck912 <350528965+Duck912@users.noreply.github.com>
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/present/layer.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/present/layer.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/surface.cpp | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/present/layer.cpp b/src/video_core/renderer_opengl/present/layer.cpp index 9e4a0f854a..2656892f4a 100644 --- a/src/video_core/renderer_opengl/present/layer.cpp +++ b/src/video_core/renderer_opengl/present/layer.cpp @@ -183,6 +183,11 @@ void Layer::ConfigureFramebufferTexture(const Tegra::FramebufferConfig& framebuf framebuffer_texture.gl_format = GL_RGBA; framebuffer_texture.gl_type = GL_UNSIGNED_INT_8_8_8_8_REV; break; + case Service::android::PixelFormat::Rgba1010102: + internal_format = GL_RGB10_A2; + framebuffer_texture.gl_format = GL_RGBA; + framebuffer_texture.gl_type = GL_UNSIGNED_INT_2_10_10_10_REV; + break; case Service::android::PixelFormat::Rgb565: internal_format = GL_RGB565; framebuffer_texture.gl_format = GL_RGB; diff --git a/src/video_core/renderer_vulkan/present/layer.cpp b/src/video_core/renderer_vulkan/present/layer.cpp index fa24c02f6d..5652090bd7 100644 --- a/src/video_core/renderer_vulkan/present/layer.cpp +++ b/src/video_core/renderer_vulkan/present/layer.cpp @@ -52,6 +52,8 @@ VkFormat GetFormat(const Tegra::FramebufferConfig& framebuffer) { return VK_FORMAT_R5G6B5_UNORM_PACK16; case Service::android::PixelFormat::Bgra8888: return VK_FORMAT_B8G8R8A8_UNORM; + case Service::android::PixelFormat::Rgba1010102: + return VK_FORMAT_A2B10G10R10_UNORM_PACK32; default: UNIMPLEMENTED_MSG("Unknown framebuffer pixel format: {}", static_cast<u32>(framebuffer.pixel_format)); diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp index 66b9577cb5..ef4859ea3e 100644 --- a/src/video_core/surface.cpp +++ b/src/video_core/surface.cpp @@ -214,6 +214,8 @@ PixelFormat PixelFormatFromGPUPixelFormat(Service::android::PixelFormat format) return PixelFormat::R5G6B5_UNORM; case Service::android::PixelFormat::Bgra8888: return PixelFormat::B8G8R8A8_UNORM; + case Service::android::PixelFormat::Rgba1010102: + return PixelFormat::A2B10G10R10_UNORM; default: UNIMPLEMENTED_MSG("Unimplemented format={}", format); return PixelFormat::A8B8G8R8_UNORM; |
