KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::GPU_CACHED_MANAGER Class Reference

#include <gpu_manager.h>

Inheritance diagram for KIGFX::GPU_CACHED_MANAGER:
KIGFX::GPU_MANAGER

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_MANAGERMakeManager (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< VRANGEm_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_CONTAINERm_container
 Shader handling.
 
SHADERm_shader
 Location of shader attributes (for glVertexAttribPointer)
 
int m_shaderAttrib
 true: enable Z test when drawing
 
bool m_enableDepthTest
 

Detailed Description

Definition at line 102 of file gpu_manager.h.

Constructor & Destructor Documentation

◆ GPU_CACHED_MANAGER()

GPU_CACHED_MANAGER::GPU_CACHED_MANAGER ( VERTEX_CONTAINER aContainer)

Definition at line 85 of file gpu_manager.cpp.

◆ ~GPU_CACHED_MANAGER()

GPU_CACHED_MANAGER::~GPU_CACHED_MANAGER ( )

Prepare the stored data to be drawn.

Definition at line 98 of file gpu_manager.cpp.

Member Function Documentation

◆ BeginDrawing()

void GPU_CACHED_MANAGER::BeginDrawing ( )
overridevirtual

Make the GPU draw given range of vertices.

Parameters
aOffsetis the beginning of the range.
aSizeis 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.

◆ DrawIndices()

void GPU_CACHED_MANAGER::DrawIndices ( const VERTEX_ITEM aItem)
overridevirtual

◆ EnableDepthTest()

void GPU_MANAGER::EnableDepthTest ( bool  aEnabled)
inherited

Enable/disable Z buffer depth test.

Definition at line 336 of file gpu_manager.cpp.

References KIGFX::GPU_MANAGER::m_enableDepthTest.

◆ EndDrawing()

◆ MakeManager()

GPU_MANAGER * GPU_MANAGER::MakeManager ( VERTEX_CONTAINER aContainer)
staticinherited

◆ Map()

void KIGFX::GPU_CACHED_MANAGER::Map ( )

Unmap vertex buffer.

◆ resizeIndices()

void GPU_CACHED_MANAGER::resizeIndices ( unsigned int  aNewSize)
protected

< Resizes the indices buffer to aNewSize if necessary

Buffers initialization flag

Definition at line 247 of file gpu_manager.cpp.

References m_indices, and m_indicesCapacity.

Referenced by EndDrawing().

◆ SetShader()

void GPU_MANAGER::SetShader ( SHADER aShader)
virtualinherited

Allow using shaders with the stored data.

Parameters
aShaderis the object that allows using shaders.

Definition at line 72 of file gpu_manager.cpp.

References DisplayError(), KIGFX::SHADER::GetAttribute(), KIGFX::GPU_MANAGER::m_shader, and KIGFX::GPU_MANAGER::m_shaderAttrib.

◆ Unmap()

void KIGFX::GPU_CACHED_MANAGER::Unmap ( )

Member Data Documentation

◆ m_buffersInitialized

bool KIGFX::GPU_CACHED_MANAGER::m_buffersInitialized
protected

Pointer to the current indices buffer.

Definition at line 141 of file gpu_manager.h.

◆ m_container

VERTEX_CONTAINER* KIGFX::GPU_MANAGER::m_container
protectedinherited

Shader handling.

Definition at line 89 of file gpu_manager.h.

Referenced by EndDrawing(), and KIGFX::GPU_NONCACHED_MANAGER::EndDrawing().

◆ m_curVrangeSize

unsigned int KIGFX::GPU_CACHED_MANAGER::m_curVrangeSize
protected

Definition at line 165 of file gpu_manager.h.

Referenced by BeginDrawing(), DrawIndices(), and EndDrawing().

◆ m_enableDepthTest

bool KIGFX::GPU_MANAGER::m_enableDepthTest
protectedinherited

◆ m_indexBufMaxSize

unsigned int KIGFX::GPU_CACHED_MANAGER::m_indexBufMaxSize
protected

Size of the current VRANGE.

Definition at line 162 of file gpu_manager.h.

Referenced by BeginDrawing(), and EndDrawing().

◆ m_indexBufSize

unsigned int KIGFX::GPU_CACHED_MANAGER::m_indexBufSize
protected

Maximum size taken by the index buffer for all frames rendered so far.

Definition at line 159 of file gpu_manager.h.

Referenced by BeginDrawing(), DrawIndices(), and EndDrawing().

◆ m_indices

boost::scoped_array<GLuint> KIGFX::GPU_CACHED_MANAGER::m_indices
protected

Current indices buffer size.

Definition at line 144 of file gpu_manager.h.

Referenced by EndDrawing(), and resizeIndices().

◆ m_indicesCapacity

unsigned int KIGFX::GPU_CACHED_MANAGER::m_indicesCapacity
protected

Ranges of visible vertex indices to render.

Definition at line 147 of file gpu_manager.h.

Referenced by resizeIndices().

◆ m_isDrawing

bool KIGFX::GPU_MANAGER::m_isDrawing
protectedinherited

Container that stores vertices data.

Definition at line 86 of file gpu_manager.h.

Referenced by BeginDrawing(), DrawIndices(), and EndDrawing().

◆ m_shader

SHADER* KIGFX::GPU_MANAGER::m_shader
protectedinherited

Location of shader attributes (for glVertexAttribPointer)

Definition at line 92 of file gpu_manager.h.

Referenced by EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), and KIGFX::GPU_MANAGER::SetShader().

◆ m_shaderAttrib

int KIGFX::GPU_MANAGER::m_shaderAttrib
protectedinherited

true: enable Z test when drawing

Definition at line 95 of file gpu_manager.h.

Referenced by EndDrawing(), KIGFX::GPU_NONCACHED_MANAGER::EndDrawing(), and KIGFX::GPU_MANAGER::SetShader().

◆ m_totalHuge

int KIGFX::GPU_CACHED_MANAGER::m_totalHuge
protected

Number of regular VRANGEs (small items) pooled into single draw call.

Definition at line 153 of file gpu_manager.h.

Referenced by DrawIndices().

◆ m_totalNormal

int KIGFX::GPU_CACHED_MANAGER::m_totalNormal
protected

Current size of index buffer.

Definition at line 156 of file gpu_manager.h.

Referenced by DrawIndices().

◆ m_vranges

std::vector<VRANGE> KIGFX::GPU_CACHED_MANAGER::m_vranges
protected

Number of huge VRANGEs (i.e. large zones) with separate draw calls.

Definition at line 150 of file gpu_manager.h.

Referenced by BeginDrawing(), DrawIndices(), and EndDrawing().


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