Invalidate ID2D1DrawInfoUpdateContext after use

このコミットが含まれているのは:
Sergio Pedri committed 2022-11-29 22:34:05 +01:00
1 親 8ab0f88d16
コミット 61b392d329
3ファイル変更
+16 -7

検索条件に一致するファイルはありません

+2 -2
ファイルの表示
@@ -77,8 +77,8 @@ namespace ComputeSharp.D2D1.Interop;
/// interface ID2D1ResourceTextureManagerInternal : IUnknown
/// {
/// HRESULT Initialize(
/// [in] ID2D1EffectContext *effectContext,
/// [in, optional] const UINT32 *dimensions);
/// [in] const ID2D1EffectContext *effectContext,
/// [in, optional] const UINT32 *dimensions);
///
/// HRESULT GetResourceTexture([out] ID2D1ResourceTexture **resourceTexture);
/// };
@@ -225,6 +225,9 @@ partial struct PixelShaderEffect
outputRect: outputRect,
outputOpaqueSubRect: outputOpaqueSubRect);
// Regardless of the operation result, always invalidate the context
_ = d2D1DrawInfoUpdateContext.Get()->Close();
if (!Windows.SUCCEEDED(hresult))
{
return hresult;
@@ -8,12 +8,20 @@ using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.In
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMapperManagers;
/// <inheritdoc/>
partial struct D2D1DrawInfoUpdateContextImpl
unsafe partial struct D2D1DrawInfoUpdateContextImpl
{
/// <inheritdoc cref="ID2D1DrawInfoUpdateContexInternal.Close"/>
public int Close()
{
this.d2D1DrawInfo = null;
return S.S_OK;
}
/// <summary>
/// The implementation for <see cref="ID2D1DrawInfoUpdateContexInternal"/>.
/// </summary>
private static unsafe class ID2D1DrawInfoUpdateContexInternalMethods
private static class ID2D1DrawInfoUpdateContexInternalMethods
{
#if !NET6_0_OR_GREATER
/// <inheritdoc cref="Close"/>
@@ -74,9 +82,7 @@ partial struct D2D1DrawInfoUpdateContextImpl
{
@this = (D2D1DrawInfoUpdateContextImpl*)&((void**)@this)[-1];
@this->d2D1DrawInfo = null;
return S.S_OK;
return @this->Close();
}
}
}