Blender  V2.93
List of all members
blender::gpu::GLVaoCache Class Reference

#include <gl_batch.hh>

Vao cache

Each #GLBatch has a small cache of VAO objects that are used to avoid VAO reconfiguration. TODO(fclem): Could be revisited to avoid so much cross references.

 GLVaoCache ()
 
 ~GLVaoCache ()
 
GLuint vao_get (GPUBatch *batch)
 
GLuint base_instance_vao_get (GPUBatch *batch, int i_first)
 
GLuint lookup (const GLShaderInterface *interface)
 
void insert (const GLShaderInterface *interface, GLuint vao_id)
 
void remove (const GLShaderInterface *interface)
 
void clear (void)
 

Detailed Description

Definition at line 49 of file gl_batch.hh.

Constructor & Destructor Documentation

◆ GLVaoCache()

GLVaoCache::GLVaoCache ( )

Definition at line 53 of file gl_batch.cc.

◆ ~GLVaoCache()

GLVaoCache::~GLVaoCache ( )

Definition at line 58 of file gl_batch.cc.

References clear().

Member Function Documentation

◆ base_instance_vao_get()

GLuint GLVaoCache::base_instance_vao_get ( GPUBatch batch,
int  i_first 
)

There seems to be a nasty bug when drawing using the same VAO reconfiguring (T71147). We just use a throwaway VAO for that. Note that this is likely to degrade performance.

Definition at line 227 of file gl_batch.cc.

References batch, blender::gpu::GLContext::get(), shader(), blender::gpu::Context::shader, blender::gpu::GLVertArray::update_bindings(), and vao_get().

Referenced by blender::gpu::GLBatch::bind().

◆ clear()

void GLVaoCache::clear ( void  )

◆ insert()

void GLVaoCache::insert ( const GLShaderInterface interface,
GLuint  vao_id 
)

◆ lookup()

GLuint GLVaoCache::lookup ( const GLShaderInterface interface)

Definition at line 195 of file gl_batch.cc.

References count, dynamic_vaos, GPU_VAO_STATIC_LEN, interfaces, and static_vaos.

Referenced by vao_get().

◆ remove()

void GLVaoCache::remove ( const GLShaderInterface interface)

◆ vao_get()

GLuint GLVaoCache::vao_get ( GPUBatch batch)

Member Data Documentation

◆ count

uint blender::gpu::GLVaoCache::count

Definition at line 70 of file gl_batch.hh.

Referenced by clear(), lookup(), and remove().

◆ 

struct { ... } blender::gpu::GLVaoCache::dynamic_vaos

Dynamic handle count

Referenced by clear(), insert(), lookup(), and remove().

◆ interfaces [1/2]

const GLShaderInterface* blender::gpu::GLVaoCache::interfaces[GPU_VAO_STATIC_LEN]

Definition at line 65 of file gl_batch.hh.

Referenced by clear(), lookup(), and remove().

◆ interfaces [2/2]

const GLShaderInterface** blender::gpu::GLVaoCache::interfaces

Definition at line 71 of file gl_batch.hh.

◆ 

struct { ... } blender::gpu::GLVaoCache::static_vaos

Static handle count

Referenced by clear(), insert(), lookup(), and remove().

◆ vao_ids [1/2]

GLuint blender::gpu::GLVaoCache::vao_ids[GPU_VAO_STATIC_LEN]

Definition at line 66 of file gl_batch.hh.

◆ vao_ids [2/2]

GLuint* blender::gpu::GLVaoCache::vao_ids

Definition at line 72 of file gl_batch.hh.


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