i965/blorp: Map 1-D render targets with DIM_LAYOUT_GEN4_2D as 2D on gen9
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 28 Jun 2016 00:30:35 +0000 (17:30 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 17 Aug 2016 21:46:22 +0000 (14:46 -0700)
The sampling hardware can handle them ok.  It just looks at the tiling to
determine whether it's the new gen9 1-D layout or the old one.  The render
hardware isn't so smart.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/brw_blorp.c

index d9b55546102a8bb718105dfb6ff7c51421fbe88a..2cf0f999e208cc8cf1ba5d7dd0ca5e98df31b5ed 100644 (file)
@@ -371,6 +371,12 @@ brw_blorp_emit_surface_state(struct brw_context *brw,
 
    struct isl_surf surf = surface->surf;
 
+   if (surf.dim == ISL_SURF_DIM_1D &&
+       surf.dim_layout == ISL_DIM_LAYOUT_GEN4_2D) {
+      assert(surf.logical_level0_px.height == 1);
+      surf.dim = ISL_SURF_DIM_2D;
+   }
+
    union isl_color_value clear_color = { .u32 = { 0, 0, 0, 0 } };
 
    const struct isl_surf *aux_surf = NULL;