[Mesa-dev] [PATCH 02/25] i965/gen7: Factor out texture surface state set-up from gen7_update_texture_surface().

Paul Berry stereotype441 at gmail.com
Mon Dec 30 13:18:02 PST 2013


On 2 December 2013 11:39, Francisco Jerez <currojerez at riseup.net> wrote:

> This moves most of the surface state set-up logic that can be shared
> between textures and shader images to a separate function.
>

Let's make a note in the commit message that this causes the "Render Target
View Extent" field to be set on texture surfaces now.  I don't think that's
a problem, but it's nice to have it documented so that in case a problem
later bisects to this commit we'll have a hint as to the behavioural change.


> +static void
> +gen7_update_texture_surface(struct gl_context *ctx,
> +                            unsigned unit,
> +                            uint32_t *surf_offset,
> +                            bool for_gather)
> +{
> +   struct brw_context *brw = brw_context(ctx);
> +   struct gl_texture_object *obj = ctx->Texture.Unit[unit]._Current;
> +
> +   if (obj->Target == GL_TEXTURE_BUFFER) {
> +      brw_update_buffer_texture_surface(ctx, unit, surf_offset);
> +
>

Spurious newline here.


> +   } else {
> +      struct intel_texture_object *intel_obj = intel_texture_object(obj);
> +      struct intel_mipmap_tree *mt = intel_obj->mt;
> +      struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
> +      unsigned tex_format = translate_tex_format(
> +         brw, mt->format, obj->DepthMode, sampler->sRGBDecode);
> +
> +      if (for_gather && tex_format == BRW_SURFACEFORMAT_R32G32_FLOAT)
> +         tex_format = BRW_SURFACEFORMAT_R32G32_FLOAT_LD;
> +
> +      gen7_emit_texture_surface_state(brw, obj,
> +                                      0, mt->logical_depth0,
> +                                      obj->BaseLevel,
> intel_obj->_MaxLevel,
> +                                      tex_format, surf_offset,
> +                                      false, for_gather);
> +   }
> +}
> +


With those changes, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131230/c108af35/attachment.html>


More information about the mesa-dev mailing list