/*---------------------------------------------------------------------------* Project: NintendoWare File: ut_CmdCache.h Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo and/or its licensed developers and are protected by national and international copyright laws. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. The content herein is highly confidential and should be handled accordingly. $Revision: 31311 $ *---------------------------------------------------------------------------*/ #ifndef NW_UT_CMDCACHE_H_ #define NW_UT_CMDCACHE_H_ #include #include namespace nw { namespace ut { namespace internal { //! :private //! @brief コマンドキャッシュクラスです。 class CmdCache { public: CmdCache(); void Init( void* buffer, u32 size, bool isCopy = true); void Use() const; void Add( const u32* command, u32 size); void RoundUp(u8 align); void Clear() { m_CmdBufferSize = 0; } void* GetAddr() const { return m_CmdBuffer; } GLsizei GetSize() const { return m_CmdBufferSize; } void Dump( bool asF32 = false, bool showMnemonic = false ) const #if defined(NW_RELEASE) { (void)asF32; (void)showMnemonic; } #else ; #endif static void Dump( const void* from, const void* to, bool asF32 = false, bool showMnemonic = false ) #if defined(NW_RELEASE) { (void)from; (void)to; (void)asF32; (void)showMnemonic; } #else ; #endif private: static void DumpCommon( const void* from, const void* to, bool asF32, bool showMnemonic ); u8* m_CmdBuffer; GLsizei m_CmdBufferSize; GLsizei m_CmdMaxBufferSize; bool m_IsCopy; }; } // namespace internal } // namespace ut } // namespace nw #endif // NW_UT_CMDCACHE_H_