[Mesa-dev] [PATCH 15/23] i965/gen9: Set vertical and horizontal surface alignments
Anuj Phogat
anuj.phogat at gmail.com
Mon Mar 30 14:04:46 PDT 2015
From: Anuj phogat <anuj.phogat at gmail.com>
Patch sets the alignments for texture and renderbuffer surfaces.
Signed-off-by: Anuj phogat <anuj.phogat at gmail.com>
---
src/mesa/drivers/dri/i965/gen8_surface_state.c | 28 ++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
index 84fa383..6e9170b 100644
--- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
@@ -220,10 +220,20 @@ gen8_update_texture_surface(struct gl_context *ctx,
surf[0] = translate_tex_target(tObj->Target) << BRW_SURFACE_TYPE_SHIFT |
tex_format << BRW_SURFACE_FORMAT_SHIFT |
- vertical_alignment(mt) |
- horizontal_alignment(mt) |
tiling_mode;
+ /* Horizontal alignment is ignored when Tiled Resource Mode is not
+ * TRMODE_NONE. Vertical alignment is ignored for 1D surfaces and when
+ * Tiled Resource Mode is not TRMODE_NONE.
+ */
+ if (tr_mode == GEN9_SURFACE_TRMODE_NONE) {
+ if (!gen9_use_linear_1d_layout(brw, mt))
+ surf[0] |= horizontal_alignment(mt);
+
+ if (surf_type != BRW_SURFACE_1D)
+ surf[0] |= vertical_alignment(mt);
+ }
+
if (surf_type == BRW_SURFACE_CUBE) {
surf[0] |= BRW_SURFACE_CUBEFACE_ENABLES;
}
@@ -402,10 +412,20 @@ gen8_update_renderbuffer_surface(struct brw_context *brw,
surf[0] = (surf_type << BRW_SURFACE_TYPE_SHIFT) |
(is_array ? GEN7_SURFACE_IS_ARRAY : 0) |
(format << BRW_SURFACE_FORMAT_SHIFT) |
- vertical_alignment(mt) |
- horizontal_alignment(mt) |
surface_tiling_mode(tiling);
+ /* Horizontal alignment is ignored when Tiled Resource Mode is not
+ * TRMODE_NONE. Vertical alignment is ignored for 1D surfaces and when
+ * Tiled Resource Mode is not TRMODE_NONE.
+ */
+ if (tr_mode == GEN9_SURFACE_TRMODE_NONE) {
+ if (!gen9_use_linear_1d_layout(brw, mt))
+ surf[0] |= horizontal_alignment(mt);
+
+ if (surf_type != BRW_SURFACE_1D)
+ surf[0] |= vertical_alignment(mt);
+ }
+
surf[1] = SET_FIELD(mocs, GEN8_SURFACE_MOCS) | mt->qpitch >> 2;
surf[2] = SET_FIELD(width - 1, GEN7_SURFACE_WIDTH) |
--
2.3.4
More information about the mesa-dev
mailing list