gKit2 light
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PipelineCache Class Reference

ensemble de shader programs compiles. singleton. More...

#include <draw.h>

Public Member Functions

PipelineProgramfind (const char *filename, const char *definitions="")
 renvoie un shader program compile. More...
 

Static Public Member Functions

static PipelineCachemanager ()
 access au singleton. More...
 

Protected Member Functions

 PipelineCache ()
 constructeur prive. More...
 

Protected Attributes

std::vector< PipelineProgram * > m_programs
 

Detailed Description

ensemble de shader programs compiles. singleton.

Definition at line 158 of file draw.h.

Constructor & Destructor Documentation

◆ PipelineCache()

PipelineCache::PipelineCache ( )
inlineprotected

constructeur prive.

Definition at line 196 of file draw.h.

196 : m_programs() {}

Member Function Documentation

◆ find()

PipelineProgram* PipelineCache::find ( const char *  filename,
const char *  definitions = "" 
)
inline

renvoie un shader program compile.

Definition at line 169 of file draw.h.

170  {
171  // todo peut etre remplacer par une unordered_map ? mais il y a peu de shaders utilise normalement...
172  for(auto program : m_programs)
173  {
174  if(program->filename == filename && program->definitions == definitions)
175  return program;
176  }
177 
178  // cree le programme s'il n'existe pas deja...
179  GLuint p= read_program(filename, definitions);
181 
182  PipelineProgram *program= new PipelineProgram {filename, definitions, p};
183  m_programs.push_back(program);
184  return program;
185  }
description d'un shader program compile.
Definition: draw.h:151
GLuint read_program(const char *filename, const char *definitions)
Definition: program.cpp:204
int program_print_errors(const GLuint program)
affiche les erreurs de compilation.
Definition: program.cpp:432

◆ manager()

static PipelineCache& PipelineCache::manager ( )
inlinestatic

access au singleton.

Definition at line 188 of file draw.h.

189  {
190  static PipelineCache cache;
191  return cache;
192  }
ensemble de shader programs compiles. singleton.
Definition: draw.h:159

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