[virglrenderer-devel] [PATCH 05/21] features: add draw_instance feature.

Gert Wollny gert.wollny at collabora.com
Tue Jul 24 07:29:34 UTC 2018


Am Dienstag, den 24.07.2018, 13:38 +1000 schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
> 
> If we get an instance count and we don't have this feature, throw
> an error.
After testing I have to correct my R-b for this. It is enabled for GLES
>= 30 and it is required to be enabled. 



> ---
>  src/vrend_renderer.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> index ea77da7..7672269 100644
> --- a/src/vrend_renderer.c
> +++ b/src/vrend_renderer.c
> @@ -94,6 +94,7 @@ enum features_id
>     feat_bit_encoding,
>     feat_copy_image,
>     feat_debug_cb,
> +   feat_draw_instance,
>     feat_gl_conditional_render,
>     feat_gl_prim_restart,
>     feat_gles_khr_robustness,
> @@ -130,6 +131,7 @@ static const  struct {
>     [feat_bit_encoding] = { 33, UNAVAIL, {
> "GL_ARB_shader_bit_encoding" } },
>     [feat_copy_image] = { 43, 32, { "GL_ARB_copy_image",
> "GL_EXT_copy_image", "GL_OES_copy_image" } },
>     [feat_debug_cb] = { UNAVAIL, UNAVAIL, {} }, /* special case */
> +   [feat_draw_instance] = { 31, UNAVAIL, { "GL_ARB_draw_instanced" }
Please add GLES 30 here, otherwise it regresses. 
With that change you have my R-b.   


> },
>     [feat_gl_conditional_render] = { 30, UNAVAIL, {} },
>     [feat_gl_prim_restart] = { 31, UNAVAIL, {} },
>     [feat_gles_khr_robustness] = { UNAVAIL, UNAVAIL, {
> "GL_KHR_robustness" } },
> @@ -3338,6 +3340,9 @@ int vrend_draw_vbo(struct vrend_context *ctx,
>     if (ctx->in_error)
>        return 0;
>  
> +   if (info->instance_count && !has_feature(feat_draw_instance))
> +      return EINVAL;
> +
>     if (indirect_handle) {
>        indirect_res = vrend_renderer_ctx_res_lookup(ctx,
> indirect_handle);
>        if (!indirect_res) {
> @@ -7579,14 +7584,13 @@ void vrend_renderer_fill_caps(uint32_t set,
> uint32_t version,
>        caps->v1.bset.color_clamping = 1;
>     }
>  
> -   if (gl_ver >= 31) {
> +   if (has_feature(feat_draw_instance))
>        caps->v1.bset.instanceid = 1;
> +
> +   if (gl_ver >= 31) {
>        glGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, &max);
>        vrend_state.max_uniform_blocks = max;
>        caps->v1.max_uniform_blocks = max + 1;
> -   } else {
> -      if (epoxy_has_gl_extension("GL_ARB_draw_instanced"))
> -         caps->v1.bset.instanceid = 1;
>     }
>  
>     if (gl_ver >= 32) {


More information about the virglrenderer-devel mailing list