diff options
| author | Yong He <yonghe@outlook.com> | 2021-01-11 09:11:52 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-11 09:11:52 -0800 |
| commit | 5554777188225266e2295db3588f6cb17cae0c4d (patch) | |
| tree | 9d15992cd24d752cde1047745cf75a25e841f494 /tools/gfx/render-graphics-common.h | |
| parent | e24c5a6cb9c3347477b83abe084a09ae8f9fde0a (diff) | |
Make `gfx::Renderer` a COM interface. (#1653)
* Make `gfx::Renderer` a COM interface.
This is a first step towards making the `gfx` library expose a COM compatible DLL interface. Remaining classes will come as separate PRs.
* Fixup project files
* Fix calling conventions
* Make gfx::create*Renderer() functions increase ref count by 1
* Make renderer createFunc return via out parameter
Diffstat (limited to 'tools/gfx/render-graphics-common.h')
| -rw-r--r-- | tools/gfx/render-graphics-common.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/gfx/render-graphics-common.h b/tools/gfx/render-graphics-common.h index 5bb4cb59e..af2677905 100644 --- a/tools/gfx/render-graphics-common.h +++ b/tools/gfx/render-graphics-common.h @@ -5,18 +5,20 @@ namespace gfx { -class GraphicsAPIRenderer : public Renderer +class GraphicsAPIRenderer : public IRenderer, public Slang::RefObject { public: - virtual Result createShaderObjectLayout( + SLANG_REF_OBJECT_IUNKNOWN_ALL + virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObjectLayout( slang::TypeLayoutReflection* typeLayout, ShaderObjectLayout** outLayout) SLANG_OVERRIDE; - virtual Result createRootShaderObjectLayout( + virtual SLANG_NO_THROW Result SLANG_MCALL createRootShaderObjectLayout( slang::ProgramLayout* programLayout, ShaderObjectLayout** outLayout) SLANG_OVERRIDE; - virtual Result createShaderObject(ShaderObjectLayout* layout, ShaderObject** outObject) SLANG_OVERRIDE; - virtual Result createRootShaderObject(ShaderObjectLayout* rootLayout, ShaderObject** outObject) SLANG_OVERRIDE; - virtual Result bindRootShaderObject(PipelineType pipelineType, ShaderObject* object) SLANG_OVERRIDE; + virtual SLANG_NO_THROW Result SLANG_MCALL createShaderObject(ShaderObjectLayout* layout, ShaderObject** outObject) SLANG_OVERRIDE; + virtual SLANG_NO_THROW Result SLANG_MCALL createRootShaderObject(ShaderObjectLayout* rootLayout, ShaderObject** outObject) SLANG_OVERRIDE; + virtual SLANG_NO_THROW Result SLANG_MCALL bindRootShaderObject(PipelineType pipelineType, ShaderObject* object) SLANG_OVERRIDE; void preparePipelineDesc(GraphicsPipelineStateDesc& desc); void preparePipelineDesc(ComputePipelineStateDesc& desc); + IRenderer* getInterface(const Slang::Guid& guid); }; } |
