From 0f5f04ade3d053405204933bab0305953083ea8a Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 4 Jun 2022 16:55:08 +0100 Subject: [PATCH] Set default surfaceflinger parameters based off of preallocated buffers Required by resident evil 4 as otherwise Dequeue would fail due to it using BGRA buffers but the default being RGBA. --- .../cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp b/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp index c9ead3cd..5fd07707 100644 --- a/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp +++ b/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp @@ -573,6 +573,9 @@ namespace skyline::service::hosbinder { else if (surface.layout == NvSurfaceLayout::Tiled) throw exception("Legacy 16Bx16 tiled surfaces are not supported"); + defaultFormat = graphicBuffer->format; + defaultWidth = graphicBuffer->width; + defaultHeight = graphicBuffer->height; Logger::Debug("#{} - Dimensions: {}x{} [Stride: {}], Format: {}, Layout: {}, {}: {}, Usage: 0x{:X}, NvMap {}: {}, Buffer Start/End: 0x{:X} -> 0x{:X}", slot, surface.width, surface.height, handle.stride, ToString(handle.format), ToString(surface.layout), surface.layout == NvSurfaceLayout::Blocklinear ? "Block Height" : "Pitch", surface.layout == NvSurfaceLayout::Blocklinear ? 1U << surface.blockHeightLog2 : surface.pitch, graphicBuffer->usage, surface.nvmapHandle ? "Handle" : "ID", surface.nvmapHandle ? surface.nvmapHandle : handle.nvmapId, surface.offset, surface.offset + surface.size); } else { Logger::Debug("#{} - No GraphicBuffer", slot);