From 5a0224a0773f6d7f5eae8515424af5fa8faa9c14 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 26 Sep 2024 09:44:08 -0700 Subject: Move texture format inference to frontend and add reflection api for it. (#5155) --- include/slang.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/slang.h') diff --git a/include/slang.h b/include/slang.h index 1c05b4c08..8e42632ff 100644 --- a/include/slang.h +++ b/include/slang.h @@ -2433,6 +2433,14 @@ extern "C" SLANG_MODIFIER_INOUT }; + typedef SlangUInt32 SlangImageFormatIntegral; + enum SlangImageFormat : SlangImageFormatIntegral + { +#define SLANG_FORMAT(NAME, DESC) SLANG_IMAGE_FORMAT_##NAME, +#include "slang-image-format-defs.h" +#undef SLANG_FORMAT + }; + // User Attribute SLANG_API char const* spReflectionUserAttribute_GetName(SlangReflectionUserAttribute* attrib); SLANG_API unsigned int spReflectionUserAttribute_GetArgumentCount(SlangReflectionUserAttribute* attrib); @@ -2526,6 +2534,7 @@ extern "C" SLANG_API SlangInt spReflectionTypeLayout_getBindingRangeBindingCount(SlangReflectionTypeLayout* typeLayout, SlangInt index); SLANG_API SlangReflectionTypeLayout* spReflectionTypeLayout_getBindingRangeLeafTypeLayout(SlangReflectionTypeLayout* typeLayout, SlangInt index); SLANG_API SlangReflectionVariable* spReflectionTypeLayout_getBindingRangeLeafVariable(SlangReflectionTypeLayout* typeLayout, SlangInt index); + SLANG_API SlangImageFormat spReflectionTypeLayout_getBindingRangeImageFormat(SlangReflectionTypeLayout* typeLayout, SlangInt index); SLANG_API SlangInt spReflectionTypeLayout_getFieldBindingRangeOffset(SlangReflectionTypeLayout* typeLayout, SlangInt fieldIndex); SLANG_API SlangInt spReflectionTypeLayout_getExplicitCounterBindingRangeOffset(SlangReflectionTypeLayout* inTypeLayout); @@ -3299,6 +3308,12 @@ namespace slang (SlangReflectionTypeLayout*)this, index); } + SlangImageFormat getBindingRangeImageFormat(SlangInt index) + { + return spReflectionTypeLayout_getBindingRangeImageFormat( + (SlangReflectionTypeLayout*)this, index); + } + SlangInt getBindingRangeDescriptorSetIndex(SlangInt index) { return spReflectionTypeLayout_getBindingRangeDescriptorSetIndex( -- cgit v1.2.3