From a18f8eba33043dcbc9c5dc142baabae7be760ff7 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 16 Sep 2019 19:48:27 +0200 Subject: [PATCH] Added test for sequential shader compilation --- tests/ComputeSharp.Tests/HlslVectorTypesTests.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/ComputeSharp.Tests/HlslVectorTypesTests.cs b/tests/ComputeSharp.Tests/HlslVectorTypesTests.cs index 4e1cf505..def28124 100644 --- a/tests/ComputeSharp.Tests/HlslVectorTypesTests.cs +++ b/tests/ComputeSharp.Tests/HlslVectorTypesTests.cs @@ -7,6 +7,20 @@ namespace ComputeSharp.Tests [TestCategory("HlslVectorTypes")] public class HlslVectorTypesTests { + [TestMethod] + public void SequentialCompilation() + { + Float2 f2 = new Float2(1, 2); + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); + + Action action1 = id => buffer[0] = f2.YX; + + Action action2 = id => buffer[1] = f2.YX; + + Gpu.Default.For(1, action1); + Gpu.Default.For(1, action2); + } + [TestMethod] public void LocalFloatAssignToFloat2Buffer() {