Fix for render target and a shader compilation issue (#471)

* Fix render target using possibly deleted or wrong handles

* Fix basic blocks with only a KIL instruction on the shader translator

* Formatting fix
This commit is contained in:
gdkchan 2018-10-23 17:59:52 -03:00 committed by GitHub
parent 044b84b078
commit 9ace6b9285
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 128 additions and 84 deletions

View file

@ -8,6 +8,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
private OGLCachedResource<ImageHandler> TextureCache;
public EventHandler<int> TextureDeleted { get; set; }
public OGLTexture()
{
TextureCache = new OGLCachedResource<ImageHandler>(DeleteTexture);
@ -23,8 +25,10 @@ namespace Ryujinx.Graphics.Gal.OpenGL
TextureCache.Unlock();
}
private static void DeleteTexture(ImageHandler CachedImage)
private void DeleteTexture(ImageHandler CachedImage)
{
TextureDeleted?.Invoke(this, CachedImage.Handle);
GL.DeleteTexture(CachedImage.Handle);
}