Fix T67951: Bone selection is broken on some Intel GPUs

The problem is that the `glDrawArraysInstancedBaseInstance` is ignoring the last parameter.
The solution is to indicate that `GLEW_ARB_base_instance` is not supported in these cases.

Reviewers: fclem, brecht, jbakker

Reviewed By: fclem, brecht

Differential Revision: https://developer.blender.org/D5383
This commit is contained in:
2019-07-31 16:35:06 -03:00
parent ea3690e329
commit d8fb63661b
3 changed files with 17 additions and 3 deletions

View File

@@ -28,6 +28,7 @@
#include "GPU_batch.h"
#include "GPU_batch_presets.h"
#include "GPU_extensions.h"
#include "GPU_matrix.h"
#include "GPU_shader.h"
@@ -599,7 +600,7 @@ void GPU_batch_draw_advanced(GPUBatch *batch, int v_first, int v_count, int i_fi
i_count = (batch->inst) ? batch->inst->vertex_len : 1;
}
if (!GLEW_ARB_base_instance) {
if (!GPU_arb_base_instance_is_supported()) {
if (i_first > 0 && i_count > 0) {
/* If using offset drawing with instancing, we must
* use the default VAO and redo bindings. */
@@ -624,7 +625,7 @@ void GPU_batch_draw_advanced(GPUBatch *batch, int v_first, int v_count, int i_fi
#endif
void *v_first_ofs = elem_offset(el, v_first);
if (GLEW_ARB_base_instance) {
if (GPU_arb_base_instance_is_supported()) {
glDrawElementsInstancedBaseVertexBaseInstance(
batch->gl_prim_type, v_count, index_type, v_first_ofs, i_count, base_index, i_first);
}
@@ -637,7 +638,7 @@ void GPU_batch_draw_advanced(GPUBatch *batch, int v_first, int v_count, int i_fi
#ifdef __APPLE__
glDisable(GL_PRIMITIVE_RESTART);
#endif
if (GLEW_ARB_base_instance) {
if (GPU_arb_base_instance_is_supported()) {
glDrawArraysInstancedBaseInstance(batch->gl_prim_type, v_first, v_count, i_count, i_first);
}
else {