mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-23 08:39:16 +01:00
Support BGRA8888 surfaceflinger format
A swizzle is applied to R8G8B8A8 to transform it to BGRA since BGRA isn't a commonly supported swapchain format on Android.
This commit is contained in:
parent
2bbeb6b08f
commit
106ad597db
@ -84,7 +84,10 @@ namespace skyline::gpu::format {
|
||||
FORMAT_NORM_INT_FLOAT(R16G16, 32, eR16G16);
|
||||
FORMAT(B10G11R11Float, 32, eB10G11R11UfloatPack32);
|
||||
FORMAT_NORM_INT_SRGB(R8G8B8A8, 32, eR8G8B8A8);
|
||||
FORMAT_NORM_INT_SRGB(B8G8R8A8, 32, eB8G8R8A8);
|
||||
FORMAT_NORM_INT_SRGB(B8G8R8A8, 32, eR8G8B8A8, .swizzleMapping = {
|
||||
.r = vk::ComponentSwizzle::eB,
|
||||
.b = vk::ComponentSwizzle::eR
|
||||
}); // Used by SurfaceFlinger
|
||||
FORMAT_SUFF_NORM_INT(A2B10G10R10, 32, eA2B10G10R10, Pack32);
|
||||
FORMAT_SUFF_NORM_INT_SRGB(A8B8G8R8, 32, eA8B8G8R8, Pack32);
|
||||
FORMAT(E5B9G9R9Float, 32, eE5B9G9R9UfloatPack32);
|
||||
|
@ -306,11 +306,12 @@ namespace skyline::service::hosbinder {
|
||||
case AndroidPixelFormat::RGBX8888:
|
||||
format = gpu::format::R8G8B8A8Unorm;
|
||||
break;
|
||||
|
||||
case AndroidPixelFormat::BGRA8888:
|
||||
format = gpu::format::B8G8R8A8Unorm;
|
||||
break;
|
||||
case AndroidPixelFormat::RGB565:
|
||||
format = gpu::format::R5G6B5Unorm;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw exception("Unknown format in buffer: '{}' ({})", ToString(handle.format), static_cast<u32>(handle.format));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user