summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-09-30 12:50:30 -0700
committerGitHub <noreply@github.com>2024-09-30 12:50:30 -0700
commit15d1c6c51c5f24663d2567d7e56da62a2bca1c22 (patch)
tree78733e327dca1421f39ecff4073463d74500c14c /include
parentbc11579dd998224bcb429d88aeb07d49e2217a35 (diff)
Add COM API for querying metadata. (#5168)
* Add COM API for querying metadata. * Fix tests. * fix test.
Diffstat (limited to 'include')
-rw-r--r--include/slang.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/slang.h b/include/slang.h
index 8e42632ff..81b3ac1cb 100644
--- a/include/slang.h
+++ b/include/slang.h
@@ -5280,6 +5280,22 @@ namespace slang
#define SLANG_UUID_ISession ISession::getTypeGuid()
+ struct IMetadata : public ISlangCastable
+ {
+ SLANG_COM_INTERFACE(0x8044a8a3, 0xddc0, 0x4b7f, { 0xaf, 0x8e, 0x2, 0x6e, 0x90, 0x5d, 0x73, 0x32 })
+
+ /*
+ Returns whether a resource parameter at the specifieid binding location is actually being used
+ in the compiled shader.
+ */
+ virtual SlangResult isParameterLocationUsed(
+ SlangParameterCategory category, // is this a `t` register? `s` register?
+ SlangUInt spaceIndex, // `space` for D3D12, `set` for Vulkan
+ SlangUInt registerIndex, // `register` for D3D12, `binding` for Vulkan
+ bool& outUsed) = 0;
+ };
+ #define SLANG_UUID_IMetadata IMetadata::getTypeGuid()
+
/** A component type is a unit of shader code layout, reflection, and linking.
A component type is a unit of shader code that can be included into
@@ -5492,6 +5508,17 @@ namespace slang
SlangInt targetIndex,
IBlob** outCode,
IBlob** outDiagnostics = nullptr) = 0;
+
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL getTargetMetadata(
+ SlangInt targetIndex,
+ IMetadata** outMetadata,
+ IBlob** outDiagnostics = nullptr) = 0;
+
+ virtual SLANG_NO_THROW SlangResult SLANG_MCALL getEntryPointMetadata(
+ SlangInt entryPointIndex,
+ SlangInt targetIndex,
+ IMetadata** outMetadata,
+ IBlob** outDiagnostics = nullptr) = 0;
};
#define SLANG_UUID_IComponentType IComponentType::getTypeGuid()