summaryrefslogtreecommitdiff
path: root/tools/gfx/render.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-09-13 15:59:15 -0400
committerGitHub <noreply@github.com>2019-09-13 15:59:15 -0400
commitc2e5d2468ad6a38cdb8a067da0678302f6cc6066 (patch)
tree97c448d28e54068d84c422e9f172996b7a95f1ed /tools/gfx/render.h
parent0b6321b3f08c48e37e6b8256d420f05d9727fb5a (diff)
Refactor render-test to make cross platform (#1053)
* First pass of render-test refactor. * Make window construction a function that can choose an implementation. * Remove OpenGL as currently has windows dependency. * Disable Vulkan as Renderer impl has dependency on windows. * Pass Window in as parameter of 'update'. * Add win-window.cpp as was missing. * Fix warning on windows about signs during comparison.
Diffstat (limited to 'tools/gfx/render.h')
-rw-r--r--tools/gfx/render.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/gfx/render.h b/tools/gfx/render.h
index 4a8458e96..42cf5fe60 100644
--- a/tools/gfx/render.h
+++ b/tools/gfx/render.h
@@ -972,6 +972,8 @@ inline void Renderer::setVertexBuffer(UInt slot, BufferResource* buffer, UInt st
/// Functions that are around Renderer and it's types
struct RendererUtil
{
+ typedef Renderer* (*CreateFunc)();
+
/// Gets the size in bytes of a Format type. Returns 0 if a size is not defined/invalid
SLANG_FORCE_INLINE static size_t getFormatSize(Format format) { return s_formatSize[int(format)]; }
/// Given a renderer type, gets a projection style
@@ -986,6 +988,9 @@ struct RendererUtil
/// Get as text
static Slang::UnownedStringSlice toText(RendererType type);
+ /// Given a type returns a function that can construct it, or nullptr if there isn't one
+ static CreateFunc getCreateFunc(RendererType type);
+
private:
static void compileTimeAsserts();
static const uint8_t s_formatSize[]; // Maps Format::XXX to a size in bytes;