renderer: add support for some core APIs on GLES 3.0+

Submitted by ramin.azarmehr@gmail.com on June 18, 2018, 6:47 p.m.

Details

Message ID 20180618184711.536-1-ramin.azarmehr@gmail.com
State New
Series "renderer: add support for some core APIs on GLES 3.0+"
Headers show

Commit Message

ramin.azarmehr@gmail.com June 18, 2018, 6:47 p.m.
From: Ramin Azarmehr <ramin.azarmehr@gmail.com>

Sources to verify the GLES APIs enabled in this patch:

sampler_objects (GLES 3.0+): https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glSamplerParameter.xhtml
sample_shading (GLES 3.2+): https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glMinSampleShading.xhtml
tessellation (GLES 3.2+): https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPatchParameteri.xhtml
texture_buffer_ranger (GLES 3.2+): https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexBufferRange.xhtml
---
 src/vrend_renderer.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 9a8c9dc..bd077cf 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -4411,10 +4411,11 @@  int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
 
    if (epoxy_has_gl_extension("GL_MESA_pack_invert"))
       vrend_state.have_mesa_invert = true;
-   if (gl_ver >= 43 ||  (gles && gl_ver >= 31) ||
+   if (gl_ver >= 43 || (gles && gl_ver >= 31) ||
        epoxy_has_gl_extension("GL_ARB_vertex_attrib_binding"))
       vrend_state.have_gles31_vertex_attrib_binding = true;
-   if (gl_ver >= 33 || epoxy_has_gl_extension("GL_ARB_sampler_objects"))
+   if (gl_ver >= 33 || (gles && gl_ver >= 30) ||
+       epoxy_has_gl_extension("GL_ARB_sampler_objects"))
       vrend_state.have_samplers = true;
    if (gl_ver >= 33 || epoxy_has_gl_extension("GL_ARB_shader_bit_encoding"))
       vrend_state.have_bit_encoding = true;
@@ -4437,13 +4438,16 @@  int vrend_renderer_init(struct vrend_if_cbs *cbs, uint32_t flags)
          vrend_state.have_ms_scaled_blit = true;
    }
 
-   if (gl_ver >= 40 || epoxy_has_gl_extension("GL_ARB_sample_shading"))
+   if (gl_ver >= 40 || (gles && gl_ver >= 32) ||
+       epoxy_has_gl_extension("GL_ARB_sample_shading"))
       vrend_state.have_sample_shading = true;
 
-   if (gl_ver >= 40 || epoxy_has_gl_extension("GL_ARB_tessellation_shader"))
+   if (gl_ver >= 40 || (gles && gl_ver >= 32) ||
+       epoxy_has_gl_extension("GL_ARB_tessellation_shader"))
       vrend_state.have_tessellation = true;
 
-   if (gl_ver >= 43 || epoxy_has_gl_extension("GL_ARB_texture_buffer_range"))
+   if (gl_ver >= 43 || (gles && gl_ver >= 32) ||
+       epoxy_has_gl_extension("GL_ARB_texture_buffer_range"))
       vrend_state.have_texture_buffer_range = true;
 
    if (gl_ver >= 42 || epoxy_has_gl_extension("GL_ARB_texture_storage"))
@@ -7110,7 +7114,7 @@  static void vrend_renderer_fill_caps_gles(uint32_t set, UNUSED uint32_t version,
    caps->v1.bset.cube_map_array = 0;
    caps->v1.bset.texture_query_lod = 0;
    caps->v1.bset.has_indirect_draw = 0;
-   caps->v1.bset.has_sample_shading = 0;
+   caps->v1.bset.has_sample_shading = vrend_state.have_sample_shading;
 
    caps->v1.bset.start_instance = 0;