aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-05-08 17:15:59 +1200
committerChris Forbes <[email protected]>2014-05-09 09:46:19 +1200
commit9269ea599cf8b22577fe4dc5996535f2cc0b7950 (patch)
tree51c94d1bdd655300997682311bb8a349e45796d9 /src/mesa/drivers/dri
parentdd43900b7bb3bec0b136bb244a04841123575467 (diff)
i965/Gen8: Set up layer constraints properly for renderbuffers
Fixing the same issues the previous commit does for Gen7. Note that I can't test this one, since I don't have a Broadwell. V2: Restore the MAX2() to account for zero depth/layer_count. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/gen8_surface_state.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
index fac8403142a..66b9879974d 100644
--- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
@@ -287,8 +287,8 @@ gen8_update_renderbuffer_surface(struct brw_context *brw,
uint32_t format = 0;
uint32_t surf_type;
bool is_array = false;
- int depth = MAX2(rb->Depth, 1);
- int min_array_element;
+ int depth = MAX2(irb->layer_count, 1);
+ int min_array_element = irb->mt_layer / MAX2(mt->num_samples, 1);
GLenum gl_target =
rb->TexImage ? rb->TexImage->TexObject->Target : GL_TEXTURE_2D;
@@ -311,20 +311,15 @@ gen8_update_renderbuffer_surface(struct brw_context *brw,
is_array = true;
depth *= 6;
break;
+ case GL_TEXTURE_3D:
+ depth = MAX2(rb->Depth, 1);
+ /* fallthrough */
default:
surf_type = translate_tex_target(gl_target);
is_array = _mesa_tex_target_is_array(gl_target);
break;
}
- if (layered) {
- min_array_element = 0;
- } else if (mt->num_samples > 1) {
- min_array_element = irb->mt_layer / mt->num_samples;
- } else {
- min_array_element = irb->mt_layer;
- }
-
/* _NEW_BUFFERS */
mesa_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
assert(brw_render_target_supported(brw, rb));