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-12 18:29:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-12 18:29:37 +0300
commitbf3f4da9472516be12dcc69740fa69b6d72f1274 (patch)
tree8e8eaaee61d0570026c46eeeb8ea882146b04ca7 /source/blender/gpu/intern/gpu_state.cc
parent6bc0a8424e9b794accf70534ed55478337f0e3e3 (diff)
GPU: Fix wrong state before python callbacks
This was caused by a missing state apply. We force the GPUState to be set after the callbacks to avoid desync between our state tracker and the real gl state. This fixes some issues but a better general fix for all BGL would be better. This fix T80297 2.91 texture alpha is not transparent
Diffstat (limited to 'source/blender/gpu/intern/gpu_state.cc')
-rw-r--r--source/blender/gpu/intern/gpu_state.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index a3d07b1e1db..b63abb3d57f 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -305,6 +305,17 @@ void GPU_finish(void)
Context::get()->finish();
}
+void GPU_apply_state(void)
+{
+ Context::get()->state_manager->apply_state();
+}
+
+/* Will set all the states regardless of the current ones. */
+void GPU_force_state(void)
+{
+ Context::get()->state_manager->force_state();
+}
+
/** \} */
/* -------------------------------------------------------------------- */
@@ -319,12 +330,7 @@ void GPU_memory_barrier(eGPUBarrier barrier)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Default OpenGL State
- *
- * This is called on startup, for opengl offscreen render.
- * Generally we should always return to this state when
- * temporarily modifying the state for drawing, though that are (undocumented)
- * exceptions that we should try to get rid of.
+/** \name Default State
* \{ */
StateManager::StateManager(void)