<div dir="ltr">On 2 December 2013 11:39, Francisco Jerez <span dir="ltr"><<a href="mailto:currojerez@riseup.net" target="_blank">currojerez@riseup.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This moves most of the surface state set-up logic that can be shared<br>
between textures and shader images to a separate function.<br></blockquote><div><br></div><div>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.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+static void<br>
+gen7_update_texture_surface(struct gl_context *ctx,<br>
+ unsigned unit,<br>
+ uint32_t *surf_offset,<br>
+ bool for_gather)<br>
+{<br>
+ struct brw_context *brw = brw_context(ctx);<br>
+ struct gl_texture_object *obj = ctx->Texture.Unit[unit]._Current;<br>
+<br>
+ if (obj->Target == GL_TEXTURE_BUFFER) {<br>
+ brw_update_buffer_texture_surface(ctx, unit, surf_offset);<br>
+<br></blockquote><div><br></div><div>Spurious newline here.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ } else {<br>
+ struct intel_texture_object *intel_obj = intel_texture_object(obj);<br>
+ struct intel_mipmap_tree *mt = intel_obj->mt;<br>
+ struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);<br>
+ unsigned tex_format = translate_tex_format(<br>
+ brw, mt->format, obj->DepthMode, sampler->sRGBDecode);<br>
+<br>
+ if (for_gather && tex_format == BRW_SURFACEFORMAT_R32G32_FLOAT)<br>
+ tex_format = BRW_SURFACEFORMAT_R32G32_FLOAT_LD;<br>
+<br>
+ gen7_emit_texture_surface_state(brw, obj,<br>
+ 0, mt->logical_depth0,<br>
+ obj->BaseLevel, intel_obj->_MaxLevel,<br>
+ tex_format, surf_offset,<br>
+ false, for_gather);<br>
+ }<br>
+}<br>
+</blockquote><div> </div><div>With those changes, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br></div></div></div></div>