From 8ff7412f988c77f21196b907820b94aa67eb6f21 Mon Sep 17 00:00:00 2001 From: "YONGH\\yongh" Date: Thu, 19 Oct 2017 18:18:21 -0400 Subject: Support running and comparing execution results of compute shaders in testing framework. --- tools/render-test/render.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tools/render-test/render.h') diff --git a/tools/render-test/render.h b/tools/render-test/render.h index afa279c66..7f8f2fffa 100644 --- a/tools/render-test/render.h +++ b/tools/render-test/render.h @@ -20,8 +20,8 @@ struct ShaderCompileRequest struct EntryPoint { - char const* name; - char const* profile; + char const* name = nullptr; + char const* profile = nullptr; SourceInfo source; }; @@ -29,6 +29,7 @@ struct ShaderCompileRequest SourceInfo source; EntryPoint vertexShader; EntryPoint fragmentShader; + EntryPoint computeShader; }; class ShaderCompiler @@ -47,6 +48,7 @@ enum class BufferFlavor { Constant, Vertex, + Storage, }; struct BufferDesc @@ -66,6 +68,8 @@ struct InputElementDesc enum class MapFlavor { + HostRead, + HostWrite, WriteDiscard, }; @@ -108,13 +112,17 @@ public: virtual void setShaderProgram(ShaderProgram* program) = 0; virtual void setConstantBuffers(UInt startSlot, UInt slotCount, Buffer* const* buffers, UInt const* offsets) = 0; - + virtual void setStorageBuffers(UInt startSlot, UInt slotCount, Buffer* const* buffers, UInt const* offsets) = 0; inline void setConstantBuffer(UInt slot, Buffer* buffer, UInt offset = 0) { setConstantBuffers(slot, 1, &buffer, &offset); } - + inline void setStorageBuffer(UInt slot, Buffer* buffer, UInt offset = 0) + { + setStorageBuffers(slot, 1, &buffer, &offset); + } virtual void draw(UInt vertexCount, UInt startVertex = 0) = 0; + virtual void dispatchCompute(int x, int y, int z) = 0; }; } // renderer_test -- cgit v1.2.3