diff options
| author | Yong He <yonghe@outlook.com> | 2021-04-20 13:17:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-20 13:17:29 -0700 |
| commit | 34fba7b5e726136c6eee8a318ab9a75381399c00 (patch) | |
| tree | 39a496c7052256cef9b089b78ab4bd48316571bd /tools/gfx/d3d11/render-d3d11.cpp | |
| parent | 6bba674f9d732eccc27dcf004611e6a8eb9bc14e (diff) | |
Various fixes to make `model-viewer` example almost working. (#1801)
* Fixing `PseudoPtr` legalization and `gfx` lifetime issues.
* Fixing `model-viewer` example.
This change contains various fixes to bring `model-viewer` example to fully functional. These fixes include:
1. Add `spReflectionTypeLayout_getSubObjectRangeSpaceOffset` function to return the space index for a sub object referenced through a `ParameterBlock` binding.
2. Make sure `D3D12Device` specifies column major matrix order creating a Slang session.
3. Fix `platform::Window::close()` and `platform::Application::quit()`.
4. Fix memory leak during `model-viewer''s model loading.
5. Fix command buffer recording in `model-viewer`.
With these changes, model viewer can now produce an image with a gray cube. The lighting is still incorrect becuase the `gfx` shader object implementation still does not handle "pending layout" resulting from global existential parameters.
* Fix d3d12 root signature creation.
* Use row-major matrix layout in model-viewer
Diffstat (limited to 'tools/gfx/d3d11/render-d3d11.cpp')
| -rw-r--r-- | tools/gfx/d3d11/render-d3d11.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/tools/gfx/d3d11/render-d3d11.cpp b/tools/gfx/d3d11/render-d3d11.cpp index f5dbcc0a7..a011f2760 100644 --- a/tools/gfx/d3d11/render-d3d11.cpp +++ b/tools/gfx/d3d11/render-d3d11.cpp @@ -265,20 +265,9 @@ protected: float m_clearValue[4]; }; - class FramebufferLayoutImpl - : public IFramebufferLayout - , public ComObject + class FramebufferLayoutImpl : public FramebufferLayoutBase { public: - SLANG_COM_OBJECT_IUNKNOWN_ALL - IFramebufferLayout* getInterface(const Guid& guid) - { - if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IFramebufferLayout) - return static_cast<IFramebufferLayout*>(this); - return nullptr; - } - - public: ShortList<IFramebufferLayout::AttachmentLayout> m_renderTargets; bool m_hasDepthStencil = false; IFramebufferLayout::AttachmentLayout m_depthStencil; @@ -345,17 +334,9 @@ protected: } }; - class InputLayoutImpl: public IInputLayout, public ComObject + class InputLayoutImpl: public InputLayoutBase { public: - SLANG_COM_OBJECT_IUNKNOWN_ALL - IInputLayout* getInterface(const Guid& guid) - { - if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IInputLayout) - return static_cast<IInputLayout*>(this); - return nullptr; - } - public: ComPtr<ID3D11InputLayout> m_layout; }; |
