Add locking methods to the ogl resource cache (#238)

* Add locking methods to the ogl resource cache

* Remove some unused arguments

* Add the ZF32 texture format
This commit is contained in:
gdkchan 2018-07-09 23:01:59 -03:00 committed by GitHub
parent 791fe70810
commit 1968386808
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 122 additions and 26 deletions

View file

@ -73,6 +73,8 @@ namespace Ryujinx.HLE.Gpu.Engines
private void VertexEndGl(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
{
LockCaches();
SetFrameBuffer(Vmm, 0);
long[] Keys = UploadShaders(Vmm);
@ -90,6 +92,20 @@ namespace Ryujinx.HLE.Gpu.Engines
UploadTextures(Vmm, Keys);
UploadUniforms(Vmm);
UploadVertexArrays(Vmm);
UnlockCaches();
}
private void LockCaches()
{
Gpu.Renderer.Rasterizer.LockCaches();
Gpu.Renderer.Texture.LockCache();
}
private void UnlockCaches()
{
Gpu.Renderer.Rasterizer.UnlockCaches();
Gpu.Renderer.Texture.UnlockCache();
}
private void ClearBuffers(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)
@ -570,7 +586,7 @@ namespace Ryujinx.HLE.Gpu.Engines
Gpu.Renderer.Rasterizer.CreateIbo(IboKey, Data);
}
Gpu.Renderer.Rasterizer.SetIndexArray(IboKey, IbSize, IndexFormat);
Gpu.Renderer.Rasterizer.SetIndexArray(IbSize, IndexFormat);
}
List<GalVertexAttrib>[] Attribs = new List<GalVertexAttrib>[32];
@ -634,7 +650,7 @@ namespace Ryujinx.HLE.Gpu.Engines
Gpu.Renderer.Rasterizer.CreateVbo(VboKey, Data);
}
Gpu.Renderer.Rasterizer.SetVertexArray(Index, Stride, VboKey, Attribs[Index].ToArray());
Gpu.Renderer.Rasterizer.SetVertexArray(Stride, VboKey, Attribs[Index].ToArray());
}
GalPrimitiveType PrimType = (GalPrimitiveType)(PrimCtrl & 0xffff);