summaryrefslogtreecommitdiffstats
path: root/tools/gfx/renderer-shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/renderer-shared.cpp')
-rw-r--r--tools/gfx/renderer-shared.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp
new file mode 100644
index 000000000..94154bc42
--- /dev/null
+++ b/tools/gfx/renderer-shared.cpp
@@ -0,0 +1,31 @@
+#include "renderer-shared.h"
+#include "render-graphics-common.h"
+
+namespace gfx
+{
+
+IResource* BufferResource::getInterface(const Slang::Guid& guid)
+{
+ if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IResource ||
+ guid == GfxGUID::IID_IBufferResource)
+ return static_cast<IBufferResource*>(this);
+ return nullptr;
+}
+
+SLANG_NO_THROW IResource::Type SLANG_MCALL BufferResource::getType() { return m_type; }
+SLANG_NO_THROW IBufferResource::Desc* SLANG_MCALL BufferResource::getDesc() { return &m_desc; }
+
+
+IResource* TextureResource::getInterface(const Slang::Guid& guid)
+{
+ if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IResource ||
+ guid == GfxGUID::IID_ITextureResource)
+ return static_cast<ITextureResource*>(this);
+ return nullptr;
+}
+
+SLANG_NO_THROW IResource::Type SLANG_MCALL TextureResource::getType() { return m_type; }
+SLANG_NO_THROW ITextureResource::Desc* SLANG_MCALL TextureResource::getDesc() { return &m_desc; }
+
+
+} // namespace gfx