summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/options.cpp6
-rw-r--r--tools/render-test/shader-input-layout.cpp21
-rw-r--r--tools/render-test/shader-input-layout.h1
3 files changed, 25 insertions, 3 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index fb433048c..6591941e8 100644
--- a/tools/render-test/options.cpp
+++ b/tools/render-test/options.cpp
@@ -11,7 +11,9 @@
#include "../../source/core/slang-list.h"
#include "../../source/core/slang-string-util.h"
-#include "../../source/core/slang-downstream-compiler.h"
+//#include "../../source/core/slang-downstream-compiler.h"
+
+#include "../../source/core/slang-type-text-util.h"
namespace renderer_test {
using namespace Slang;
@@ -226,7 +228,7 @@ SlangResult parseOptions(int argc, const char*const* argv, Slang::WriterHelper s
}
UnownedStringSlice sourceLanguageText(*argCursor++);
- SlangSourceLanguage sourceLanguage = DownstreamCompiler::getSourceLanguageFromName(sourceLanguageText);
+ SlangSourceLanguage sourceLanguage = TypeTextUtil::asSourceLanguage(sourceLanguageText);
if (sourceLanguage == SLANG_SOURCE_LANGUAGE_UNKNOWN)
{
stdError.print("error: expecting unknown source language name '%s' for '%s'\n", String(sourceLanguageText).getBuffer(), arg);
diff --git a/tools/render-test/shader-input-layout.cpp b/tools/render-test/shader-input-layout.cpp
index 44021c08a..40502a9ec 100644
--- a/tools/render-test/shader-input-layout.cpp
+++ b/tools/render-test/shader-input-layout.cpp
@@ -3,6 +3,7 @@
#include "shader-input-layout.h"
#include "core/slang-token-reader.h"
+#include "core/slang-type-text-util.h"
#include "render.h"
@@ -755,6 +756,14 @@ namespace renderer_test
scalarType = elementTypeLayout->getScalarType();
}
+ if (scalarType != ScalarType::None && scalarType != ScalarType::Void)
+ {
+ UnownedStringSlice text = TypeTextUtil::asText(scalarType);
+ // Write out the type
+ writer.put("type: ");
+ writer.put(text);
+ writer.put("\n");
+ }
switch (scalarType)
{
@@ -765,7 +774,6 @@ namespace renderer_test
case ScalarType::None:
case ScalarType::Void:
case ScalarType::Bool:
- case ScalarType::Float16:
{
auto ptr = (const uint32_t*)data;
const size_t size = sizeInBytes / sizeof(ptr[0]);
@@ -776,6 +784,17 @@ namespace renderer_test
}
break;
}
+ case ScalarType::Float16:
+ {
+ auto ptr = (const uint16_t*)data;
+ const size_t size = sizeInBytes / sizeof(ptr[0]);
+ for (size_t i = 0; i < size; ++i)
+ {
+ const float v = HalfToFloat(ptr[i]);
+ writer.print("%f\n", v);
+ }
+ break;
+ }
case ScalarType::UInt32:
{
auto ptr = (const uint32_t*)data;
diff --git a/tools/render-test/shader-input-layout.h b/tools/render-test/shader-input-layout.h
index 5b0527e0f..504b714c5 100644
--- a/tools/render-test/shader-input-layout.h
+++ b/tools/render-test/shader-input-layout.h
@@ -6,6 +6,7 @@
#include "core/slang-writer.h"
+
#include "bind-location.h"
#include "render.h"