Updated shader runner to support new bounds checking

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-17 00:25:08 +02:00
1 親 ac2b962c98
コミット c858b67c83
2ファイル変更
+15 -11

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

+8 -3
ファイルの表示
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using ComputeSharp.Graphics;
using ComputeSharp.Graphics.Buffers;
using ComputeSharp.Graphics.Buffers.Abstract;
using ComputeSharp.Graphics.Buffers.Extensions;
using ComputeSharp.Shaders.Renderer;
@@ -66,9 +67,7 @@ namespace ComputeSharp.Shaders
ShaderInfo shaderInfo = new ShaderInfo
{
FieldsList = shaderLoader.FieldsInfo,
ThreadsX = x,
ThreadsY = y,
ThreadsZ = z,
ThreadsXYZConstantBufferIndex = shaderLoader.ConstantBuffersCount,
NumThreadsX = threadsX,
NumThreadsY = threadsY,
NumThreadsZ = threadsZ,
@@ -104,6 +103,12 @@ namespace ComputeSharp.Shaders
buffers.Add(resource);
}
// Initialize the loop targets
Span<uint> xyzSpan = stackalloc uint[] { (uint)x, (uint)y, (uint)z };
ConstantBuffer<uint> xyzBuffer = device.AllocateConstantBuffer(xyzSpan);
commandList.SetComputeRootDescriptorTable(shaderLoader.RootParameters.Length - 1, xyzBuffer);
buffers.Add(xyzBuffer);
// Dispatch and wait for completion
commandList.Dispatch(groupsX, groupsY, groupsZ);
commandList.Flush();