summaryrefslogtreecommitdiff
path: root/slang-gfx.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-05-21 16:38:33 -0700
committerGitHub <noreply@github.com>2021-05-21 16:38:33 -0700
commit7f8a9994d0bd99a171a1daa0bce46d92c02ccffd (patch)
tree0b187e63ab5b9ce6f5ab41266fedaec44091a217 /slang-gfx.h
parent172538fdb418f7a2faab1f5a410f3b2cb8e18ba5 (diff)
[gfx] Support StructuredBuffer<IInterface>. (#1851)
Co-authored-by: T. Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'slang-gfx.h')
-rw-r--r--slang-gfx.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/slang-gfx.h b/slang-gfx.h
index 40cf5fbeb..7428f4c56 100644
--- a/slang-gfx.h
+++ b/slang-gfx.h
@@ -505,6 +505,11 @@ struct ShaderOffset
SlangInt bindingArrayIndex = 0;
};
+enum class ShaderObjectContainerType
+{
+ None, Array, StructuredBuffer
+};
+
class IShaderObject : public ISlangUnknown
{
public:
@@ -516,6 +521,7 @@ public:
}
virtual SLANG_NO_THROW slang::TypeLayoutReflection* SLANG_MCALL getElementTypeLayout() = 0;
+ virtual SLANG_NO_THROW ShaderObjectContainerType SLANG_MCALL getContainerType() = 0;
virtual SLANG_NO_THROW UInt SLANG_MCALL getEntryPointCount() = 0;
ComPtr<IShaderObject> getEntryPoint(UInt index)
@@ -1302,12 +1308,15 @@ public:
return queue;
}
- virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObject(slang::TypeReflection* type, IShaderObject** outObject) = 0;
+ virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObject(
+ slang::TypeReflection* type,
+ ShaderObjectContainerType container,
+ IShaderObject** outObject) = 0;
inline ComPtr<IShaderObject> createShaderObject(slang::TypeReflection* type)
{
ComPtr<IShaderObject> object;
- SLANG_RETURN_NULL_ON_FAIL(createShaderObject(type, object.writeRef()));
+ SLANG_RETURN_NULL_ON_FAIL(createShaderObject(type, ShaderObjectContainerType::None, object.writeRef()));
return object;
}