protect calls to glPrimitiveRestart on GLES 3.1

OpenGL ES 3.1 does not have glPrimitiveRestart; only OpenGL 3.1
does. So let's avoid making the renderer thing calling this is OK.

Otherwise, it'd be possible to generate evil commands from a rouge
guest-driver that can crash the VM.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 39add38156
commit 654647cde9
  1. 2
      src/vrend_renderer.c

@ -4606,7 +4606,7 @@ int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
vrend_state.have_samplers = true; vrend_state.have_samplers = true;
if (gl_ver >= 33 || epoxy_has_gl_extension("GL_ARB_shader_bit_encoding")) if (gl_ver >= 33 || epoxy_has_gl_extension("GL_ARB_shader_bit_encoding"))
vrend_state.have_bit_encoding = true; vrend_state.have_bit_encoding = true;
if (gl_ver >= 31) if (!gles && gl_ver >= 31)
vrend_state.have_gl_prim_restart = true; vrend_state.have_gl_prim_restart = true;
else if (epoxy_has_gl_extension("GL_NV_primitive_restart")) else if (epoxy_has_gl_extension("GL_NV_primitive_restart"))
vrend_state.have_nv_prim_restart = true; vrend_state.have_nv_prim_restart = true;

Loading…
Cancel
Save