From d5c9bd79e64ddf6854a7f17ae044d8c5968e3b80 Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 1 Oct 2020 01:22:24 -0700 Subject: Metal interface: using id<> instead of void* --- Graphics/GraphicsEngineMetal/interface/BufferMtl.h | 4 ++-- Graphics/GraphicsEngineMetal/interface/PipelineStateMtl.h | 11 +++++++---- Graphics/GraphicsEngineMetal/interface/RenderDeviceMtl.h | 7 +++++-- Graphics/GraphicsEngineMetal/interface/ShaderMtl.h | 2 +- Graphics/GraphicsEngineMetal/interface/TextureMtl.h | 2 +- Graphics/GraphicsEngineMetal/interface/TextureViewMtl.h | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) (limited to 'Graphics/GraphicsEngineMetal') diff --git a/Graphics/GraphicsEngineMetal/interface/BufferMtl.h b/Graphics/GraphicsEngineMetal/interface/BufferMtl.h index 7f4a0a61..d7b2a7fd 100644 --- a/Graphics/GraphicsEngineMetal/interface/BufferMtl.h +++ b/Graphics/GraphicsEngineMetal/interface/BufferMtl.h @@ -41,8 +41,8 @@ static const INTERFACE_ID IID_BufferMtl = class IBufferMtl : public IBuffer { public: - /// Returns a pointer to a Metal buffer (MTLBuffer). - virtual void* GetMtlResource() const = 0; + /// Returns a pointer to a Metal buffer object. + virtual id GetMtlResource() const = 0; }; } // namespace Diligent diff --git a/Graphics/GraphicsEngineMetal/interface/PipelineStateMtl.h b/Graphics/GraphicsEngineMetal/interface/PipelineStateMtl.h index aaea6a0d..a74c86fa 100644 --- a/Graphics/GraphicsEngineMetal/interface/PipelineStateMtl.h +++ b/Graphics/GraphicsEngineMetal/interface/PipelineStateMtl.h @@ -41,11 +41,14 @@ static const INTERFACE_ID IID_PipelineStateMtl = class IPipelineStateMtl : public IPipelineState { public: - /// Returns a pointer to Metal render or compute pipeline (MTLRenderPipelineState or MTLComputePipelineState) - virtual void* GetMtlPipeline() const = 0; + /// Returns a pointer to Metal render pipeline (MTLRenderPipelineState) + virtual id GetMtlRenderPipeline() const = 0; - /// Returns a pointer to Metal depth-stencil state (MTLDepthStencilState) - virtual void* GetMtlDepthStencilState() const = 0; + /// Returns a pointer to Metal compute pipeline (MTLComputePipelineState) + virtual id GetMtlComputePipeline() const = 0; + + /// Returns a pointer to Metal depth-stencil state object (MTLDepthStencilState) + virtual id GetMtlDepthStencilState() const = 0; }; } // namespace Diligent diff --git a/Graphics/GraphicsEngineMetal/interface/RenderDeviceMtl.h b/Graphics/GraphicsEngineMetal/interface/RenderDeviceMtl.h index 11fe4199..5c1d8233 100644 --- a/Graphics/GraphicsEngineMetal/interface/RenderDeviceMtl.h +++ b/Graphics/GraphicsEngineMetal/interface/RenderDeviceMtl.h @@ -41,8 +41,11 @@ static const INTERFACE_ID IID_RenderDeviceMtl = class IRenderDeviceMtl : public IRenderDevice { public: - /// Returns the pointer to MTLDevice object - virtual void* GetMtlDevice() const = 0; + /// Returns the pointer to Metal device (MTLDevice). + virtual id GetMtlDevice() const = 0; + + /// Returns the pointer to Metal command queue (MTLCommandQueue). + virtual id GetMtlCommandQueue() const = 0; }; } // namespace Diligent diff --git a/Graphics/GraphicsEngineMetal/interface/ShaderMtl.h b/Graphics/GraphicsEngineMetal/interface/ShaderMtl.h index 0f3da174..c8f8da84 100644 --- a/Graphics/GraphicsEngineMetal/interface/ShaderMtl.h +++ b/Graphics/GraphicsEngineMetal/interface/ShaderMtl.h @@ -42,7 +42,7 @@ class IShaderMtl : public IShader { public: /// Returns the point to Metal shader function (MTLFunction) - virtual void* GetMtlShaderFunction() const = 0; + virtual id GetMtlShaderFunction() const = 0; }; } // namespace Diligent diff --git a/Graphics/GraphicsEngineMetal/interface/TextureMtl.h b/Graphics/GraphicsEngineMetal/interface/TextureMtl.h index bced9bb7..892ae190 100644 --- a/Graphics/GraphicsEngineMetal/interface/TextureMtl.h +++ b/Graphics/GraphicsEngineMetal/interface/TextureMtl.h @@ -44,7 +44,7 @@ public: /// Returns a pointer to a Metal resource. /// For a staging texture, this will be a pointer to a MTLStorageModeShared buffer (MTLBuffer). /// For all other texture types, this will be a pointer to Metal texture object (MTLTexture). - virtual void* GetMtlResource() const = 0; + virtual id GetMtlResource() const = 0; }; } // namespace Diligent diff --git a/Graphics/GraphicsEngineMetal/interface/TextureViewMtl.h b/Graphics/GraphicsEngineMetal/interface/TextureViewMtl.h index 07453e6d..8b75a074 100644 --- a/Graphics/GraphicsEngineMetal/interface/TextureViewMtl.h +++ b/Graphics/GraphicsEngineMetal/interface/TextureViewMtl.h @@ -42,7 +42,7 @@ class ITextureViewMtl : public ITextureView { public: /// Returns a pointer to Metal texture view (MTLTexture) - virtual void* GetMtlTexture() const = 0; + virtual id GetMtlTexture() const = 0; }; } // namespace Diligent -- cgit v1.2.3