Skip to content

Commit

Permalink
Add override to NULL RenderSystem classes (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
darksylinc committed Dec 30, 2021
1 parent 6161f67 commit 0b1d728
Show file tree
Hide file tree
Showing 17 changed files with 283 additions and 292 deletions.
17 changes: 9 additions & 8 deletions RenderSystems/NULL/include/OgreNULLAsyncTextureTicket.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,30 @@ THE SOFTWARE.
#define _OgreNULLAsyncTextureTicket_H_

#include "OgreNULLPrerequisites.h"

#include "OgreAsyncTextureTicket.h"
#include "OgreTextureBox.h"

namespace Ogre
{
/** See AsyncTextureTicket
*/
class _OgreNULLExport NULLAsyncTextureTicket : public AsyncTextureTicket
*/
class _OgreNULLExport NULLAsyncTextureTicket final : public AsyncTextureTicket
{
protected:
uint8 *mVboName;
uint8 *mVboName;

virtual TextureBox mapImpl( uint32 slice );
virtual void unmapImpl();
TextureBox mapImpl( uint32 slice ) override;
void unmapImpl() override;

public:
NULLAsyncTextureTicket( uint32 width, uint32 height, uint32 depthOrSlices,
TextureTypes::TextureTypes textureType,
PixelFormatGpu pixelFormatFamily );
virtual ~NULLAsyncTextureTicket();
~NULLAsyncTextureTicket() override;

virtual bool queryIsTransferDone();
bool queryIsTransferDone() override;
};
}
} // namespace Ogre

#endif
20 changes: 10 additions & 10 deletions RenderSystems/NULL/include/OgreNULLPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,35 @@ THE SOFTWARE.
#define __NULLPlugin_H__

#include "OgrePlugin.h"

#include "OgreNULLRenderSystem.h"

namespace Ogre
{

/** Plugin instance for NULL Manager */
class NULLPlugin : public Plugin
class NULLPlugin final : public Plugin
{
public:
NULLPlugin();


/// @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:
NULLRenderSystem* mRenderSystem;
NULLRenderSystem *mRenderSystem;
};
}
} // namespace Ogre

#endif
186 changes: 93 additions & 93 deletions RenderSystems/NULL/include/OgreNULLRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@ namespace Ogre
class HardwareBufferManager;
}

class _OgreNULLExport NULLPixelFormatToShaderType : public PixelFormatToShaderType
class _OgreNULLExport NULLPixelFormatToShaderType final : public PixelFormatToShaderType
{
public:
virtual const char* getPixelFormatType( PixelFormatGpu pixelFormat ) const { return 0; }
virtual const char* getDataType( PixelFormatGpu pixelFormat, uint32 textureType,
bool isMsaa,
ResourceAccess::ResourceAccess access ) const { return 0; }
const char *getPixelFormatType( PixelFormatGpu pixelFormat ) const override { return 0; }
const char *getDataType( PixelFormatGpu pixelFormat, uint32 textureType, bool isMsaa,
ResourceAccess::ResourceAccess access ) const override
{
return 0;
}
};

/**
Implementation of NULL as a rendering system.
*/
class _OgreNULLExport NULLRenderSystem : public RenderSystem
class _OgreNULLExport NULLRenderSystem final : public RenderSystem
{
bool mInitialized;
v1::HardwareBufferManager *mHardwareBufferManager;
Expand All @@ -63,125 +65,123 @@ namespace Ogre

public:
NULLRenderSystem();
virtual ~NULLRenderSystem();
~NULLRenderSystem() override;

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

virtual const String& getName() const;
virtual const String& getFriendlyName() const;
virtual ConfigOptionMap& getConfigOptions() { return mOptions; }
virtual void setConfigOption(const String &name, const String &value) {}
const String &getName() const override;
const String &getFriendlyName() const override;
ConfigOptionMap &getConfigOptions() override { return mOptions; }
void setConfigOption( const String &name, const String &value ) override {}

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

virtual String validateConfigOptions() { return BLANKSTRING; }
String validateConfigOptions() override { return BLANKSTRING; }

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

virtual void reinitialise();
void reinitialise() override;

virtual Window* _initialise( bool autoCreateWindow,
const String& windowTitle = "OGRE Render Window" );
Window *_initialise( bool autoCreateWindow,
const String &windowTitle = "OGRE Render Window" ) override;

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

virtual String getErrorDescription(long errorNumber) const;
String getErrorDescription( long errorNumber ) const override;

virtual void _useLights(const LightList& lights, unsigned short limit);
virtual void _setWorldMatrix(const Matrix4 &m);
virtual void _setViewMatrix(const Matrix4 &m);
virtual void _setProjectionMatrix(const Matrix4 &m);
void _useLights( const LightList &lights, unsigned short limit ) override;
void _setWorldMatrix( const Matrix4 &m ) override;
void _setViewMatrix( const Matrix4 &m ) override;
void _setProjectionMatrix( const Matrix4 &m ) override;

virtual void _setSurfaceParams( const ColourValue &ambient,
const ColourValue &diffuse, const ColourValue &specular,
const ColourValue &emissive, Real shininess,
TrackVertexColourType tracking = TVC_NONE );
virtual void _setPointSpritesEnabled(bool enabled);
virtual void _setPointParameters(Real size, bool attenuationEnabled,
Real constant, Real linear, Real quadratic, Real minSize, Real maxSize);
void _setSurfaceParams( const ColourValue &ambient, const ColourValue &diffuse,
const ColourValue &specular, const ColourValue &emissive, Real shininess,
TrackVertexColourType tracking = TVC_NONE ) override;
void _setPointSpritesEnabled( bool enabled ) override;
void _setPointParameters( Real size, bool attenuationEnabled, Real constant, Real linear,
Real quadratic, Real minSize, Real maxSize ) override;

virtual void _setCurrentDeviceFromTexture( TextureGpu *texture );
virtual void _setTexture( size_t unit, TextureGpu *texPtr, bool bDepthReadOnly );
virtual void _setTextures( uint32 slotStart, const DescriptorSetTexture *set,
uint32 hazardousTexIdx );
virtual void _setTextures( uint32 slotStart, const DescriptorSetTexture2 *set );
virtual void _setSamplers( uint32 slotStart, const DescriptorSetSampler *set );
virtual void _setTexturesCS( uint32 slotStart, const DescriptorSetTexture *set );
virtual void _setTexturesCS( uint32 slotStart, const DescriptorSetTexture2 *set );
virtual void _setSamplersCS( uint32 slotStart, const DescriptorSetSampler *set );
virtual void _setUavCS( uint32 slotStart, const DescriptorSetUav *set );
void _setCurrentDeviceFromTexture( TextureGpu *texture ) override;
void _setTexture( size_t unit, TextureGpu *texPtr, bool bDepthReadOnly ) override;
void _setTextures( uint32 slotStart, const DescriptorSetTexture *set,
uint32 hazardousTexIdx ) override;
void _setTextures( uint32 slotStart, const DescriptorSetTexture2 *set ) override;
void _setSamplers( uint32 slotStart, const DescriptorSetSampler *set ) override;
void _setTexturesCS( uint32 slotStart, const DescriptorSetTexture *set ) override;
void _setTexturesCS( uint32 slotStart, const DescriptorSetTexture2 *set ) override;
void _setSamplersCS( uint32 slotStart, const DescriptorSetSampler *set ) override;
void _setUavCS( uint32 slotStart, const DescriptorSetUav *set ) override;

virtual void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m,
const Frustum* frustum = 0);
virtual void _setTextureBlendMode(size_t unit, const LayerBlendModeEx& bm);
virtual void _setTextureMatrix(size_t unit, const Matrix4& xform);
void _setTextureCoordCalculation( size_t unit, TexCoordCalcMethod m,
const Frustum *frustum = 0 ) override;
void _setTextureBlendMode( size_t unit, const LayerBlendModeEx &bm ) override;
void _setTextureMatrix( size_t unit, const Matrix4 &xform ) override;

virtual void _setIndirectBuffer( IndirectBufferPacked *indirectBuffer );
void _setIndirectBuffer( IndirectBufferPacked *indirectBuffer ) override;

virtual RenderPassDescriptor* createRenderPassDescriptor();
RenderPassDescriptor *createRenderPassDescriptor() override;

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

virtual void _setHlmsSamplerblock( uint8 texUnit, const HlmsSamplerblock *Samplerblock );
virtual void _setPipelineStateObject( const HlmsPso *pso );
virtual void _setComputePso( const HlmsComputePso *pso );
void _setHlmsSamplerblock( uint8 texUnit, const HlmsSamplerblock *Samplerblock ) override;
void _setPipelineStateObject( const HlmsPso *pso ) override;
void _setComputePso( const HlmsComputePso *pso ) override;

virtual VertexElementType getColourVertexElementType() const;
virtual void _convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest) {}
VertexElementType getColourVertexElementType() const override;
void _convertProjectionMatrix( const Matrix4 &matrix, Matrix4 &dest ) override {}

virtual void _dispatch( const HlmsComputePso &pso );
void _dispatch( const HlmsComputePso &pso ) override;

virtual void _setVertexArrayObject( const VertexArrayObject *vao );
void _setVertexArrayObject( const VertexArrayObject *vao ) override;

virtual void _render( const CbDrawCallIndexed *cmd );
virtual void _render( const CbDrawCallStrip *cmd );
virtual void _renderEmulated( const CbDrawCallIndexed *cmd );
virtual void _renderEmulated( const CbDrawCallStrip *cmd );
void _render( const CbDrawCallIndexed *cmd ) override;
void _render( const CbDrawCallStrip *cmd ) override;
void _renderEmulated( const CbDrawCallIndexed *cmd ) override;
void _renderEmulated( const CbDrawCallStrip *cmd ) override;

virtual void _setRenderOperation( const v1::CbRenderOp *cmd );
virtual void _render( const v1::CbDrawCallIndexed *cmd );
virtual void _render( const v1::CbDrawCallStrip *cmd );
void _setRenderOperation( const v1::CbRenderOp *cmd ) override;
void _render( const v1::CbDrawCallIndexed *cmd ) override;
void _render( const v1::CbDrawCallStrip *cmd ) override;

virtual void bindGpuProgramParameters(GpuProgramType gptype,
GpuProgramParametersSharedPtr params, uint16 variabilityMask);
virtual void bindGpuProgramPassIterationParameters(GpuProgramType gptype);
void bindGpuProgramParameters( GpuProgramType gptype, GpuProgramParametersSharedPtr params,
uint16 variabilityMask ) override;
void bindGpuProgramPassIterationParameters( GpuProgramType gptype ) override;

virtual void clearFrameBuffer( RenderPassDescriptor *renderPassDesc,
TextureGpu *anyTarget, uint8 mipLevel );
void clearFrameBuffer( RenderPassDescriptor *renderPassDesc, TextureGpu *anyTarget,
uint8 mipLevel ) override;

virtual Real getHorizontalTexelOffset();
virtual Real getVerticalTexelOffset();
virtual Real getMinimumDepthInputValue();
virtual Real getMaximumDepthInputValue();
Real getHorizontalTexelOffset() override;
Real getVerticalTexelOffset() override;
Real getMinimumDepthInputValue() override;
Real getMaximumDepthInputValue() override;

virtual void preExtraThreadsStarted();
virtual void postExtraThreadsStarted();
virtual void registerThread();
virtual void unregisterThread();
virtual unsigned int getDisplayMonitorCount() const { return 1; }
void preExtraThreadsStarted() override;
void postExtraThreadsStarted() override;
void registerThread() override;
void unregisterThread() override;
unsigned int getDisplayMonitorCount() const override { return 1; }

virtual const PixelFormatToShaderType* getPixelFormatToShaderType() const;
const PixelFormatToShaderType *getPixelFormatToShaderType() const override;

virtual void flushCommands();
void flushCommands() override;

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

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

virtual bool hasAnisotropicMipMapFilter() const { return true; }
bool hasAnisotropicMipMapFilter() const override { return true; }

virtual void setClipPlanesImpl(const PlaneList& clipPlanes);
virtual void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps, Window *primary);
void setClipPlanesImpl( const PlaneList &clipPlanes ) override;
void initialiseFromRenderSystemCapabilities( RenderSystemCapabilities *caps,
Window *primary ) override;
};
}
} // namespace Ogre

#endif
6 changes: 3 additions & 3 deletions RenderSystems/NULL/include/OgreNULLStagingTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ namespace Ogre
void *mMappedPtr;
void *mLastMappedPtr;

virtual bool belongsToUs( const TextureBox &box );
virtual void* RESTRICT_ALIAS_RETURN mapRegionImplRawPtr();
bool belongsToUs( const TextureBox &box ) override;
void* RESTRICT_ALIAS_RETURN mapRegionImplRawPtr() override;

public:
NULLStagingTexture( VaoManager *vaoManager, PixelFormatGpu formatFamily, size_t size );
virtual ~NULLStagingTexture();
~NULLStagingTexture() override;
};
}

Expand Down
33 changes: 16 additions & 17 deletions RenderSystems/NULL/include/OgreNULLTextureGpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,23 @@ namespace Ogre
class _OgreNULLExport NULLTextureGpu : public TextureGpu
{
protected:
virtual void createInternalResourcesImpl();
virtual void destroyInternalResourcesImpl();
void createInternalResourcesImpl() override;
void destroyInternalResourcesImpl() override;

public:
NULLTextureGpu( GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy,
VaoManager *vaoManager, IdString name, uint32 textureFlags,
TextureTypes::TextureTypes initialType,
NULLTextureGpu( GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy, VaoManager *vaoManager,
IdString name, uint32 textureFlags, TextureTypes::TextureTypes initialType,
TextureGpuManager *textureManager );
virtual ~NULLTextureGpu();
~NULLTextureGpu() override;

virtual void getSubsampleLocations( vector<Vector2>::type locations );
virtual void notifyDataIsReady();
void getSubsampleLocations( vector<Vector2>::type locations ) override;
void notifyDataIsReady() override;

virtual void _autogenerateMipmaps(
CopyEncTransitionMode::CopyEncTransitionMode transitionMode = CopyEncTransitionMode::Auto );
virtual void _setToDisplayDummyTexture();
void _autogenerateMipmaps( CopyEncTransitionMode::CopyEncTransitionMode transitionMode =
CopyEncTransitionMode::Auto ) override;
void _setToDisplayDummyTexture() override;

virtual bool _isDataReadyImpl() const;
bool _isDataReadyImpl() const override;
};

class _OgreNULLExport NULLTextureGpuRenderTarget : public NULLTextureGpu
Expand All @@ -79,11 +78,11 @@ namespace Ogre
TextureTypes::TextureTypes initialType,
TextureGpuManager *textureManager );

virtual void _setDepthBufferDefaults( uint16 depthBufferPoolId, bool preferDepthTexture,
PixelFormatGpu desiredDepthBufferFormat );
virtual uint16 getDepthBufferPoolId() const;
virtual bool getPreferDepthTexture() const;
virtual PixelFormatGpu getDesiredDepthBufferFormat() const;
void _setDepthBufferDefaults( uint16 depthBufferPoolId, bool preferDepthTexture,
PixelFormatGpu desiredDepthBufferFormat ) override;
uint16 getDepthBufferPoolId() const override;
bool getPreferDepthTexture() const override;
PixelFormatGpu getDesiredDepthBufferFormat() const override;
};

/** @} */
Expand Down
Loading

0 comments on commit 0b1d728

Please sign in to comment.