Remove shader from secondary ID2D1DrawTransformMapper APIs
このコミットが含まれているのは:
1 親
9a4af4521f
コミット
2034866db8
4ファイル変更
+12
-28
検索条件に一致するファイルはありません
@@ -43,7 +43,6 @@ public interface ID2D1TransformMapper<T>
|
||||
/// <summary>
|
||||
/// Allows a transform to state how it would map a rectangle requested on its output to a set of sample rectangles on its input.
|
||||
/// </summary>
|
||||
/// <param name="shader">The input D2D1 pixel shader being executed on the current effect (this can be used to retrieve shader properties).</param>
|
||||
/// <param name="output">The output rectangle from which the inputs must be mapped.</param>
|
||||
/// <param name="inputs">The corresponding set of inputs. The inputs will directly correspond to the transform inputs.</param>
|
||||
/// <remarks>
|
||||
@@ -56,12 +55,11 @@ public interface ID2D1TransformMapper<T>
|
||||
/// For more info, see <see href="https://docs.microsoft.com/windows/win32/api/d2d1effectauthor/nf-d2d1effectauthor-id2d1transform-mapoutputrecttoinputrects"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
void MapOutputToInputs(in T shader, in Rectangle output, Span<Rectangle> inputs);
|
||||
void MapOutputToInputs(in Rectangle output, Span<Rectangle> inputs);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the input rectangles for this rendering pass into the transform.
|
||||
/// </summary>
|
||||
/// <param name="shader">The input D2D1 pixel shader being executed on the current effect (this can be used to retrieve shader properties).</param>
|
||||
/// <param name="inputIndex">The index of the input rectangle.</param>
|
||||
/// <param name="invalidInput">The invalid input rectangle.</param>
|
||||
/// <param name="invalidOutput">The output rectangle to which the input rectangle must be mapped.</param>
|
||||
@@ -76,5 +74,5 @@ public interface ID2D1TransformMapper<T>
|
||||
/// For more info, see <see href="https://docs.microsoft.com/windows/win32/api/d2d1effectauthor/nf-d2d1effectauthor-id2d1transform-mapinvalidrect"/>.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
void MapInvalidOutput(in T shader, int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput);
|
||||
void MapInvalidOutput(int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput);
|
||||
}
|
||||
@@ -25,17 +25,15 @@ internal abstract class D2D1TransformMapper
|
||||
out Rectangle opaqueOutput);
|
||||
|
||||
/// <inheritdoc cref="ID2D1TransformMapper{T}.MapOutputToInputs"/>
|
||||
/// <param name="buffer">The buffer with the serialized shader dispatch data, if any.</param>
|
||||
/// <param name="output">The output rectangle from which the inputs must be mapped.</param>
|
||||
/// <param name="inputs">The corresponding set of inputs. The inputs will directly correspond to the transform inputs.</param>
|
||||
public abstract void MapOutputToInputs(ReadOnlySpan<byte> buffer, in Rectangle output, Span<Rectangle> inputs);
|
||||
public abstract void MapOutputToInputs(in Rectangle output, Span<Rectangle> inputs);
|
||||
|
||||
/// <inheritdoc cref="ID2D1TransformMapper{T}.MapInvalidOutput"/>
|
||||
/// <param name="buffer">The buffer with the serialized shader dispatch data, if any.</param>
|
||||
/// <param name="inputIndex">The index of the input rectangle.</param>
|
||||
/// <param name="invalidInput">The invalid input rectangle.</param>
|
||||
/// <param name="invalidOutput">The output rectangle to which the input rectangle must be mapped.</param>
|
||||
public abstract void MapInvalidOutput(ReadOnlySpan<byte> buffer, int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput);
|
||||
public abstract void MapInvalidOutput(int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput);
|
||||
|
||||
/// <summary>
|
||||
/// A generic <see cref="D2D1TransformMapper"/> implementation for a specific shader type.
|
||||
@@ -84,23 +82,15 @@ internal abstract class D2D1TransformMapper
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void MapOutputToInputs(ReadOnlySpan<byte> buffer, in Rectangle output, Span<Rectangle> inputs)
|
||||
public override void MapOutputToInputs(in Rectangle output, Span<Rectangle> inputs)
|
||||
{
|
||||
Unsafe.SkipInit(out T shader);
|
||||
|
||||
shader.InitializeFromDispatchData(buffer);
|
||||
|
||||
this.transformMapper.MapOutputToInputs(in shader, in output, inputs);
|
||||
this.transformMapper.MapOutputToInputs(in output, inputs);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void MapInvalidOutput(ReadOnlySpan<byte> buffer, int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput)
|
||||
public override void MapInvalidOutput(int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput)
|
||||
{
|
||||
Unsafe.SkipInit(out T shader);
|
||||
|
||||
shader.InitializeFromDispatchData(buffer);
|
||||
|
||||
this.transformMapper.MapInvalidOutput(in shader, inputIndex, invalidInput, out invalidOutput);
|
||||
this.transformMapper.MapInvalidOutput(inputIndex, invalidInput, out invalidOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-6
@@ -137,12 +137,10 @@ partial struct PixelShaderEffect
|
||||
inputs[i] = inputRects[i].ToRectangle();
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> buffer = new(@this->constantBuffer, @this->constantBufferSize);
|
||||
|
||||
// Invoke MapOutputToInputs and handle exceptions so they don't cross the ABI boundary
|
||||
try
|
||||
{
|
||||
d2D1TransformMapper.MapOutputToInputs(buffer, in output, inputs);
|
||||
d2D1TransformMapper.MapOutputToInputs(in output, inputs);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -241,12 +239,10 @@ partial struct PixelShaderEffect
|
||||
Rectangle invalidInput = invalidInputRect.ToRectangle();
|
||||
Rectangle invalidOutput;
|
||||
|
||||
ReadOnlySpan<byte> buffer = new(@this->constantBuffer, @this->constantBufferSize);
|
||||
|
||||
// Handle exceptions once again
|
||||
try
|
||||
{
|
||||
d2D1TransformMapper.MapInvalidOutput(buffer, (int)inputIndex, invalidInput, out invalidOutput);
|
||||
d2D1TransformMapper.MapInvalidOutput((int)inputIndex, invalidInput, out invalidOutput);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -13,13 +13,13 @@ public sealed partial class PixelateEffect : ID2D1TransformMapper<PixelateEffect
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void ID2D1TransformMapper<Shader>.MapInvalidOutput(in Shader shader, int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput)
|
||||
void ID2D1TransformMapper<Shader>.MapInvalidOutput(int inputIndex, Rectangle invalidInput, out Rectangle invalidOutput)
|
||||
{
|
||||
invalidOutput = invalidInput;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void ID2D1TransformMapper<Shader>.MapOutputToInputs(in Shader shader, in Rectangle output, Span<Rectangle> inputs)
|
||||
void ID2D1TransformMapper<Shader>.MapOutputToInputs(in Rectangle output, Span<Rectangle> inputs)
|
||||
{
|
||||
inputs.Fill(output);
|
||||
}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする