Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-05 18:29:51 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-05 18:49:14 +0300
commitc766d9b9dc5661693a58e01a3637f15197c2fe59 (patch)
tree6905f0fc085af0eff5cfdf74d87c4ebed412e741 /source/blender/gpu/opengl/gl_context.hh
parentdb21c12abedd7606a3aaf50f70e506a24d9f0e7a (diff)
GPUTexture: GL Backend Isolation
This is a massive cleanup needed for vulkan support T68990. It provides: - More meaningful enums with conversion functions. - Less hacky supports of arrays and cubemaps (all considered layered). - More inline with the stateless design of vulkan and modern GL. - Methods Fallbacks are using framebuffer functions that are wrapped instead of implementing inside the texture module. What is not in there: - API change. - Samplers support (breaks a few effects). # Conflicts: # source/blender/gpu/GPU_texture.h
Diffstat (limited to 'source/blender/gpu/opengl/gl_context.hh')
-rw-r--r--source/blender/gpu/opengl/gl_context.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_context.hh b/source/blender/gpu/opengl/gl_context.hh
index bc7e2060804..9e6359fabad 100644
--- a/source/blender/gpu/opengl/gl_context.hh
+++ b/source/blender/gpu/opengl/gl_context.hh
@@ -30,6 +30,8 @@
#include "BLI_set.hh"
#include "BLI_vector.hh"
+#include "gl_state.hh"
+
#include "glew-mx.h"
#include <mutex>
@@ -83,6 +85,12 @@ class GLContext : public GPUContext {
void activate(void) override;
void deactivate(void) override;
+ static inline GLStateManager *state_manager_active_get()
+ {
+ GLContext *ctx = static_cast<GLContext *>(GPU_context_active_get());
+ return static_cast<GLStateManager *>(ctx->state_manager);
+ };
+
/* TODO(fclem) these needs to become private. */
public:
void orphans_add(Vector<GLuint> &orphan_list, std::mutex &list_mutex, GLuint id);