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.
This commit is contained in:
Billy Laws 2022-06-04 16:55:08 +01:00
parent 106ad597db
commit 0f5f04ade3

View File

@ -573,6 +573,9 @@ namespace skyline::service::hosbinder {
else if (surface.layout == NvSurfaceLayout::Tiled) else if (surface.layout == NvSurfaceLayout::Tiled)
throw exception("Legacy 16Bx16 tiled surfaces are not supported"); 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); 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 { } else {
Logger::Debug("#{} - No GraphicBuffer", slot); Logger::Debug("#{} - No GraphicBuffer", slot);