From 654647cde997441755a4c39ff845fa368db14a66 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 20 Jul 2018 10:03:43 +0200 Subject: [PATCH] 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 Signed-off-by: Dave Airlie --- src/vrend_renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index b8a0950..c768f71 100644 --- a/src/vrend_renderer.c +++ b/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; if (gl_ver >= 33 || epoxy_has_gl_extension("GL_ARB_shader_bit_encoding")) vrend_state.have_bit_encoding = true; - if (gl_ver >= 31) + if (!gles && gl_ver >= 31) vrend_state.have_gl_prim_restart = true; else if (epoxy_has_gl_extension("GL_NV_primitive_restart")) vrend_state.have_nv_prim_restart = true;