////////////////////////////////////////////////////////////////////////// // createRenderState bool RsContextNull::createRenderState( RsRenderState* RenderState ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( RenderState ); return true; }
////////////////////////////////////////////////////////////////////////// // destroySamplerState bool RsContextNull::destroySamplerState( RsSamplerState* SamplerState ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( SamplerState ); return true; }
////////////////////////////////////////////////////////////////////////// // destroyBuffer bool RsContextNull::destroyBuffer( class RsBuffer* Buffer ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Buffer ); return true; }
////////////////////////////////////////////////////////////////////////// // destroyTexture bool RsContextNull::destroyTexture( class RsTexture* Texture ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Texture ); return true; }
////////////////////////////////////////////////////////////////////////// // drawPrimitives void RsContextNull::drawPrimitives( RsTopologyType PrimitiveType, BcU32 IndexOffset, BcU32 NoofIndices ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( PrimitiveType ); BcUnusedVar( IndexOffset ); BcUnusedVar( NoofIndices ); }
////////////////////////////////////////////////////////////////////////// // updateTexture bool RsContextNull::updateTexture( class RsTexture* Texture, const struct RsTextureSlice& Slice, RsResourceUpdateFlags Flags, RsTextureUpdateFunc UpdateFunc ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Texture ); BcUnusedVar( Slice ); BcUnusedVar( Flags ); BcUnusedVar( UpdateFunc ); const auto& TextureDesc = Texture->getDesc(); std::unique_ptr< BcU8[] > TempBuffer; BcU32 Width = BcMax( 1, TextureDesc.Width_ >> Slice.Level_ ); BcU32 Height = BcMax( 1, TextureDesc.Height_ >> Slice.Level_ ); BcU32 Depth = BcMax( 1, TextureDesc.Depth_ >> Slice.Level_ ); BcU32 DataSize = RsTextureFormatSize( TextureDesc.Format_, Width, Height, Depth, 1 ); TempBuffer.reset( new BcU8[ DataSize ] ); RsTextureLock Lock = { TempBuffer.get(), TextureDesc.Width_, TextureDesc.Width_ * TextureDesc.Height_ }; UpdateFunc( Texture, Lock ); return true; }
////////////////////////////////////////////////////////////////////////// // setUniformBuffer void RsContextNull::setUniformBuffer( BcU32 Handle, class RsBuffer* UniformBuffer ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Handle ); BcUnusedVar( UniformBuffer ); }
////////////////////////////////////////////////////////////////////////// // setVertexBuffer void RsContextNull::setVertexBuffer( BcU32 StreamIdx, class RsBuffer* VertexBuffer, BcU32 Stride ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( StreamIdx ); BcUnusedVar( VertexBuffer ); BcUnusedVar( Stride ); }
////////////////////////////////////////////////////////////////////////// // clear void RsContextNull::clear( const RsColour& Colour, BcBool EnableClearColour, BcBool EnableClearDepth, BcBool EnableClearStencil ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Colour ); BcUnusedVar( EnableClearColour ); BcUnusedVar( EnableClearDepth ); BcUnusedVar( EnableClearStencil ); }
////////////////////////////////////////////////////////////////////////// // instantEvent //virtual void SysProfilerChromeTracing::instantEvent( const std::string& Tag ) { if( ProfilingActive_ == 1 ) { // New section. TProfilerEvent* Event = allocEvent(); if( Event != nullptr ) { // Setup section. Event->Tag_ = Tag; Event->Type_ = "I"; Event->ThreadId_ = BcCurrentThreadId(); Event->StartTime_ = Timer_.time(); } } }
////////////////////////////////////////////////////////////////////////// // updateBuffer bool RsContextNull::updateBuffer( class RsBuffer* Buffer, BcSize Offset, BcSize Size, RsResourceUpdateFlags Flags, RsBufferUpdateFunc UpdateFunc ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( Buffer ); BcUnusedVar( Offset ); BcUnusedVar( Size ); BcUnusedVar( Flags ); BcUnusedVar( UpdateFunc ); std::unique_ptr< BcU8[] > TempBuffer; TempBuffer.reset( new BcU8[ Buffer->getDesc().SizeBytes_ ] ); RsBufferLock Lock = { TempBuffer.get() }; UpdateFunc( Buffer, Lock ); return true; }
////////////////////////////////////////////////////////////////////////// // invalidateTextureState void RsContextNull::invalidateTextureState() { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // setRenderState void RsContextNull::setRenderState( RsRenderState* RenderState ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // setSamplerState void RsContextNull::setSamplerState( BcU32 Handle, class RsSamplerState* SamplerState ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // setRenderState void RsContextNull::setRenderState( RsRenderStateType State, BcS32 Value, BcBool Force ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // getRenderState BcS32 RsContextNull::getRenderState( RsRenderStateType State ) const { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); return 0; }
////////////////////////////////////////////////////////////////////////// // setFrameBuffer void RsContextNull::setFrameBuffer( class RsFrameBuffer* FrameBuffer ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // create void RsContextNull::create() { // Get owning thread so we can check we are being called // from the appropriate thread later. OwningThread_ = BcCurrentThreadId(); }
void BcSetGameThread() { GMainThreadID = BcCurrentThreadId(); }
////////////////////////////////////////////////////////////////////////// // setProgram void RsContextNull::setProgram( class RsProgram* Program ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // setTexture void RsContextNull::setTexture( BcU32 Handle, RsTexture* pTexture, BcBool Force ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // setSamplerState void RsContextNull::setSamplerState( BcU32 Handle, const RsTextureParams& Params, BcBool Force ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); }
////////////////////////////////////////////////////////////////////////// // BcIsGameThread BcBool BcIsGameThread() { return GMainThreadID == 0 || // Game thread not setup yet (static initialisers) GMainThreadID == BcCurrentThreadId(); // Game thread matches. }
////////////////////////////////////////////////////////////////////////// // setVertexDeclaration void RsContextNull::setVertexDeclaration( class RsVertexDeclaration* VertexDeclaration ) { BcAssertMsg( BcCurrentThreadId() == OwningThread_, "Calling context calls from invalid thread." ); BcUnusedVar( VertexDeclaration ); }