| 
    KiCad PCB EDA Suite
    
   | 
 
#include <gpu_manager.h>
  
Classes | |
| struct | VRANGE | 
Public Member Functions | |
| GPU_CACHED_MANAGER (VERTEX_CONTAINER *aContainer) | |
| ~GPU_CACHED_MANAGER () | |
| Prepare the stored data to be drawn.      | |
| virtual void | BeginDrawing () override | 
| Make the GPU draw given range of vertices.      | |
| virtual void | DrawIndices (const VERTEX_ITEM *aItem) override | 
| Clear the container after drawing routines.      | |
| virtual void | EndDrawing () override | 
| Map vertex buffer stored in GPU memory.   | |
| void | Map () | 
| Unmap vertex buffer.   | |
| void | Unmap () | 
| virtual void | SetShader (SHADER &aShader) | 
| Allow using shaders with the stored data.   | |
| void | EnableDepthTest (bool aEnabled) | 
| Enable/disable Z buffer depth test.   | |
Static Public Member Functions | |
| static GPU_MANAGER * | MakeManager (VERTEX_CONTAINER *aContainer) | 
Protected Member Functions | |
| void | resizeIndices (unsigned int aNewSize) | 
| < Resizes the indices buffer to aNewSize if necessary   | |
Protected Attributes | |
| bool | m_buffersInitialized | 
| Pointer to the current indices buffer.   | |
| boost::scoped_array< GLuint > | m_indices | 
| Current indices buffer size.   | |
| unsigned int | m_indicesCapacity | 
| Ranges of visible vertex indices to render.   | |
| std::vector< VRANGE > | m_vranges | 
| Number of huge VRANGEs (i.e. large zones) with separate draw calls.   | |
| int | m_totalHuge | 
| Number of regular VRANGEs (small items) pooled into single draw call.   | |
| int | m_totalNormal | 
| Current size of index buffer.   | |
| unsigned int | m_indexBufSize | 
| Maximum size taken by the index buffer for all frames rendered so far.   | |
| unsigned int | m_indexBufMaxSize | 
| Size of the current VRANGE.   | |
| unsigned int | m_curVrangeSize | 
| bool | m_isDrawing | 
| Container that stores vertices data.   | |
| VERTEX_CONTAINER * | m_container | 
| Shader handling.   | |
| SHADER * | m_shader | 
| Location of shader attributes (for glVertexAttribPointer)   | |
| int | m_shaderAttrib | 
| true: enable Z test when drawing   | |
| bool | m_enableDepthTest | 
Definition at line 102 of file gpu_manager.h.
| GPU_CACHED_MANAGER::GPU_CACHED_MANAGER | ( | VERTEX_CONTAINER * | aContainer | ) | 
Definition at line 85 of file gpu_manager.cpp.
References KIGFX::GPU_MANAGER::GPU_MANAGER(), m_buffersInitialized, m_curVrangeSize, m_indexBufMaxSize, m_indexBufSize, m_indicesCapacity, m_totalHuge, and m_totalNormal.
| GPU_CACHED_MANAGER::~GPU_CACHED_MANAGER | ( | ) | 
Prepare the stored data to be drawn.
Definition at line 98 of file gpu_manager.cpp.
      
  | 
  overridevirtual | 
Make the GPU draw given range of vertices.
| aOffset | is the beginning of the range. | 
| aSize | is the number of vertices to be drawn. | 
Implements KIGFX::GPU_MANAGER.
Definition at line 103 of file gpu_manager.cpp.
References m_curVrangeSize, m_indexBufMaxSize, m_indexBufSize, KIGFX::GPU_MANAGER::m_isDrawing, and m_vranges.
      
  | 
  overridevirtual | 
Clear the container after drawing routines.
Implements KIGFX::GPU_MANAGER.
Definition at line 116 of file gpu_manager.cpp.
References KIGFX::VERTEX_ITEM::GetOffset(), KIGFX::VERTEX_ITEM::GetSize(), m_curVrangeSize, m_indexBufSize, KIGFX::GPU_MANAGER::m_isDrawing, m_totalHuge, m_totalNormal, and m_vranges.
      
  | 
  inherited | 
Enable/disable Z buffer depth test.
Definition at line 337 of file gpu_manager.cpp.
References m_enableDepthTest.
      
  | 
  overridevirtual | 
Map vertex buffer stored in GPU memory.
Implements KIGFX::GPU_MANAGER.
Definition at line 143 of file gpu_manager.cpp.
References KIGFX::CACHED_CONTAINER::AllItemsSize(), KIGFX::VERTEX_CONTAINER::ClearDirty(), KIGFX::COLOR_OFFSET, KIGFX::COLOR_STRIDE, KIGFX::COORD_OFFSET, KIGFX::COORD_STRIDE, KIGFX::CACHED_CONTAINER::GetBufferHandle(), KIGFX::CACHED_CONTAINER::IsMapped(), KI_TRACE, KIGFX::GPU_MANAGER::m_container, m_curVrangeSize, KIGFX::GPU_MANAGER::m_enableDepthTest, KIGFX::GPU_CACHED_MANAGER::VRANGE::m_end, m_indexBufMaxSize, m_indexBufSize, m_indices, KIGFX::GPU_CACHED_MANAGER::VRANGE::m_isContinuous, KIGFX::GPU_MANAGER::m_isDrawing, KIGFX::GPU_MANAGER::m_shader, KIGFX::GPU_MANAGER::m_shaderAttrib, KIGFX::GPU_CACHED_MANAGER::VRANGE::m_start, m_vranges, resizeIndices(), KIGFX::SHADER_OFFSET, KIGFX::SHADER_STRIDE, PROF_TIMER::Stop(), PROF_TIMER::to_string(), traceGalProfile, KIGFX::CACHED_CONTAINER::Unmap(), and KIGFX::VERTEX_SIZE.
      
  | 
  staticinherited | 
Definition at line 48 of file gpu_manager.cpp.
References GPU_MANAGER(), and KIGFX::VERTEX_CONTAINER::IsCached().
Referenced by KIGFX::VERTEX_MANAGER::VERTEX_MANAGER().
| void KIGFX::GPU_CACHED_MANAGER::Map | ( | ) | 
Unmap vertex buffer.
      
  | 
  protected | 
< Resizes the indices buffer to aNewSize if necessary
Buffers initialization flag
Definition at line 248 of file gpu_manager.cpp.
References m_indices, and m_indicesCapacity.
Referenced by EndDrawing().
      
  | 
  virtualinherited | 
Allow using shaders with the stored data.
| aShader | is the object that allows using shaders. | 
Definition at line 72 of file gpu_manager.cpp.
References DisplayError(), m_shader, and m_shaderAttrib.
| void KIGFX::GPU_CACHED_MANAGER::Unmap | ( | ) | 
      
  | 
  protected | 
Pointer to the current indices buffer.
Definition at line 143 of file gpu_manager.h.
Referenced by GPU_CACHED_MANAGER().
      
  | 
  protectedinherited | 
Shader handling.
Definition at line 89 of file gpu_manager.h.
Referenced by KIGFX::GPU_CACHED_MANAGER::EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), and GPU_MANAGER().
      
  | 
  protected | 
Definition at line 167 of file gpu_manager.h.
Referenced by BeginDrawing(), DrawIndices(), EndDrawing(), and GPU_CACHED_MANAGER().
      
  | 
  protectedinherited | 
Definition at line 98 of file gpu_manager.h.
Referenced by EnableDepthTest(), KIGFX::GPU_CACHED_MANAGER::EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), and GPU_MANAGER().
      
  | 
  protected | 
Size of the current VRANGE.
Definition at line 164 of file gpu_manager.h.
Referenced by BeginDrawing(), EndDrawing(), and GPU_CACHED_MANAGER().
      
  | 
  protected | 
Maximum size taken by the index buffer for all frames rendered so far.
Definition at line 161 of file gpu_manager.h.
Referenced by BeginDrawing(), DrawIndices(), EndDrawing(), and GPU_CACHED_MANAGER().
      
  | 
  protected | 
Current indices buffer size.
Definition at line 146 of file gpu_manager.h.
Referenced by EndDrawing(), and resizeIndices().
      
  | 
  protected | 
Ranges of visible vertex indices to render.
Definition at line 149 of file gpu_manager.h.
Referenced by GPU_CACHED_MANAGER(), and resizeIndices().
      
  | 
  protectedinherited | 
Container that stores vertices data.
Definition at line 86 of file gpu_manager.h.
Referenced by KIGFX::GPU_CACHED_MANAGER::BeginDrawing(), KIGFX::GPU_CACHED_MANAGER::DrawIndices(), KIGFX::GPU_CACHED_MANAGER::EndDrawing(), and GPU_MANAGER().
      
  | 
  protectedinherited | 
Location of shader attributes (for glVertexAttribPointer)
Definition at line 92 of file gpu_manager.h.
Referenced by KIGFX::GPU_CACHED_MANAGER::EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), GPU_MANAGER(), and SetShader().
      
  | 
  protectedinherited | 
true: enable Z test when drawing
Definition at line 95 of file gpu_manager.h.
Referenced by KIGFX::GPU_CACHED_MANAGER::EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), GPU_MANAGER(), and SetShader().
      
  | 
  protected | 
Number of regular VRANGEs (small items) pooled into single draw call.
Definition at line 155 of file gpu_manager.h.
Referenced by DrawIndices(), and GPU_CACHED_MANAGER().
      
  | 
  protected | 
Current size of index buffer.
Definition at line 158 of file gpu_manager.h.
Referenced by DrawIndices(), and GPU_CACHED_MANAGER().
      
  | 
  protected | 
Number of huge VRANGEs (i.e. large zones) with separate draw calls.
Definition at line 152 of file gpu_manager.h.
Referenced by BeginDrawing(), DrawIndices(), and EndDrawing().