mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibAccelGfx: Add cache for programs
Having programs cache shared between painters would allow us to create more than one painter without worrying about shaders recompilation.
This commit is contained in:
parent
d5630fedf1
commit
cb90daadc7
3 changed files with 21 additions and 13 deletions
|
@ -15,14 +15,20 @@ class Program {
|
|||
AK_MAKE_NONCOPYABLE(Program);
|
||||
|
||||
public:
|
||||
static Program create(char const* vertex_shader_source, char const* fragment_shader_source);
|
||||
enum class Name {
|
||||
RectangleProgram,
|
||||
RoundedRectangleProgram,
|
||||
BlitProgram,
|
||||
LinearGradientProgram,
|
||||
ProgramCount,
|
||||
};
|
||||
|
||||
static Program create(Name name, char const* vertex_shader_source, char const* fragment_shader_source);
|
||||
|
||||
void use();
|
||||
GL::VertexAttribute get_attribute_location(char const* name);
|
||||
GL::Uniform get_uniform_location(char const* name);
|
||||
|
||||
~Program();
|
||||
|
||||
private:
|
||||
Program(GL::Program program)
|
||||
: m_program(program)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue