Add multiple framebuffer support in nvnflinger
This fix libnx console rendering
This commit is contained in:
parent
52e7f95351
commit
0e77305c3d
1 changed files with 19 additions and 1 deletions
|
@ -379,6 +379,21 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private GalImageFormat ConvertColorFormat(ColorFormat colorFormat)
|
||||||
|
{
|
||||||
|
switch (colorFormat)
|
||||||
|
{
|
||||||
|
case ColorFormat.A8B8G8R8:
|
||||||
|
return GalImageFormat.RGBA8 | GalImageFormat.Unorm;
|
||||||
|
case ColorFormat.X8B8G8R8:
|
||||||
|
return GalImageFormat.RGBX8 | GalImageFormat.Unorm;
|
||||||
|
case ColorFormat.R5G6B5:
|
||||||
|
return GalImageFormat.RGB565 | GalImageFormat.Unorm;
|
||||||
|
default:
|
||||||
|
throw new NotImplementedException($"Color Format \"{colorFormat}\" not implemented!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: support multi surface
|
// TODO: support multi surface
|
||||||
private void SendFrameBuffer(ServiceCtx context, int slot)
|
private void SendFrameBuffer(ServiceCtx context, int slot)
|
||||||
{
|
{
|
||||||
|
@ -405,6 +420,8 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
||||||
bool flipX = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipX);
|
bool flipX = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipX);
|
||||||
bool flipY = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipY);
|
bool flipY = _bufferQueue[slot].Transform.HasFlag(HalTransform.FlipY);
|
||||||
|
|
||||||
|
GalImageFormat imageFormat = ConvertColorFormat(_bufferQueue[slot].Data.Buffer.Surfaces[0].ColorFormat);
|
||||||
|
|
||||||
//Note: Rotation is being ignored.
|
//Note: Rotation is being ignored.
|
||||||
|
|
||||||
int top = crop.Top;
|
int top = crop.Top;
|
||||||
|
@ -412,6 +429,7 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
||||||
int right = crop.Right;
|
int right = crop.Right;
|
||||||
int bottom = crop.Bottom;
|
int bottom = crop.Bottom;
|
||||||
|
|
||||||
|
|
||||||
NvGpuVmm vmm = NvGpuASIoctl.GetASCtx(context).Vmm;
|
NvGpuVmm vmm = NvGpuASIoctl.GetASCtx(context).Vmm;
|
||||||
|
|
||||||
_renderer.QueueAction(() =>
|
_renderer.QueueAction(() =>
|
||||||
|
@ -422,7 +440,7 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
||||||
fbWidth,
|
fbWidth,
|
||||||
fbHeight, 1, 16,
|
fbHeight, 1, 16,
|
||||||
GalMemoryLayout.BlockLinear,
|
GalMemoryLayout.BlockLinear,
|
||||||
GalImageFormat.RGBA8 | GalImageFormat.Unorm);
|
imageFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.Device.Gpu.ResourceManager.ClearPbCache();
|
context.Device.Gpu.ResourceManager.ClearPbCache();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue