[virglrenderer-devel] [PATCH 3/3] vrend: Handle primitive reset when running on GLES

Jakob Bornecrantz jakob at collabora.com
Mon Apr 30 20:02:25 UTC 2018


Signed-off-by: Jakob Bornecrantz <jakob at collabora.com>
---
 src/vrend_renderer.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 43e9ab2..9db833c 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -3043,7 +3043,9 @@ void vrend_draw_vbo(struct vrend_context *ctx,
    }
 
    if (info->primitive_restart) {
-      if (vrend_state.have_nv_prim_restart) {
+      if (vrend_state.use_gles) {
+         glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
+      } else if (vrend_state.have_nv_prim_restart) {
          glEnableClientState(GL_PRIMITIVE_RESTART_NV);
          glPrimitiveRestartIndexNV(info->restart_index);
       } else {
@@ -3105,10 +3107,13 @@ void vrend_draw_vbo(struct vrend_context *ctx,
    }
 
    if (info->primitive_restart) {
-      if (vrend_state.have_nv_prim_restart)
+      if (vrend_state.use_gles) {
+         glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
+      } else if (vrend_state.have_nv_prim_restart) {
          glDisableClientState(GL_PRIMITIVE_RESTART_NV);
-      else if (vrend_state.have_gl_prim_restart)
+      } else if (vrend_state.have_gl_prim_restart) {
          glDisable(GL_PRIMITIVE_RESTART);
+      }
    }
 
    if (ctx->sub->current_so && vrend_state.have_tf2) {
-- 
2.14.1



More information about the virglrenderer-devel mailing list