Back to index

nux  3.0.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
nux::RenderingStats Class Reference

#include <RunTimeStats.h>

Collaboration diagram for nux::RenderingStats:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void Register (IOpenGLResource *GraphicsObject)
void UnRegister (IOpenGLResource *GraphicsObject)

Public Attributes

std::vector< int > _texture_2d_array
std::vector< int > _texture_rect_array

Static Public Attributes

static unsigned int m_NumTex2D = 0
static unsigned int m_GPUSizeTex2D = 0
static unsigned int m_NumTexRectangle = 0
static unsigned int m_GPUSizeTexRectangle = 0
static unsigned int m_NumTexCube = 0
static unsigned int m_GPUSizeTexCube = 0
static unsigned int m_NumTexVolume = 0
static unsigned int m_GPUSizeTexVolume = 0
static unsigned int m_NumTexAnimated = 0
static unsigned int m_GPUSizeTexAnimated = 0
static unsigned int m_NumPBO = 0
static unsigned int m_GPUSizePBO = 0
static unsigned int m_NumFrameBufferObject = 0
static unsigned int m_NumQueryObject = 0
static unsigned int m_NumVertexBuffer = 0
static unsigned int m_GPUSizeVertexBuffer = 0
static unsigned int m_NumIndexBuffer = 0
static unsigned int m_GPUSizeIndexBuffer = 0
static unsigned int m_NumVertexShader = 0
static unsigned int m_NumPixelShader = 0
static unsigned int m_NumShaderProgram = 0
static unsigned int m_TotalGPUSize = 0

Private Member Functions

 NUX_DECLARE_GLOBAL_OBJECT (RenderingStats, NuxGraphicsGlobalSingletonInitializer)

Detailed Description

Definition at line 29 of file RunTimeStats.h.


Member Function Documentation

void nux::RenderingStats::Register ( IOpenGLResource GraphicsObject)

Definition at line 97 of file RunTimeStats.cpp.

  {
    switch(GraphicsObject->GetResourceType())
    {
      case RTINDEXBUFFER:
      {
        m_NumIndexBuffer++;
        m_GPUSizeIndexBuffer += NUX_REINTERPRET_CAST(IOpenGLIndexBuffer *, GraphicsObject)->GetSize();
        m_TotalGPUSize += m_GPUSizeIndexBuffer;
        break;
      }
      case RTVERTEXBUFFER:
      {
        m_NumVertexBuffer++;
        m_GPUSizeVertexBuffer += NUX_REINTERPRET_CAST(IOpenGLVertexBuffer *, GraphicsObject)->GetSize();
        m_TotalGPUSize += m_GPUSizeVertexBuffer;
        break;
      }
      case RTTEXTURE:
      {
        int id = NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject)->GetOpenGLID();
        if (id)
          _texture_2d_array.push_back(NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject)->GetOpenGLID());
        m_NumTex2D++;
        m_GPUSizeTex2D += GetTextureSize(NUX_REINTERPRET_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize += m_GPUSizeTex2D;
        break;
      }
      case RTTEXTURERECTANGLE:
      {
        int id = NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject)->GetOpenGLID();
        if (id)
          _texture_rect_array.push_back(NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject)->GetOpenGLID());
        m_NumTexRectangle++;
        m_GPUSizeTexRectangle += GetTextureSize(NUX_REINTERPRET_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize += m_GPUSizeTexRectangle;
        break;
      }
      case RTCUBETEXTURE:
      {
        m_NumTexCube++;
        m_GPUSizeTexCube += GetTextureSize(NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize += m_GPUSizeTexCube;
        break;
      }
      case RTVOLUMETEXTURE:
      {
        m_NumTexVolume++;
        m_GPUSizeTexVolume += GetTextureSize(NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize += m_GPUSizeTexVolume;
        break;
      }
      case RTANIMATEDTEXTURE:
      {
        // Animated texture size is compted as rectangle textures;
        m_NumTexAnimated++;
        break;
      }
      case RTQUERY:
      {
        m_NumQueryObject++;
        break;
      }
      case RTFRAMEBUFFEROBJECT:
      {
        m_NumFrameBufferObject++;
        break;
      }
      default:
        break;
    }

  }

Here is the call graph for this function:

Definition at line 170 of file RunTimeStats.cpp.

  {
    switch(GraphicsObject->GetResourceType())
    {
      case RTINDEXBUFFER:
      {
        m_NumIndexBuffer--;
        m_GPUSizeIndexBuffer -= NUX_REINTERPRET_CAST(IOpenGLIndexBuffer *, GraphicsObject)->GetSize();
        m_TotalGPUSize -= m_GPUSizeIndexBuffer;
        break;
      }
      case RTVERTEXBUFFER:
      {
        m_NumVertexBuffer--;
        m_GPUSizeVertexBuffer -= NUX_REINTERPRET_CAST(IOpenGLVertexBuffer *, GraphicsObject)->GetSize();
        m_TotalGPUSize -= m_GPUSizeVertexBuffer;
        break;
      }
      case RTTEXTURE:
      {
        int id = NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject)->GetOpenGLID();
        _texture_2d_array.erase(std::remove(_texture_2d_array.begin(), _texture_2d_array.end(), id), _texture_2d_array.end());

        m_NumTex2D--;
        m_GPUSizeTex2D -= GetTextureSize(NUX_REINTERPRET_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize -= m_GPUSizeTex2D;
        break;
      }
      case RTTEXTURERECTANGLE:
      {
        int id = NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject)->GetOpenGLID();
        _texture_rect_array.erase(std::remove(_texture_rect_array.begin(), _texture_rect_array.end(), id), _texture_rect_array.end());

        m_NumTexRectangle--;
        m_GPUSizeTexRectangle -= GetTextureSize(NUX_REINTERPRET_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize -= m_GPUSizeTexRectangle;
        break;
      }
      case RTCUBETEXTURE:
      {
        m_NumTexCube--;
        m_GPUSizeTexCube -= GetTextureSize(NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize -= m_GPUSizeTexCube;
        break;
      }
      case RTVOLUMETEXTURE:
      {
        m_NumTexVolume--;
        m_GPUSizeTexVolume -= GetTextureSize(NUX_STATIC_CAST(IOpenGLBaseTexture *, GraphicsObject));
        m_TotalGPUSize -= m_GPUSizeTexVolume;
        break;
      }
      case RTANIMATEDTEXTURE:
      {
        // Animated texture size is compted as rectangle textures;
        m_NumTexAnimated--;
        break;
      }
      case RTQUERY:
      {
        m_NumQueryObject--;
        break;
      }
      case RTFRAMEBUFFEROBJECT:
      {
        m_NumFrameBufferObject--;
        break;
      }
      default:
        break;
    }

  }

Here is the call graph for this function:


Member Data Documentation

Definition at line 65 of file RunTimeStats.h.

Definition at line 66 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizeIndexBuffer = 0 [static]

Definition at line 55 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizePBO = 0 [static]

Definition at line 45 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizeTex2D = 0 [static]

Definition at line 34 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizeTexAnimated = 0 [static]

Definition at line 42 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizeTexCube = 0 [static]

Definition at line 38 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizeTexRectangle = 0 [static]

Definition at line 36 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizeTexVolume = 0 [static]

Definition at line 40 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_GPUSizeVertexBuffer = 0 [static]

Definition at line 52 of file RunTimeStats.h.

Definition at line 47 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumIndexBuffer = 0 [static]

Definition at line 54 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumPBO = 0 [static]

Definition at line 44 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumPixelShader = 0 [static]

Definition at line 58 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumQueryObject = 0 [static]

Definition at line 49 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumShaderProgram = 0 [static]

Definition at line 59 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumTex2D = 0 [static]

Definition at line 33 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumTexAnimated = 0 [static]

Definition at line 41 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumTexCube = 0 [static]

Definition at line 37 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumTexRectangle = 0 [static]

Definition at line 35 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumTexVolume = 0 [static]

Definition at line 39 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumVertexBuffer = 0 [static]

Definition at line 51 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_NumVertexShader = 0 [static]

Definition at line 57 of file RunTimeStats.h.

unsigned int nux::RenderingStats::m_TotalGPUSize = 0 [static]

Definition at line 61 of file RunTimeStats.h.


The documentation for this class was generated from the following files: