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