[Mesa-dev] [RFC] i965: Resolve color for all active shader images in intel_update_state().

Francisco Jerez currojerez at riseup.net
Sat Oct 3 07:57:05 PDT 2015


Jordan Justen <jordan.l.justen at intel.com> writes:

> From: Francisco Jerez <currojerez at riseup.net>
>
> Fixes arb_shader_image_load_store/execution/load-from-cleared-image.shader_test
>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Jason Ekstrand <jason.ekstrand at intel.com>
> Tested-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  RE: i965: Perform an explicit flush after doing _mesa_meta_pbo_TexSubImage
>
>  curro has some concerns about potential perf impact by this and
>  wanted it to be checked on small-core w/CPU bound apps.
>  Unfortunately, he is on vacation now.

I've benchmarked this on VLV and none of the CPU-bound tests in the
Finnish benchmarking system regress significantly, with n=6 and 95%
confidence level, so s/RFC/PATCH/.  I'll CC mesa-stable so it probably
makes sense to keep this independent from Chris' VBO resolve series.

>
>  src/mesa/drivers/dri/i965/brw_context.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index f0ed891..a274a43 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -189,6 +189,24 @@ intel_update_state(struct gl_context * ctx, GLuint new_state)
>        brw_render_cache_set_check_flush(brw, tex_obj->mt->bo);
>     }
>  
> +   /* Resolve color for each active shader image. */
> +   for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
> +      const struct gl_shader *shader = ctx->_Shader->CurrentProgram[i] ?
> +         ctx->_Shader->CurrentProgram[i]->_LinkedShaders[i] : NULL;
> +
> +      if (unlikely(shader && shader->NumImages)) {
> +         for (unsigned j = 0; j < shader->NumImages; j++) {
> +            struct gl_image_unit *u = &ctx->ImageUnits[shader->ImageUnits[j]];
> +            tex_obj = intel_texture_object(u->TexObj);
> +
> +            if (tex_obj && tex_obj->mt) {
> +               intel_miptree_resolve_color(brw, tex_obj->mt);
> +               brw_render_cache_set_check_flush(brw, tex_obj->mt->bo);
> +            }
> +         }
> +      }
> +   }
> +
>     _mesa_lock_context_textures(ctx);
>  }
>  
> -- 
> 2.5.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151003/c8026395/attachment.sig>


More information about the mesa-dev mailing list