From 3b1187398f3410b0ec82d3fbd8ce564ace4d02f7 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Sun, 17 Oct 2021 16:19:54 +0100 Subject: [PATCH] [Metal] implement override for MetalTextureGpu::getCustomAttribute - Implement method getCustomAttribute for MetalTextureGpu - The caller takes ownership of the object via CFBridgingRetain. Signed-off-by: Rhys Mainwaring --- RenderSystems/Metal/include/OgreMetalTextureGpu.h | 2 ++ RenderSystems/Metal/src/OgreMetalTextureGpu.mm | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/RenderSystems/Metal/include/OgreMetalTextureGpu.h b/RenderSystems/Metal/include/OgreMetalTextureGpu.h index 86381fa355a..ffc43f25f93 100644 --- a/RenderSystems/Metal/include/OgreMetalTextureGpu.h +++ b/RenderSystems/Metal/include/OgreMetalTextureGpu.h @@ -106,6 +106,8 @@ namespace Ogre id getDisplayTextureName(void) const { return mDisplayTextureName; } id getFinalTextureName(void) const { return mFinalTextureName; } id getMsaaFramebufferName(void) const { return mMsaaFramebufferName; } + + virtual void getCustomAttribute( IdString name, void *pData ) override; }; class _OgreMetalExport MetalTextureGpuRenderTarget : public MetalTextureGpu diff --git a/RenderSystems/Metal/src/OgreMetalTextureGpu.mm b/RenderSystems/Metal/src/OgreMetalTextureGpu.mm index f587faac229..7eb57a5e589 100644 --- a/RenderSystems/Metal/src/OgreMetalTextureGpu.mm +++ b/RenderSystems/Metal/src/OgreMetalTextureGpu.mm @@ -398,6 +398,20 @@ of this software and associated documentation files (the "Software"), to deal //TODO } } + + //----------------------------------------------------------------------------------- + void MetalTextureGpu::getCustomAttribute( IdString name, void *pData ) + { + if( name == msFinalTextureBuffer ) + { + *static_cast(pData) = (void*)CFBridgingRetain(mFinalTextureName); + } + else if( name == msMsaaTextureBuffer ) + { + *static_cast(pData) = (void*)CFBridgingRetain(mMsaaFramebufferName); + } + } + //----------------------------------------------------------------------------------- //----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------