<div dir="ltr">On 1 November 2013 20:23, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</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">Now that brw_update_texture_buffer_surface() uses the virtual<br>
emit_buffer_surface_state() function, it works for Gen7+ too.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br></blockquote><div><br></div><div>Series is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
 src/mesa/drivers/dri/i965/brw_context.h           |  3 ++<br>
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c  |  2 +-<br>
 src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 40 +----------------------<br>
 3 files changed, 5 insertions(+), 40 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h<br>
index 85bba1d..2294ce0 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_context.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_context.h<br>
@@ -1579,6 +1579,9 @@ void brw_create_constant_surface(struct brw_context *brw,<br>
                                  uint32_t size,<br>
                                  uint32_t *out_offset,<br>
                                  bool dword_pitch);<br>
+void brw_update_buffer_texture_surface(struct gl_context *ctx,<br>
+                                       unsigned unit,<br>
+                                       uint32_t *surf_offset);<br>
 void<br>
 brw_update_sol_surface(struct brw_context *brw,<br>
                        struct gl_buffer_object *buffer_obj,<br>
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
index 5a60a6b..2088688 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c<br>
@@ -226,7 +226,7 @@ gen4_emit_buffer_surface_state(struct brw_context *brw,<br>
    }<br>
 }<br>
<br>
-static void<br>
+void<br>
 brw_update_buffer_texture_surface(struct gl_context *ctx,<br>
                                   unsigned unit,<br>
                                   uint32_t *surf_offset)<br>
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c<br>
index c52e12d..3f4817d 100644<br>
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c<br>
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c<br>
@@ -268,44 +268,6 @@ gen7_emit_buffer_surface_state(struct brw_context *brw,<br>
 }<br>
<br>
 static void<br>
-gen7_update_buffer_texture_surface(struct gl_context *ctx,<br>
-                                   unsigned unit,<br>
-                                   uint32_t *surf_offset)<br>
-{<br>
-   struct brw_context *brw = brw_context(ctx);<br>
-   struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current;<br>
-   struct intel_buffer_object *intel_obj =<br>
-      intel_buffer_object(tObj->BufferObject);<br>
-   uint32_t size = tObj->BufferSize;<br>
-   drm_intel_bo *bo = NULL;<br>
-<br>
-   if (intel_obj) {<br>
-      size = MIN2(size, intel_obj->Base.Size);<br>
-      bo = intel_bufferobj_buffer(brw, intel_obj, tObj->BufferOffset, size);<br>
-   }<br>
-<br>
-   gl_format format = tObj->_BufferObjectFormat;<br>
-<br>
-   uint32_t surface_format = brw_format_for_mesa_format(format);<br>
-   if (surface_format == 0 && format != MESA_FORMAT_RGBA_FLOAT32) {<br>
-      _mesa_problem(NULL, "bad format %s for texture buffer\n",<br>
-                    _mesa_get_format_name(format));<br>
-   }<br>
-<br>
-   int texel_size = _mesa_get_format_bytes(format);<br>
-<br>
-   gen7_emit_buffer_surface_state(brw,<br>
-                                  surf_offset,<br>
-                                  bo,<br>
-                                  tObj->BufferOffset,<br>
-                                  surface_format,<br>
-                                  size / texel_size,<br>
-                                  texel_size,<br>
-                                  0 /* mocs */,<br>
-                                  false /* rw */);<br>
-}<br>
-<br>
-static void<br>
 gen7_update_texture_surface(struct gl_context *ctx,<br>
                             unsigned unit,<br>
                             uint32_t *surf_offset,<br>
@@ -319,7 +281,7 @@ gen7_update_texture_surface(struct gl_context *ctx,<br>
    struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);<br>
<br>
    if (tObj->Target == GL_TEXTURE_BUFFER) {<br>
-      gen7_update_buffer_texture_surface(ctx, unit, surf_offset);<br>
+      brw_update_buffer_texture_surface(ctx, unit, surf_offset);<br>
       return;<br>
    }<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.3.2<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>