Skip to content

Commit

Permalink
Metal: add override annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Oct 29, 2024
1 parent edb3d26 commit 18699bf
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 93 deletions.
2 changes: 1 addition & 1 deletion RenderSystems/Metal/include/OgreMetalDepthBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Ogre
virtual ~MetalDepthBuffer();

/// @copydoc DepthBuffer::isCompatible
virtual bool isCompatible( RenderTarget *renderTarget) const;
bool isCompatible( RenderTarget *renderTarget) const override;

MetalDevice* getOwnerDevice(void) const { return mDevice; }

Expand Down
8 changes: 4 additions & 4 deletions RenderSystems/Metal/include/OgreMetalHardwareBufferManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ namespace Ogre {
void _notifyDeviceStalled(void);

/// Creates a vertex buffer
virtual HardwareVertexBufferSharedPtr createVertexBuffer( size_t vertexSize, size_t numVerts,
HardwareVertexBufferSharedPtr createVertexBuffer( size_t vertexSize, size_t numVerts,
HardwareBuffer::Usage usage,
bool useShadowBuffer = false );
bool useShadowBuffer = false ) override;
/// Create an index buffer
virtual HardwareIndexBufferSharedPtr createIndexBuffer(
HardwareIndexBufferSharedPtr createIndexBuffer(
HardwareIndexBuffer::IndexType itype, size_t numIndexes,
HardwareBuffer::Usage usage, bool useShadowBuffer = false );
HardwareBuffer::Usage usage, bool useShadowBuffer = false ) override;
};
}

Expand Down
18 changes: 9 additions & 9 deletions RenderSystems/Metal/include/OgreMetalHardwarePixelBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ namespace Ogre {
{
protected:
/// Lock a box
PixelBox lockImpl(const Box &lockBox, LockOptions options);
PixelBox lockImpl(const Box &lockBox, LockOptions options) override;

/// Unlock a box
void unlockImpl(void);
void unlockImpl(void) override;

// Internal buffer; either on-card or in system memory, freed/allocated on demand
// depending on buffer usage
Expand All @@ -68,10 +68,10 @@ namespace Ogre {
HardwareBuffer::Usage usage );

/// @copydoc HardwarePixelBuffer::blitFromMemory
void blitFromMemory(const PixelBox &src, const Box &dstBox);
void blitFromMemory(const PixelBox &src, const Box &dstBox) override;

/// @copydoc HardwarePixelBuffer::blitToMemory
void blitToMemory(const Box &srcBox, const PixelBox &dst);
void blitToMemory(const Box &srcBox, const PixelBox &dst) override;

virtual ~MetalHardwarePixelBuffer();

Expand All @@ -94,16 +94,16 @@ namespace Ogre {
bool writeGamma, uint fsaa );
virtual ~MetalTextureBuffer();

virtual void bindToFramebuffer(uint32 attachment, size_t zoffset);
void bindToFramebuffer(uint32 attachment, size_t zoffset) override;

/// Upload a box of pixels to this buffer on the card
virtual void upload(const PixelBox &data, const Box &dest);
void upload(const PixelBox &data, const Box &dest) override;

/// Download a box of pixels from the card
virtual void download(const PixelBox &data);
void download(const PixelBox &data) override;

/// Hardware implementation of blitFromMemory
virtual void blitFromMemory(const PixelBox &src_orig, const Box &dstBox);
void blitFromMemory(const PixelBox &src_orig, const Box &dstBox) override;

/// Lock a box
// PixelBox lockImpl(const Box &lockBox, LockOptions options) { return PixelBox(); }
Expand All @@ -113,7 +113,7 @@ namespace Ogre {

/// @copydoc HardwarePixelBuffer::blit
void blit( const HardwarePixelBufferSharedPtr &src,
const Box &srcBox, const Box &dstBox );
const Box &srcBox, const Box &dstBox ) override;
// Blitting implementation
void blitFromTexture( MetalTextureBuffer *src, const Box &srcBox,
const Box &dstBox );
Expand Down
8 changes: 4 additions & 4 deletions RenderSystems/Metal/include/OgreMetalMultiRenderTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ namespace Ogre
virtual ~MetalMultiRenderTarget();

// MultiRenderTarget overloads.
virtual void bindSurfaceImpl( size_t attachment, RenderTexture *target );
virtual void unbindSurfaceImpl( size_t attachment );
void bindSurfaceImpl( size_t attachment, RenderTexture *target ) override;
void unbindSurfaceImpl( size_t attachment ) override;

// RenderTarget overloads.
virtual bool requiresTextureFlipping() const { return false; }
virtual void getCustomAttribute( const String& name, void *pData );
bool requiresTextureFlipping() const override { return false; }
void getCustomAttribute( const String& name, void *pData ) override;
};
}

Expand Down
10 changes: 5 additions & 5 deletions RenderSystems/Metal/include/OgreMetalPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ namespace Ogre


/// @copydoc Plugin::getName
const String& getName() const;
const String& getName() const override;

/// @copydoc Plugin::install
void install();
void install() override;

/// @copydoc Plugin::initialise
void initialise();
void initialise() override;

/// @copydoc Plugin::shutdown
void shutdown();
void shutdown() override;

/// @copydoc Plugin::uninstall
void uninstall();
void uninstall() override;
protected:
MetalRenderSystem* mRenderSystem;
};
Expand Down
16 changes: 8 additions & 8 deletions RenderSystems/Metal/include/OgreMetalProgram.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ namespace Ogre
class CmdShaderReflectionPairHint : public ParamCommand
{
public:
String doGet(const void* target) const;
void doSet(void* target, const String& val);
String doGet(const void* target) const override;
void doSet(void* target, const String& val) override;
};

MetalProgram( ResourceManager* creator, const String& name, ResourceHandle handle,
Expand All @@ -82,9 +82,9 @@ namespace Ogre
const String& getShaderReflectionPairHint(void) const { return mShaderReflectionPairHint; }

/// Overridden from GpuProgram
const String& getLanguage(void) const;
const String& getLanguage(void) const override;
/// Overridden from GpuProgram
GpuProgramParametersSharedPtr createParameters(void);
GpuProgramParametersSharedPtr createParameters(void) override;

/// Retrieve the Metal function object
id<MTLFunction> getMetalFunction(void) const { return mFunction; }
Expand All @@ -106,13 +106,13 @@ namespace Ogre

/** Internal load implementation, must be implemented by subclasses.
*/
void loadFromSource(void);
void loadFromSource(void) override;
/// noop
void createLowLevelImpl(void) {}
void createLowLevelImpl(void) override {}
/// shortcut as we there is no low-level separation here
GpuProgram* _getBindingDelegate(void) { return this; }
GpuProgram* _getBindingDelegate(void) override { return this; }
/// Internal unload implementation, must be implemented by subclasses
void unloadHighLevelImpl(void);
void unloadHighLevelImpl(void) override;

/// Populate the passed parameters with name->index map, must be overridden
void buildConstantDefinitions(void) override;
Expand Down
4 changes: 2 additions & 2 deletions RenderSystems/Metal/include/OgreMetalProgramFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ namespace Ogre
MetalProgramFactory( MetalDevice *device );
virtual ~MetalProgramFactory(void);
/// Get the name of the language this factory creates programs for
const String& getLanguage(void) const;
const String& getLanguage(void) const override;
/// Create an instance of MetalProgram
GpuProgram* create(ResourceManager* creator,
const String& name, ResourceHandle handle,
const String& group, bool isManual, ManualResourceLoader* loader);
const String& group, bool isManual, ManualResourceLoader* loader) override;
};
}

Expand Down
80 changes: 40 additions & 40 deletions RenderSystems/Metal/include/OgreMetalRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,83 +90,83 @@ namespace Ogre
std::unique_ptr<MetalHardwareBufferCommon> mAutoParamsBuffer;
public:
const GpuProgramParametersPtr& getFixedFunctionParams(TrackVertexColourType tracking,
FogMode fog);
void applyFixedFunctionParams(const GpuProgramParametersPtr& params, uint16 mask);
FogMode fog) override;
void applyFixedFunctionParams(const GpuProgramParametersPtr& params, uint16 mask) override;

MetalRenderSystem();
virtual ~MetalRenderSystem();

virtual void shutdown(void);
void shutdown(void) override;

virtual const String& getName(void) const;
virtual void setConfigOption(const String &name, const String &value) {}
const String& getName(void) const override;
void setConfigOption(const String &name, const String &value) override {}

virtual HardwareOcclusionQuery* createHardwareOcclusionQuery(void);
HardwareOcclusionQuery* createHardwareOcclusionQuery(void) override;

virtual RenderSystemCapabilities* createRenderSystemCapabilities(void) const;
RenderSystemCapabilities* createRenderSystemCapabilities(void) const override;

virtual RenderWindow* _createRenderWindow( const String &name,
RenderWindow* _createRenderWindow( const String &name,
unsigned int width, unsigned int height,
bool fullScreen,
const NameValuePairList *miscParams = 0);
const NameValuePairList *miscParams = 0) override;

virtual MultiRenderTarget* createMultiRenderTarget(const String & name);
MultiRenderTarget* createMultiRenderTarget(const String & name) override;

virtual void _setTexture(size_t unit, bool enabled, const TexturePtr& texPtr);
void _setTexture(size_t unit, bool enabled, const TexturePtr& texPtr) override;

virtual DepthBuffer* _createDepthBufferFor( RenderTarget *renderTarget);
DepthBuffer* _createDepthBufferFor( RenderTarget *renderTarget) override;

void setStencilState(const StencilState& state) override;

/// See VaoManager::waitForTailFrameToFinish
virtual void _waitForTailFrameToFinish(void);
virtual bool _willTailFrameStall(void);

virtual void _beginFrame(void);
virtual void _endFrame(void);
void _beginFrame(void) override;
void _endFrame(void) override;

void setScissorTest(bool enabled, const Rect& rect);
void setScissorTest(bool enabled, const Rect& rect) override;

virtual void _setViewport(Viewport *vp);
void _setViewport(Viewport *vp) override;

void setColourBlendState(const ColourBlendState& state);
void setColourBlendState(const ColourBlendState& state) override;

void _setSampler( size_t texUnit, Sampler& s);
void _setDepthClamp(bool enable);
void _setDepthBufferParams(bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL);
void _setSampler( size_t texUnit, Sampler& s) override;
void _setDepthClamp(bool enable) override;
void _setDepthBufferParams(bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL) override;

void _setCullingMode(CullingMode mode);
void _setDepthBias(float constantBias, float slopeScaleBias = 0.0f);
void _setCullingMode(CullingMode mode) override;
void _setDepthBias(float constantBias, float slopeScaleBias = 0.0f) override;

virtual void _convertProjectionMatrix( const Matrix4& matrix, Matrix4& dest,
bool forGpuProgram = false);
void _setPolygonMode(PolygonMode level);
void _setAlphaRejectSettings(CompareFunction func, unsigned char value, bool alphaToCoverage);
virtual void _render( const RenderOperation &op );
void _convertProjectionMatrix( const Matrix4& matrix, Matrix4& dest,
bool forGpuProgram = false) override;
void _setPolygonMode(PolygonMode level) override;
void _setAlphaRejectSettings(CompareFunction func, unsigned char value, bool alphaToCoverage) override;
void _render( const RenderOperation &op ) override;

void bindGpuProgram(GpuProgram* prg);
virtual void bindGpuProgramParameters(GpuProgramType gptype,
const GpuProgramParametersPtr& params, uint16 variabilityMask);
virtual void clearFrameBuffer(unsigned int buffers,
void bindGpuProgram(GpuProgram* prg) override;
void bindGpuProgramParameters(GpuProgramType gptype,
const GpuProgramParametersPtr& params, uint16 variabilityMask) override;
void clearFrameBuffer(unsigned int buffers,
const ColourValue& colour = ColourValue::Black,
float depth = 1.0f, unsigned short stencil = 0);
float depth = 1.0f, unsigned short stencil = 0) override;

virtual Real getMinimumDepthInputValue(void);
virtual Real getMaximumDepthInputValue(void);
Real getMinimumDepthInputValue(void) override;
Real getMaximumDepthInputValue(void) override;

virtual void _setRenderTarget(RenderTarget *target);
void _setRenderTarget(RenderTarget *target) override;

virtual void beginProfileEvent( const String &eventName );
virtual void endProfileEvent( void );
virtual void markProfileEvent( const String &event );
void beginProfileEvent( const String &eventName ) override;
void endProfileEvent( void ) override;
void markProfileEvent( const String &event ) override;

virtual void initGPUProfiling(void);
virtual void deinitGPUProfiling(void);
virtual void beginGPUSampleProfile( const String &name, uint32 *hashCache );
virtual void endGPUSampleProfile( const String &name );

virtual void initialiseFromRenderSystemCapabilities( RenderSystemCapabilities* caps,
RenderTarget* primary );
void initialiseFromRenderSystemCapabilities( RenderSystemCapabilities* caps,
RenderTarget* primary ) override;

MetalDevice* getActiveDevice(void) { return mActiveDevice; }

Expand Down
6 changes: 3 additions & 3 deletions RenderSystems/Metal/include/OgreMetalRenderTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ namespace Ogre
uint32 fsaa, uint32 mip, bool hwGamma );
virtual ~MetalRenderTexture();

virtual void swapBuffers(void);
void swapBuffers(void) override;

// RenderTarget overloads.
virtual bool requiresTextureFlipping() const { return false; }
virtual void getCustomAttribute( const String& name, void* pData );
bool requiresTextureFlipping() const override { return false; }
void getCustomAttribute( const String& name, void* pData ) override;
};
}

Expand Down
22 changes: 11 additions & 11 deletions RenderSystems/Metal/include/OgreMetalRenderWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ namespace Ogre
MetalRenderWindow( MetalDevice *ownerDevice, MetalRenderSystem *renderSystem );
virtual ~MetalRenderWindow();

virtual void swapBuffers(void);
virtual void windowMovedOrResized(void);
void swapBuffers(void) override;
void windowMovedOrResized(void) override;

virtual bool nextDrawable(void);
bool nextDrawable(void) override;

virtual void create( const String& name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams );
virtual void destroy(void);
void create( const String& name, unsigned int width, unsigned int height,
bool fullScreen, const NameValuePairList *miscParams ) override;
void destroy(void) override;

virtual void resize( unsigned int width, unsigned int height );
virtual void reposition( int left, int top );
void resize( unsigned int width, unsigned int height ) override;
void reposition( int left, int top ) override;

// RenderTarget overloads.
virtual void copyContentsToMemory(const Box& src, const PixelBox &dst, FrameBuffer buffer) {}
virtual bool requiresTextureFlipping() const { return false; }
void copyContentsToMemory(const Box& src, const PixelBox &dst, FrameBuffer buffer) override {}
bool requiresTextureFlipping() const override { return false; }

virtual void getCustomAttribute( const String& name, void* pData );
void getCustomAttribute( const String& name, void* pData ) override;

PixelFormat suggestPixelFormat() const override { return mFormat; }

Expand Down
4 changes: 2 additions & 2 deletions RenderSystems/Metal/include/OgreMetalTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ namespace Ogre
void createMetalTexResource(void);
void createSurfaceList(void);

virtual void createInternalResourcesImpl(void);
virtual void freeInternalResourcesImpl(void);
void createInternalResourcesImpl(void) override;
void freeInternalResourcesImpl(void) override;

public:
MetalTexture( ResourceManager* creator, const String& name, ResourceHandle handle,
Expand Down
8 changes: 4 additions & 4 deletions RenderSystems/Metal/include/OgreMetalTextureManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ namespace Ogre
MetalDevice *mDevice;

/// @copydoc ResourceManager::createImpl
virtual Resource* createImpl(const String& name, ResourceHandle handle,
Resource* createImpl(const String& name, ResourceHandle handle,
const String& group, bool isManual, ManualResourceLoader* loader,
const NameValuePairList* createParams);
const NameValuePairList* createParams) override;

SamplerPtr _createSamplerImpl();
SamplerPtr _createSamplerImpl() override;
public:
MetalTextureManager( MetalDevice *device );
virtual ~MetalTextureManager();

/// @copydoc TextureManager::getNativeFormat
virtual PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage);
PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage) override;
};
}

Expand Down

0 comments on commit 18699bf

Please sign in to comment.