summaryrefslogtreecommitdiffstats
path: root/tools/render-test/render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/render-test/render.cpp')
-rw-r--r--tools/render-test/render.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/render-test/render.cpp b/tools/render-test/render.cpp
index 6c47a5afe..d366413ca 100644
--- a/tools/render-test/render.cpp
+++ b/tools/render-test/render.cpp
@@ -6,7 +6,7 @@
namespace renderer_test {
using namespace Slang;
-/* static */const Resource::BindFlag::Enum Resource::s_requiredBinding[int(Usage::CountOf)] =
+/* static */const Resource::BindFlag::Enum Resource::s_requiredBinding[] =
{
BindFlag::VertexBuffer, // VertexBuffer
BindFlag::IndexBuffer, // IndexBuffer
@@ -21,6 +21,12 @@ using namespace Slang;
BindFlag::Enum(BindFlag::PixelShaderResource | BindFlag::NonPixelShaderResource), // GenericRead
};
+
+/* static */void Resource::compileTimeAsserts()
+{
+ SLANG_COMPILE_TIME_ASSERT(SLANG_COUNT_OF(s_requiredBinding) == int(Usage::CountOf));
+}
+
static const Resource::DescBase s_emptyDescBase = {};
const Resource::DescBase& Resource::getDescBase() const
@@ -38,7 +44,7 @@ const Resource::DescBase& Resource::getDescBase() const
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! RendererUtil !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
-/* static */const uint8_t RendererUtil::s_formatSize[int(Format::CountOf)] =
+/* static */const uint8_t RendererUtil::s_formatSize[] =
{
0, // Unknown,
@@ -53,6 +59,12 @@ const Resource::DescBase& Resource::getDescBase() const
uint8_t(sizeof(uint32_t)), // D_Unorm24_S8,
};
+
+/* static */void RendererUtil::compileTimeAsserts()
+{
+ SLANG_COMPILE_TIME_ASSERT(SLANG_COUNT_OF(s_formatSize) == int(Format::CountOf));
+}
+
/* !!!!!!!!!!!!!!!!!!!!!!!!!!! BindingState::Desc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
void BindingState::Desc::addSampler(const SamplerDesc& desc, const ShaderBindSet& shaderBindSet)