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>2019-11-28 20:39:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-11-28 20:39:17 +0300
commit4e42a98edd8ca259c9b13c5548a62b46f0261d60 (patch)
treecab7a98af41ef2718008abd840085527fa4305ee /source/blender
parentf445f72ecadf21857a36b52b187620df158ef698 (diff)
Fix T71147 Eevee stops rendering after selection attempt
This is caused by the fallback path used by OSX, which is reconfiguring the same default VAO. But it seems to be an issue on certain drivers.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/gpu/intern/gpu_batch.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c
index 168d741f92a..23692cb20ec 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -655,11 +655,24 @@ void GPU_batch_draw_advanced(GPUBatch *batch, int v_first, int v_count, int i_fi
// BLI_assert(v_first + v_count <=
// (batch->elem ? batch->elem->index_len : batch->verts[0]->vertex_len));
+#ifdef __APPLE__
+ GLuint vao = 0;
+#endif
+
if (!GPU_arb_base_instance_is_supported()) {
if (i_first > 0) {
+#ifdef __APPLE__
+ /**
+ * There seems to be a nasty bug when drawing using the same VAO reconfiguring. (see T71147)
+ * We just use a throwaway VAO for that. Note that this is likely to degrade performance.
+ **/
+ glGenVertexArrays(1, &vao);
+ glBindVertexArray(vao);
+#else
/* If using offset drawing with instancing, we must
* use the default VAO and redo bindings. */
glBindVertexArray(GPU_vao_default());
+#endif
batch_update_program_bindings(batch, i_first);
}
else {
@@ -698,6 +711,12 @@ void GPU_batch_draw_advanced(GPUBatch *batch, int v_first, int v_count, int i_fi
glEnable(GL_PRIMITIVE_RESTART);
#endif
}
+
+#ifdef __APPLE__
+ if (vao != 0) {
+ glDeleteVertexArrays(1, &vao);
+ }
+#endif
}
/* just draw some vertices and let shader place them where we want. */