Skip to content

Commit

Permalink
[Metal] implement override for MetalTextureGpu::getCustomAttribute
Browse files Browse the repository at this point in the history
- Implement method getCustomAttribute for MetalTextureGpu
- The caller takes ownership of the object via CFBridgingRetain.

Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring authored and darksylinc committed Oct 20, 2021
1 parent da8ca4e commit b7187a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RenderSystems/Metal/include/OgreMetalTextureGpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ namespace Ogre
id<MTLTexture> getDisplayTextureName(void) const { return mDisplayTextureName; }
id<MTLTexture> getFinalTextureName(void) const { return mFinalTextureName; }
id<MTLTexture> getMsaaFramebufferName(void) const { return mMsaaFramebufferName; }

virtual void getCustomAttribute( IdString name, void *pData ) override;
};

class _OgreMetalExport MetalTextureGpuRenderTarget : public MetalTextureGpu
Expand Down
14 changes: 14 additions & 0 deletions RenderSystems/Metal/src/OgreMetalTextureGpu.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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<void**>(pData) = (void*)CFBridgingRetain(mFinalTextureName);
}
else if( name == msMsaaTextureBuffer )
{
*static_cast<void**>(pData) = (void*)CFBridgingRetain(mMsaaFramebufferName);
}
}

//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
Expand Down

0 comments on commit b7187a5

Please sign in to comment.