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.
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 336 of file gpu_manager.cpp.
References KIGFX::GPU_MANAGER::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::SHADER::Deactivate(), 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(), KIGFX::SHADER::Use(), and KIGFX::VERTEX_SIZE.
|
staticinherited |
Definition at line 48 of file gpu_manager.cpp.
References 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 247 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(), KIGFX::SHADER::GetAttribute(), KIGFX::GPU_MANAGER::m_shader, and KIGFX::GPU_MANAGER::m_shaderAttrib.
void KIGFX::GPU_CACHED_MANAGER::Unmap | ( | ) |
|
protected |
Pointer to the current indices buffer.
Definition at line 141 of file gpu_manager.h.
|
protectedinherited |
Shader handling.
Definition at line 89 of file gpu_manager.h.
Referenced by EndDrawing(), and KIGFX::GPU_NONCACHED_MANAGER::EndDrawing().
|
protected |
Definition at line 165 of file gpu_manager.h.
Referenced by BeginDrawing(), DrawIndices(), and EndDrawing().
|
protectedinherited |
Definition at line 98 of file gpu_manager.h.
Referenced by KIGFX::GPU_MANAGER::EnableDepthTest(), EndDrawing(), and KIGFX::GPU_NONCACHED_MANAGER::EndDrawing().
|
protected |
Size of the current VRANGE.
Definition at line 162 of file gpu_manager.h.
Referenced by BeginDrawing(), and EndDrawing().
|
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().
|
protected |
Current indices buffer size.
Definition at line 144 of file gpu_manager.h.
Referenced by EndDrawing(), and resizeIndices().
|
protected |
Ranges of visible vertex indices to render.
Definition at line 147 of file gpu_manager.h.
Referenced by resizeIndices().
|
protectedinherited |
Container that stores vertices data.
Definition at line 86 of file gpu_manager.h.
Referenced by BeginDrawing(), DrawIndices(), and EndDrawing().
|
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().
|
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().
|
protected |
Number of regular VRANGEs (small items) pooled into single draw call.
Definition at line 153 of file gpu_manager.h.
Referenced by DrawIndices().
|
protected |
Current size of index buffer.
Definition at line 156 of file gpu_manager.h.
Referenced by DrawIndices().
|
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().