[Mesa-stable] [PATCH 2/2] i965: Fix depth (array slices) computation for 1D_ARRAY render targets.

Kenneth Graunke kenneth at whitecape.org
Wed May 7 14:35:43 PDT 2014


1D array targets store the number of slices in the Height field.

Fixes Piglit's spec/!OpenGL 3.2/layered-rendering/clear-color-all-types
1d_array single_level, at least when used with Meta clears.

Cc: "10.2 10.1 10.0" <mesa-stable at lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 2 ++
 src/mesa/drivers/dri/i965/gen8_surface_state.c    | 3 +++
 2 files changed, 5 insertions(+)

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 d71a1d1..f051024 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -459,6 +459,8 @@ gen7_update_renderbuffer_surface(struct brw_context *brw,
    const uint8_t mocs = GEN7_MOCS_L3;
    GLenum gl_target = rb->TexImage ?
                          rb->TexImage->TexObject->Target : GL_TEXTURE_2D;
+   if (gl_target == GL_TEXTURE_1D_ARRAY)
+      depth = MAX2(rb->Height, 1);
 
    uint32_t surf_index =
       brw->wm.prog_data->binding_table.render_target_start + unit;
diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
index 564d275..f00b354 100644
--- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
@@ -281,6 +281,9 @@ gen8_update_renderbuffer_surface(struct brw_context *brw,
    GLenum gl_target =
       rb->TexImage ? rb->TexImage->TexObject->Target : GL_TEXTURE_2D;
 
+   if (gl_target == GL_TEXTURE_1D_ARRAY)
+      depth = MAX2(rb->Height, 1);
+
    uint32_t surf_index =
       brw->wm.prog_data->binding_table.render_target_start + unit;
 
-- 
1.9.2



More information about the mesa-stable mailing list