From 30068d75fb97fecc163253fb331daddbb09234e6 Mon Sep 17 00:00:00 2001 From: Devon Date: Thu, 20 Mar 2025 00:38:52 -0600 Subject: Make image format reflection easier (#6550) * image format json reflection * format code * use direct include --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- source/slang/slang-reflection-json.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-reflection-json.cpp') diff --git a/source/slang/slang-reflection-json.cpp b/source/slang/slang-reflection-json.cpp index 4e8b6b2a4..82e8e1e3f 100644 --- a/source/slang/slang-reflection-json.cpp +++ b/source/slang/slang-reflection-json.cpp @@ -2,6 +2,7 @@ #include "slang-reflection-json.h" #include "../core/slang-blob.h" +#include "slang-ast-support-types.h" template struct Range @@ -237,6 +238,15 @@ static void emitReflectionVarBindingInfoJSON( writer << "\"semanticIndex\": " << int(semanticIndex); } } + + if (auto format = var->getImageFormat()) + { + writer.maybeComma(); + auto formatName = getImageFormatInfo((Slang::ImageFormat)format).name; + writer << "\"format\": \""; + writer << formatName; + writer << "\""; + } } static void emitReflectionNameInfoJSON(PrettyWriter& writer, char const* name) -- cgit v1.2.3