summaryrefslogtreecommitdiff
path: root/tools/slang-reflection-test/slang-reflection-test-main.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-08-24 13:09:07 -0400
committerGitHub <noreply@github.com>2022-08-24 10:09:07 -0700
commit0b808453407f8feef8574cae99afd90771712185 (patch)
tree01698f8a4354d836205731762619e5b4205d31e7 /tools/slang-reflection-test/slang-reflection-test-main.cpp
parentf5755019246504ad4da4614d1e34a00d74970ea7 (diff)
Use enums with backing types in Slang API (#2375)
* #include an absolute path didn't work - because paths were taken to always be relative. * Use enum types and specify backing rather than use typedefs so as to get enum type safety. * Add version of TextureFlavor that uses internal types. Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/slang-reflection-test/slang-reflection-test-main.cpp')
-rw-r--r--tools/slang-reflection-test/slang-reflection-test-main.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/slang-reflection-test/slang-reflection-test-main.cpp b/tools/slang-reflection-test/slang-reflection-test-main.cpp
index 34fef404e..2aabf9ca2 100644
--- a/tools/slang-reflection-test/slang-reflection-test-main.cpp
+++ b/tools/slang-reflection-test/slang-reflection-test-main.cpp
@@ -318,7 +318,7 @@ static void emitReflectionVarBindingInfoJSON(
for(uint32_t cc = 0; cc < categoryCount; ++cc )
{
- auto category = var->getCategoryByIndex(cc);
+ auto category = SlangParameterCategory(var->getCategoryByIndex(cc));
auto index = var->getOffset(category);
auto space = var->getBindingSpace(category);
auto count = typeLayout->getSize(category);
@@ -676,7 +676,7 @@ static void emitReflectionTypeInfoJSON(
comma(writer);
emitReflectionScalarTypeInfoJSON(
writer,
- type->getScalarType());
+ SlangScalarType(type->getScalarType()));
break;
case slang::TypeReflection::Kind::Vector:
@@ -1364,7 +1364,8 @@ SLANG_TEST_TOOL_API SlangResult innerMain(Slang::StdWriters* stdWriters, SlangSe
SlangCompileRequest* request = spCreateCompileRequest(session);
for (int i = 0; i < SLANG_WRITER_CHANNEL_COUNT_OF; ++i)
{
- spSetWriter(request, SlangWriterChannel(i), stdWriters->getWriter(i));
+ const auto channel = SlangWriterChannel(i);
+ spSetWriter(request, channel, stdWriters->getWriter(channel));
}
char const* appName = "slang-reflection-test";