Only use persistent buffers to flush on NVIDIA and Windows+AMD (#2489)
It seems like this method of flushing data is much slower on Mesa drivers, and slightly slower on Intel Windows. Have not tested Intel Mesa, but I'm assuming it is the same as AMD. This also adds vendor detection for AMD on Unix, which counted as "Unknown" before.
This commit is contained in:
parent
b8ad676fb8
commit
10e17ab423
4 changed files with 48 additions and 14 deletions
|
@ -121,7 +121,31 @@ namespace Ryujinx.Graphics.OpenGL.Image
|
|||
|
||||
public byte[] GetData()
|
||||
{
|
||||
return _renderer.PersistentBuffers.Default.GetTextureData(this);
|
||||
int size = 0;
|
||||
|
||||
for (int level = 0; level < Info.Levels; level++)
|
||||
{
|
||||
size += Info.GetMipSize(level);
|
||||
}
|
||||
|
||||
if (HwCapabilities.UsePersistentBufferForFlush)
|
||||
{
|
||||
return _renderer.PersistentBuffers.Default.GetTextureData(this, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] data = new byte[size];
|
||||
|
||||
unsafe
|
||||
{
|
||||
fixed (byte* ptr = data)
|
||||
{
|
||||
WriteTo((IntPtr)ptr);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteToPbo(int offset, bool forceBgra)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue