mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-27 10:59:24 +01:00
Fix multi-release bug in texturearrayslicer.
This commit is contained in:
parent
9cf7030f87
commit
eff3784a85
1 changed files with 1 additions and 4 deletions
|
|
@ -18,7 +18,7 @@ public sealed unsafe class TextureArraySlicer : IUiService, IDisposable
|
|||
/// <remarks> Caching this across frames will cause a crash to desktop. </remarks>
|
||||
public ImTextureID GetImGuiHandle(Texture* texture, byte sliceIndex)
|
||||
{
|
||||
if (texture == null)
|
||||
if (texture is null)
|
||||
throw new ArgumentNullException(nameof(texture));
|
||||
if (sliceIndex >= texture->ArraySize)
|
||||
throw new ArgumentOutOfRangeException(nameof(sliceIndex),
|
||||
|
|
@ -74,9 +74,6 @@ public sealed unsafe class TextureArraySlicer : IUiService, IDisposable
|
|||
{
|
||||
ID3D11ShaderResourceView* slicedSrv = null;
|
||||
Marshal.ThrowExceptionForHR(device->CreateShaderResourceView(resource, &description, &slicedSrv));
|
||||
resource->Release();
|
||||
device->Release();
|
||||
|
||||
state = new SliceState(slicedSrv);
|
||||
_activeSlices.Add(((nint)texture, sliceIndex), state);
|
||||
return new ImTextureID((nint)state.ShaderResourceView);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue