blob: e3dce31758b18a4e20e4bb18fcd62cbe3e4e0a3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2020 Blender Foundation. All rights reserved. */
/** \file
* \ingroup gpu
*
* GPU shader interface (C --> GLSL)
*
* Structure detailing needed vertex inputs and resources for a specific shader.
* A shader interface can be shared between two similar shaders.
*/
#pragma once
#include "MEM_guardedalloc.h"
#include "BLI_vector.hh"
#include "glew-mx.h"
#include "gpu_shader_create_info.hh"
#include "gpu_shader_interface.hh"
namespace blender::gpu {
class GLVaoCache;
/**
* Implementation of Shader interface using OpenGL.
*/
class GLShaderInterface : public ShaderInterface {
private:
/** Reference to VaoCaches using this interface */
Vector<GLVaoCache *> refs_;
public:
GLShaderInterface(GLuint program, const shader::ShaderCreateInfo &info);
GLShaderInterface(GLuint program);
~GLShaderInterface();
void ref_add(GLVaoCache *ref);
void ref_remove(GLVaoCache *ref);
MEM_CXX_CLASS_ALLOC_FUNCS("GLShaderInterface");
};
} // namespace blender::gpu
|