From fedd5dc4d0d9631140c71c41dc5a1d8c1579c8ab Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Sun, 29 Mar 2026 21:38:49 -0400 Subject: [PATCH] Avoid raw Vulkan surface-texture fast path on Android --- hw/xbox/nv2a/pgraph/vk/texture.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hw/xbox/nv2a/pgraph/vk/texture.c b/hw/xbox/nv2a/pgraph/vk/texture.c index 3ed3487bf7..b7619be557 100644 --- a/hw/xbox/nv2a/pgraph/vk/texture.c +++ b/hw/xbox/nv2a/pgraph/vk/texture.c @@ -1021,6 +1021,23 @@ static bool check_surface_to_texture_compatiblity(const SurfaceBinding *surface, return true; } +#ifdef __ANDROID__ + switch (surface->shape.color_format) { + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X1R5G5B5_Z1R5G5B5: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_X8R8G8B8_Z8R8G8B8: + case NV097_SET_SURFACE_FORMAT_COLOR_LE_A8R8G8B8: + /* + * Android GL routes these through RGBA8 surface transfers so guest + * alpha/color semantics are preserved. Sampling the raw Vulkan surface + * image directly can bypass that reinterpretation and show large black + * composition rectangles in 2D-heavy games. + */ + return false; + default: + break; + } +#endif + VkColorFormatInfo tex_vkf = kelvin_color_format_vk_map[shape->color_format]; return tex_vkf.vk_format && surface->host_fmt.host_bytes_per_pixel == vk_format_texel_size(tex_vkf.vk_format);