gpu: size single-channel 16-bit and two-channel 8-bit formats (#715)

GetFormatCompatibilityClass listed only R16Sfloat in the 16-bit class, so
GetVulkanImageByteCount computed zero bytes for R16Unorm, R16SNorm, R16Uint,
R16Sint and the R8G8 family. UploadGuestImageInitialData treats a zero
expected size as an incompatible upload and drops it, which leaves the
texture blank for the rest of the run rather than failing loudly.

Silent Hill uploads R16Unorm at 144x81, 240x135, 256x256, 512x512 and
1024x1024, and every one was rejected: the guest supplied exactly
width*height*2 bytes each time (23328 for 144x81) against an expected zero.

Also adds R8SNorm to the 8-bit class, which was missing for the same reason.
This commit is contained in:
kuba
2026-07-31 11:11:44 +02:00
committed by GitHub
parent e5e02c0908
commit fc5b6baaa7
@@ -14185,8 +14185,23 @@ internal static unsafe class VulkanVideoPresenter
{ {
Format.R8Unorm or Format.R8Unorm or
Format.R8Uint or Format.R8Uint or
Format.R8Sint => 8, Format.R8Sint or
Format.R16Sfloat => 16, Format.R8SNorm => 8,
// Every single-channel 16-bit format shares this class, not just
// the float one. Omitting the rest made GetVulkanImageByteCount
// return zero for them, and a zero expected size rejects the
// guest's upload outright — the texture then samples as blank
// for the life of the run. Silent Hill uploads R16Unorm at
// 144x81 through 1024x1024 and every one was dropped.
Format.R16Sfloat or
Format.R16Unorm or
Format.R16SNorm or
Format.R16Uint or
Format.R16Sint or
Format.R8G8Unorm or
Format.R8G8SNorm or
Format.R8G8Uint or
Format.R8G8Sint => 16,
Format.R32Uint or Format.R32Uint or
Format.R32Sint or Format.R32Sint or
Format.R32Sfloat or Format.R32Sfloat or