summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2017-04-24 17:41:51 +0300
committerTopi Pohjolainen <[email protected]>2017-07-20 11:32:21 +0300
commit76a3ce8fa583262d8650667390e53900e7799453 (patch)
tree5c2b912c407d1de25486f40e65a8813e48eba996 /src/mesa/drivers/dri
parent63a43f41619c29905def36c4f0e04d9405e68e93 (diff)
i965: Prepare tex, img and rt state emission for isl based miptrees
Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c21
1 files changed, 16 insertions, 5 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 3f2ca82fdba..45ac106f3f4 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -80,9 +80,13 @@ get_isl_surf(struct brw_context *brw, struct intel_mipmap_tree *mt,
uint32_t *tile_x, uint32_t *tile_y,
uint32_t *offset, struct isl_surf *surf)
{
- intel_miptree_get_isl_surf(brw, mt, surf);
+ if (mt->surf.size > 0) {
+ *surf = mt->surf;
+ } else {
+ intel_miptree_get_isl_surf(brw, mt, surf);
- surf->dim = get_isl_surf_dim(target);
+ surf->dim = get_isl_surf_dim(target);
+ }
const enum isl_dim_layout dim_layout =
get_isl_dim_layout(&brw->screen->devinfo, mt->surf.tiling, target,
@@ -553,9 +557,16 @@ brw_update_texture_surface(struct gl_context *ctx,
/* If this is a view with restricted NumLayers, then our effective depth
* is not just the miptree depth.
*/
- const unsigned view_num_layers =
- (obj->Immutable && obj->Target != GL_TEXTURE_3D) ? obj->NumLayers :
- mt->logical_depth0;
+ unsigned view_num_layers;
+ if (obj->Immutable && obj->Target != GL_TEXTURE_3D) {
+ view_num_layers = obj->NumLayers;
+ } else if (mt->surf.size > 0) {
+ view_num_layers = mt->surf.dim == ISL_SURF_DIM_3D ?
+ mt->surf.logical_level0_px.depth :
+ mt->surf.logical_level0_px.array_len;
+ } else {
+ view_num_layers = mt->logical_depth0;
+ }
/* Handling GL_ALPHA as a surface format override breaks 1.30+ style
* texturing functions that return a float, as our code generation always