From 92ecf571e1a837ba076a555f9b473c134ab8b928 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 19 Oct 2019 12:28:34 -0700 Subject: Fixed Metal backend --- .../include/DeviceContextMtlImpl.h | 8 +++- .../src/DeviceContextMtlImpl.mm | 47 +++++++++++++++++----- 2 files changed, 44 insertions(+), 11 deletions(-) (limited to 'Graphics/GraphicsEngineMetal') diff --git a/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h b/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h index 96b1ca0f..43abc690 100644 --- a/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h +++ b/Graphics/GraphicsEngineMetal/include/DeviceContextMtlImpl.h @@ -87,9 +87,13 @@ public: ITextureView* pDepthStencil, RESOURCE_STATE_TRANSITION_MODE StateTransitionMode)override final; - virtual void Draw(DrawAttribs& DrawAttribs)override final; + virtual void Draw (const DrawAttribs& Attribs)override final; + virtual void DrawIndexed (const DrawIndexedAttribs& Attribs)override final; + virtual void DrawIndirect (const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; + virtual void DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; - virtual void DispatchCompute(const DispatchComputeAttribs& DispatchAttrs)override final; + virtual void DispatchCompute (const DispatchComputeAttribs& Attribs)override final; + virtual void DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer)override final; virtual void ClearDepthStencil(ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, diff --git a/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm b/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm index a104efb2..8edcd8e1 100644 --- a/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm +++ b/Graphics/GraphicsEngineMetal/src/DeviceContextMtlImpl.mm @@ -97,26 +97,55 @@ namespace Diligent } } - void DeviceContextMtlImpl::Draw( DrawAttribs &drawAttribs ) + void DeviceContextMtlImpl::Draw(const DrawAttribs& Attribs) { -#ifdef DEVELOPMENT - if (!DvpVerifyDrawArguments(drawAttribs)) + if (!DvpVerifyDrawArguments(Attribs)) return; -#endif - + LOG_ERROR_MESSAGE("DeviceContextMtlImpl::Draw() is not implemented"); } - void DeviceContextMtlImpl::DispatchCompute( const DispatchComputeAttribs &DispatchAttrs ) + void DeviceContextMtlImpl::DrawIndexed(const DrawIndexedAttribs& Attribs) { -#ifdef DEVELOPMENT - if (!DvpVerifyDispatchArguments(DispatchAttrs)) + if (!DvpVerifyDrawIndexedArguments(Attribs)) return; -#endif + LOG_ERROR_MESSAGE("DeviceContextMtlImpl::DrawIndexed() is not implemented"); + } + + void DeviceContextMtlImpl::DrawIndirect(const DrawIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) + { + if (!DvpVerifyDrawIndirectArguments(Attribs, pAttribsBuffer)) + return; + + + LOG_ERROR_MESSAGE("DeviceContextMtlImpl::DrawIndirect() is not implemented"); + } + + void DeviceContextMtlImpl::DrawIndexedIndirect(const DrawIndexedIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) + { + if (!DvpVerifyDrawIndexedIndirectArguments(Attribs, pAttribsBuffer)) + return; + + LOG_ERROR_MESSAGE("DeviceContextMtlImpl::DrawIndexedIndirect() is not implemented"); + } + + void DeviceContextMtlImpl::DispatchCompute(const DispatchComputeAttribs& Attribs) + { + if (!DvpVerifyDispatchArguments(Attribs)) + return; + LOG_ERROR_MESSAGE("DeviceContextMtlImpl::DispatchCompute() is not implemented"); } + void DeviceContextMtlImpl::DispatchComputeIndirect(const DispatchComputeIndirectAttribs& Attribs, IBuffer* pAttribsBuffer) + { + if (!DvpVerifyDispatchIndirectArguments(Attribs, pAttribsBuffer)) + return; + + LOG_ERROR_MESSAGE("DeviceContextMtlImpl::DispatchComputeIndirect() is not implemented"); + } + void DeviceContextMtlImpl::ClearDepthStencil(ITextureView* pView, CLEAR_DEPTH_STENCIL_FLAGS ClearFlags, float fDepth, -- cgit v1.2.3