Skip to content

Commit

Permalink
Apply clang-format to NULL RenderSystem (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
darksylinc committed Dec 30, 2021
1 parent 0b1d728 commit 70c2b4e
Show file tree
Hide file tree
Showing 29 changed files with 467 additions and 649 deletions.
4 changes: 2 additions & 2 deletions RenderSystems/NULL/include/OgreNULLAsyncTextureTicket.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ namespace Ogre
uint8 *mVboName;

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

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

bool queryIsTransferDone() override;
Expand Down
50 changes: 25 additions & 25 deletions RenderSystems/NULL/include/OgreNULLPrerequisites.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,40 @@ namespace Ogre
class NULLStagingBuffer;
class NULLRenderSystem;
class NULLVaoManager;
}
} // namespace Ogre

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#if !defined( __MINGW32__ )
# define WIN32_LEAN_AND_MEAN
# ifndef NOMINMAX
# define NOMINMAX // required to stop windows.h messing up std::min
# endif
#endif
# if !defined( __MINGW32__ )
# define WIN32_LEAN_AND_MEAN
# ifndef NOMINMAX
# define NOMINMAX // required to stop windows.h messing up std::min
# endif
# endif
#endif

// Lots of generated code in here which triggers the new VC CRT security warnings
#if !defined( _CRT_SECURE_NO_DEPRECATE )
#define _CRT_SECURE_NO_DEPRECATE
# define _CRT_SECURE_NO_DEPRECATE
#endif

#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(__MINGW32__) && !defined(OGRE_STATIC_LIB)
# ifdef RenderSystem_NULL_EXPORTS
# define _OgreNULLExport __declspec(dllexport)
# else
# if defined( __MINGW32__ )
# define _OgreNULLExport
# else
# define _OgreNULLExport __declspec(dllimport)
# endif
# endif
#elif defined ( OGRE_GCC_VISIBILITY )
# if !defined( OGRE_STATIC_LIB )
# define _OgreNULLExport __attribute__ ((visibility("default")))
# else
# define _OgreNULLExport __attribute__ ((visibility("hidden")))
# endif
#if( OGRE_PLATFORM == OGRE_PLATFORM_WIN32 ) && !defined( __MINGW32__ ) && !defined( OGRE_STATIC_LIB )
# ifdef RenderSystem_NULL_EXPORTS
# define _OgreNULLExport __declspec( dllexport )
# else
# if defined( __MINGW32__ )
# define _OgreNULLExport
# else
# define _OgreNULLExport __declspec( dllimport )
# endif
# endif
#elif defined( OGRE_GCC_VISIBILITY )
# if !defined( OGRE_STATIC_LIB )
# define _OgreNULLExport __attribute__( ( visibility( "default" ) ) )
# else
# define _OgreNULLExport __attribute__( ( visibility( "hidden" ) ) )
# endif
#else
# define _OgreNULLExport
#endif

#endif //#ifndef _OgreNULLPrerequisites_H_
#endif //#ifndef _OgreNULLPrerequisites_H_
11 changes: 7 additions & 4 deletions RenderSystems/NULL/include/OgreNULLRenderSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ namespace Ogre
class _OgreNULLExport NULLRenderSystem final : public RenderSystem
{
bool mInitialized;

v1::HardwareBufferManager *mHardwareBufferManager;

ConfigOptionMap mOptions;
Expand All @@ -71,8 +72,9 @@ namespace Ogre

const String &getName() const override;
const String &getFriendlyName() const override;

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

HardwareOcclusionQuery *createHardwareOcclusionQuery() override;

Expand All @@ -82,7 +84,7 @@ namespace Ogre

void reinitialise() override;

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

Window *_createRenderWindow( const String &name, uint32 width, uint32 height, bool fullScreen,
Expand Down Expand Up @@ -130,7 +132,7 @@ namespace Ogre
void _setComputePso( const HlmsComputePso *pso ) override;

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

void _dispatch( const HlmsComputePso &pso ) override;

Expand Down Expand Up @@ -161,6 +163,7 @@ namespace Ogre
void postExtraThreadsStarted() override;
void registerThread() override;
void unregisterThread() override;

unsigned int getDisplayMonitorCount() const override { return 1; }

const PixelFormatToShaderType *getPixelFormatToShaderType() const override;
Expand All @@ -180,7 +183,7 @@ namespace Ogre

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

Expand Down
13 changes: 7 additions & 6 deletions RenderSystems/NULL/include/OgreNULLStagingTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ THE SOFTWARE.
#define _OgreNULLStagingTexture_H_

#include "OgreNULLPrerequisites.h"

#include "OgreStagingTextureBufferImpl.h"

#include "OgreHeaderPrefix.h"
Expand All @@ -38,18 +39,18 @@ namespace Ogre
{
class _OgreNULLExport NULLStagingTexture : public StagingTextureBufferImpl
{
uint8 *mDynamicBuffer;
void *mMappedPtr;
void *mLastMappedPtr;
uint8 *mDynamicBuffer;
void * mMappedPtr;
void * mLastMappedPtr;

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

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

#include "OgreHeaderSuffix.h"

Expand Down
27 changes: 14 additions & 13 deletions RenderSystems/NULL/include/OgreNULLTextureGpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ THE SOFTWARE.
#define _OgreNULLTextureGpu_H_

#include "OgreNULLPrerequisites.h"

#include "OgreTextureGpu.h"

#include "OgreHeaderPrefix.h"

namespace Ogre
{
/** \addtogroup Core
* @{
*/
* @{
*/
/** \addtogroup Resources
* @{
*/
* @{
*/

class _OgreNULLExport NULLTextureGpu : public TextureGpu
{
Expand All @@ -68,26 +69,26 @@ namespace Ogre
class _OgreNULLExport NULLTextureGpuRenderTarget : public NULLTextureGpu
{
protected:
uint16 mDepthBufferPoolId;
bool mPreferDepthTexture;
PixelFormatGpu mDesiredDepthBufferFormat;
uint16 mDepthBufferPoolId;
bool mPreferDepthTexture;
PixelFormatGpu mDesiredDepthBufferFormat;

public:
NULLTextureGpuRenderTarget( GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy,
VaoManager *vaoManager, IdString name, uint32 textureFlags,
TextureTypes::TextureTypes initialType,
TextureGpuManager *textureManager );
TextureGpuManager * textureManager );

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

/** @} */
/** @} */
}
} // namespace Ogre

#include "OgreHeaderSuffix.h"

Expand Down
5 changes: 3 additions & 2 deletions RenderSystems/NULL/include/OgreNULLTextureGpuManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ namespace Ogre
TextureGpu *createTextureImpl( GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy,
IdString name, uint32 textureFlags,
TextureTypes::TextureTypes initialType ) override;

StagingTexture *createStagingTextureImpl( uint32 width, uint32 height, uint32 depth,
uint32 slices, PixelFormatGpu pixelFormat ) override;
void destroyStagingTextureImpl( StagingTexture *stagingTexture ) override;
void destroyStagingTextureImpl( StagingTexture *stagingTexture ) override;

AsyncTextureTicket *createAsyncTextureTicketImpl( uint32 width, uint32 height,
uint32 depthOrSlices,
uint32 depthOrSlices,
TextureTypes::TextureTypes textureType,
PixelFormatGpu pixelFormatFamily ) override;

Expand Down
8 changes: 4 additions & 4 deletions RenderSystems/NULL/include/Vao/OgreNULLAsyncTicket.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ namespace Ogre
class _OgreNULLExport NULLAsyncTicket : public AsyncTicket
{
protected:
const void* mapImpl() override;
const void *mapImpl() override;

public:
NULLAsyncTicket( BufferPacked *creator, StagingBuffer *stagingBuffer,
size_t elementStart, size_t elementCount );
NULLAsyncTicket( BufferPacked *creator, StagingBuffer *stagingBuffer, size_t elementStart,
size_t elementCount );
~NULLAsyncTicket() override;

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

#endif
14 changes: 7 additions & 7 deletions RenderSystems/NULL/include/Vao/OgreNULLBufferInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ namespace Ogre
class _OgreNULLExport NULLBufferInterface : public BufferInterface
{
protected:
size_t mVboPoolIdx;
void *mMappedPtr;
size_t mVboPoolIdx;
void * mMappedPtr;

uint8 *mNullDataPtr;
uint8 *mNullDataPtr;

size_t advanceFrame( bool bAdvanceFrame );

public:
NULLBufferInterface( size_t vboPoolIdx );
~NULLBufferInterface();

size_t getVboPoolIndex() { return mVboPoolIdx; }
size_t getVboPoolIndex() { return mVboPoolIdx; }

uint8* getNullDataPtr() { return mNullDataPtr; }
uint8 *getNullDataPtr() { return mNullDataPtr; }

/// will null the data ptr so it wont be freed on destruction
void nullDataPtr() { mNullDataPtr = 0; }
Expand All @@ -64,7 +64,7 @@ namespace Ogre

void *RESTRICT_ALIAS_RETURN map( size_t elementStart, size_t elementCount,
MappingState prevMappingState,
bool advanceFrame = true ) override;
bool advanceFrame = true ) override;

void unmap( UnmapOptions unmapOption, size_t flushStartElem = 0,
size_t flushSizeElem = 0 ) override;
Expand All @@ -76,6 +76,6 @@ namespace Ogre
void copyTo( BufferInterface *dstBuffer, size_t dstOffsetBytes, size_t srcOffsetBytes,
size_t sizeBytes ) override;
};
}
} // namespace Ogre

#endif
10 changes: 5 additions & 5 deletions RenderSystems/NULL/include/Vao/OgreNULLConstBufferPacked.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ THE SOFTWARE.
#define _Ogre_NULLConstBufferPacked_H_

#include "OgreNULLPrerequisites.h"

#include "Vao/OgreConstBufferPacked.h"

namespace Ogre
Expand All @@ -38,10 +39,9 @@ namespace Ogre
{
public:
NULLConstBufferPacked( size_t internalBufferStartBytes, size_t numElements,
uint32 bytesPerElement, uint32 numElementsPadding,
BufferType bufferType, void *initialData, bool keepAsShadow,
VaoManager *vaoManager, BufferInterface *bufferInterface,
size_t bindableSize );
uint32 bytesPerElement, uint32 numElementsPadding, BufferType bufferType,
void *initialData, bool keepAsShadow, VaoManager *vaoManager,
BufferInterface *bufferInterface, size_t bindableSize );
~NULLConstBufferPacked() override;

void bindBufferVS( uint16 slot ) override {}
Expand All @@ -51,6 +51,6 @@ namespace Ogre
void bindBufferDS( uint16 slot ) override {}
void bindBufferCS( uint16 slot ) override {}
};
}
} // namespace Ogre

#endif
14 changes: 7 additions & 7 deletions RenderSystems/NULL/include/Vao/OgreNULLDynamicBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ namespace Ogre

typedef vector<MappedRange>::type MappedRangeVec;

GLuint mVboName;
GLuint mVboSize;
void *mMappedPtr;
GLuint mVboName;
GLuint mVboSize;
void * mMappedPtr;

MappedRangeVec mMappedRanges;
MappedRangeVec mMappedRanges;
vector<size_t>::type mFreeRanges;

BufferType mPersistentMethod;
Expand All @@ -78,10 +78,10 @@ namespace Ogre
BufferType persistentMethod );
~GL3PlusDynamicBuffer();

GLuint getVboName() const { return mVboName; }
GLuint getVboName() const { return mVboName; }

/// Assumes mVboName is already bound to GL_COPY_WRITE_BUFFER!!!
void* RESTRICT_ALIAS_RETURN map( size_t start, size_t count, size_t &outTicket );
void *RESTRICT_ALIAS_RETURN map( size_t start, size_t count, size_t &outTicket );

/// Flushes the region of the given ticket. start is 0-based.
void flush( size_t ticket, size_t start, size_t count );
Expand All @@ -91,6 +91,6 @@ namespace Ogre
/// The ticket becomes invalid after this.
void unmap( size_t ticket );
};
}
} // namespace Ogre

#endif
Loading

0 comments on commit 70c2b4e

Please sign in to comment.