Add IPostProcessWorldShader for custom effect render passes.

This commit is contained in:
Paul Chote
2023-10-22 16:58:58 +01:00
committed by Gustas
parent b1f5367822
commit 47af7a9023
10 changed files with 174 additions and 2 deletions

View File

@@ -648,6 +648,7 @@ namespace OpenRA.Platforms.Default
readonly Func<object, object> setData2;
readonly Action<object> setData3;
readonly Func<object, object> setData4;
readonly Action<object> setData5;
readonly Action dispose;
public ThreadedTexture(ThreadedGraphicsContext device, ITextureInternal texture)
@@ -663,6 +664,7 @@ namespace OpenRA.Platforms.Default
setData2 = tuple => { setData1(tuple); return null; };
setData3 = tuple => { var t = ((float[], int, int))tuple; texture.SetFloatData(t.Item1, t.Item2, t.Item3); };
setData4 = tuple => { setData3(tuple); return null; };
setData5 = rect => texture.SetDataFromReadBuffer((Rectangle)rect);
dispose = texture.Dispose;
}
@@ -725,6 +727,11 @@ namespace OpenRA.Platforms.Default
}
}
public void SetDataFromReadBuffer(Rectangle rect)
{
device.Post(setData5, rect);
}
public void Dispose()
{
device.Post(dispose);