[Mesa-dev] [v2 12/12] i965/SQUASH: Implement surface state set-up for shader images.

Topi Pohjolainen topi.pohjolainen at intel.com
Wed May 6 04:25:18 PDT 2015


---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 6e0166e..250c61a 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1127,8 +1127,10 @@ update_image_surface(struct brw_context *brw,
                access != GL_READ_ONLY);
 
          } else {
+            const unsigned mip_count = 1;
             const unsigned min_layer = obj->MinLayer + u->Layer;
-            const unsigned min_level = obj->MinLevel + u->Level;
+            const unsigned min_level = obj->MinLevel + u->Level -
+                                       mt->first_level;
             const unsigned num_layers = (!u->Layered ? 1 :
                                          obj->Target == GL_TEXTURE_CUBE_MAP ? 6 :
                                          mt->logical_depth0);
@@ -1136,11 +1138,11 @@ update_image_surface(struct brw_context *brw,
                                    obj->Target == GL_TEXTURE_CUBE_MAP_ARRAY ?
                                    GL_TEXTURE_2D_ARRAY : obj->Target);
 
-            brw->vtbl.emit_texture_surface_state(
-               brw, mt, target,
-               min_layer, min_layer + num_layers,
-               min_level, min_level + 1,
-               format, SWIZZLE_XYZW,
+            brw->vtbl.update_surface_state(
+               brw, mt, format, false, target,
+               num_layers, min_layer,
+               min_level, mip_count,
+               SWIZZLE_XYZW,
                surf_offset, access != GL_READ_ONLY, false);
          }
       }
-- 
1.9.3



More information about the mesa-dev mailing list