summaryrefslogtreecommitdiffstats
path: root/tools/render-test/render.h
diff options
context:
space:
mode:
authorYONGH\yongh <yonghe@outlook.com>2017-10-19 18:18:21 -0400
committerYONGH\yongh <yonghe@outlook.com>2017-10-19 18:18:21 -0400
commit8ff7412f988c77f21196b907820b94aa67eb6f21 (patch)
tree27bea95dec68c42e5d3dd924da0cd8fa74f0d9e4 /tools/render-test/render.h
parent88023aea669f258d66e53eab10215337a7f72853 (diff)
Support running and comparing execution results of compute shaders in testing framework.
Diffstat (limited to 'tools/render-test/render.h')
-rw-r--r--tools/render-test/render.h16
1 files changed, 12 insertions, 4 deletions
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