i965: Fix depth (array slices) computation for 1D_ARRAY render targets.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 7 May 2014 21:35:43 +0000 (14:35 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 8 May 2014 06:42:11 +0000 (23:42 -0700)
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@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
src/mesa/drivers/dri/i965/gen8_surface_state.c

index d71a1d15656e64217ccd8697ac4021e8f9efd9e6..f051024b1ab064921379f92d6520a8db359d5e6e 100644 (file)
@@ -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;
index d52b32ecd87840f9a8c2ceef823777ee73b65613..fac8403142ad06c79d358c6239574696b0120bad 100644 (file)
@@ -293,6 +293,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;