[virglrenderer-devel] [PATCH 21/21] tessellation: expose ARB_tessellation_shader to the guest. (v2)

Elie Tournier tournier.elie at gmail.com
Tue Jun 12 14:11:58 UTC 2018


On Mon, Jun 11, 2018 at 03:11:12PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
> 
> This also exposes patches as a primitive type
> 
> v2: enable patch varyings
> ---
>  src/vrend_renderer.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> index 4bad802..c5f557f 100644
> --- a/src/vrend_renderer.c
> +++ b/src/vrend_renderer.c
> @@ -6912,6 +6912,8 @@ static bool vrend_renderer_fill_caps_common(uint32_t set, UNUSED uint32_t versio
>           (1 << PIPE_PRIM_TRIANGLES_ADJACENCY) |
>           (1 << PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY);
>     }
> +   if (!vrend_state.use_gles && caps->v1.glsl_level >= 400)
> +      caps->v1.prim_mask |= (1 << PIPE_PRIM_PATCHES);
>  
>  
>     /* Common limits for all backends. */
> @@ -7154,6 +7156,7 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
>        caps->v1.bset.has_indirect_draw = 1;
>        caps->v1.bset.has_sample_shading = 1;
>        caps->v1.bset.has_fp64 = 1;
> +      caps->v1.bset.has_tessellation_shaders = 1;
>     } else {
>        if (epoxy_has_gl_extension("GL_ARB_draw_buffers_blend"))
>           caps->v1.bset.indep_blend_func = 1;
> @@ -7169,6 +7172,8 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
>        if (epoxy_has_gl_extension("GL_ARB_gpu_shader_fp64") &&
>            epoxy_has_gl_extension("GL_ARB_gpu_shader5"))
>           caps->v1.bset.has_fp64 = 1;
> +      if (epoxy_has_gl_extension("GL_ARB_tessellation_shader"))
> +         caps->v1.bset.has_tessellation_shaders = 1;
>     }
>  
>     if (gl_ver >= 42) {
> @@ -7277,7 +7282,7 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
>        glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, (GLint*)&caps->v2.max_geom_output_vertices);
>        glGetIntegerv(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, (GLint*)&caps->v2.max_geom_total_output_components);
>     }
> -   caps->v2.max_shader_patch_varyings = 0; // until we do tess.
> +   caps->v2.max_shader_patch_varyings = 32; // until we do tess.

With https://lists.freedesktop.org/archives/mesa-dev/2018-June/197459.html,
we would be able to enable this value dynamically.

>  
>     if (epoxy_has_gl_extension("GL_ARB_texture_gather")) {
>         glGetIntegerv(GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET, &caps->v2.min_texture_gather_offset);
> -- 
> 2.14.3
> 
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel


More information about the virglrenderer-devel mailing list