diff options
author | Jason Ekstrand <[email protected]> | 2016-06-22 11:11:29 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-06-22 12:26:43 -0700 |
commit | 0f9cd74aab021da81a7e5a2f0fbf66213471628f (patch) | |
tree | c798b75bb773c85e5cb9084dbf59cb440afd9888 | |
parent | ee39d3ba918de9d52d79bdee6db2c120bcf0f28e (diff) |
i965/gen4-6: Handle gl_texture_object::BaseLevel and MinLayer correctly
This is basically a direct translation of what we do for gen7.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83036
Cc: "11.1 11.2 12.0" <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 |
1 files changed, 3 insertions, 1 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 b07bf19daf4..83c4c810af2 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -391,8 +391,10 @@ brw_update_texture_surface(struct gl_context *ctx, (mt->logical_depth0 - 1) << BRW_SURFACE_DEPTH_SHIFT | (mt->pitch - 1) << BRW_SURFACE_PITCH_SHIFT); + const unsigned min_lod = tObj->MinLevel + tObj->BaseLevel - mt->first_level; surf[4] = (brw_get_surface_num_multisamples(mt->num_samples) | - SET_FIELD(tObj->BaseLevel - mt->first_level, BRW_SURFACE_MIN_LOD)); + SET_FIELD(min_lod, BRW_SURFACE_MIN_LOD) | + SET_FIELD(tObj->MinLayer, BRW_SURFACE_MIN_ARRAY_ELEMENT)); surf[5] = mt->valign == 4 ? BRW_SURFACE_VERTICAL_ALIGN_ENABLE : 0; |