diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-05-03 17:17:05 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-05-03 14:17:05 -0700 |
| commit | c216f00f1eaff368229cb8430422972fcac801b7 (patch) | |
| tree | c214700d1cbcdf590b2ecd2f50c9d152169275b8 /tools/render-test/render-gl.cpp | |
| parent | 367f3a78a40731da45ee12b9a18c94707f1d1429 (diff) | |
Fixes based on review of vulkan-first-render PR #545 (#546)
Diffstat (limited to 'tools/render-test/render-gl.cpp')
| -rw-r--r-- | tools/render-test/render-gl.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/render-test/render-gl.cpp b/tools/render-test/render-gl.cpp index f34f9d910..b079d3f10 100644 --- a/tools/render-test/render-gl.cpp +++ b/tools/render-test/render-gl.cpp @@ -262,6 +262,8 @@ public: static void APIENTRY staticDebugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); static VertexAttributeFormat getVertexAttributeFormat(Format format); + static void compileTimeAsserts(); + HDC m_hdc; HGLRC m_glContext; float m_clearColor[4] = { 0, 0, 0, 0 }; @@ -280,7 +282,7 @@ public: MAP_GL_EXTENSION_FUNCS(DECLARE_GL_EXTENSION_FUNC) #undef DECLARE_GL_EXTENSION_FUNC - static const GlPixelFormatInfo s_pixelFormatInfos[int(GlPixelFormat::CountOf)]; + static const GlPixelFormatInfo s_pixelFormatInfos[]; /// Maps GlPixelFormat to a format info }; /* static */GLRenderer::GlPixelFormat GLRenderer::_getGlPixelFormat(Format format) @@ -292,13 +294,18 @@ public: } } -/* static */ const GLRenderer::GlPixelFormatInfo GLRenderer::s_pixelFormatInfos[int(GlPixelFormat::CountOf)] = +/* static */ const GLRenderer::GlPixelFormatInfo GLRenderer::s_pixelFormatInfos[] = { // internalType, format, formatType { 0, 0, 0}, // GlPixelFormat::Unknown { GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE }, // GlPixelFormat::RGBA_Unorm_UInt8 }; +/* static */void GLRenderer::compileTimeAsserts() +{ + SLANG_COMPILE_TIME_ASSERT(SLANG_COUNT_OF(s_pixelFormatInfos) == int(GlPixelFormat::CountOf)); +} + Renderer* createGLRenderer() { return new GLRenderer(); |
