[Mesa-dev] [PATCH 3/5] i965: Directly resolve to mipmap's layer in our surface state packet

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Mon Dec 9 08:03:32 PST 2013


Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c  |    3 ++-
 src/mesa/drivers/dri/i965/gen7_wm_surface_state.c |    3 ++-
 2 files changed, 4 insertions(+), 2 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 01a4709..0cb619d 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -305,7 +305,8 @@ brw_update_texture_surface(struct gl_context *ctx,
 	      BRW_SURFACE_PITCH_SHIFT);
 
    surf[4] = (brw_get_surface_num_multisamples(intelObj->mt->num_samples) |
-              SET_FIELD(tObj->BaseLevel - mt->first_level, BRW_SURFACE_MIN_LOD));
+              SET_FIELD(intelObj->level? intelObj->level :
+                        tObj->BaseLevel - mt->first_level, BRW_SURFACE_MIN_LOD));
 
    surf[5] = mt->align_h == 4 ? BRW_SURFACE_VERTICAL_ALIGN_ENABLE : 0;
 
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
index dbd7309..8c76786 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -323,7 +323,8 @@ gen7_update_texture_surface(struct gl_context *ctx,
    surf[4] = gen7_surface_msaa_bits(mt->num_samples, mt->msaa_layout);
 
    surf[5] = (SET_FIELD(GEN7_MOCS_L3, GEN7_SURFACE_MOCS) |
-              SET_FIELD(tObj->BaseLevel - mt->first_level,
+              SET_FIELD(intelObj->level? intelObj->level :
+                        tObj->BaseLevel - mt->first_level,
                         GEN7_SURFACE_MIN_LOD) |
               /* mip count */
               (intelObj->_MaxLevel - tObj->BaseLevel));
-- 
1.7.9.5



More information about the mesa-dev mailing list