aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_clear.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2014-01-07 06:29:47 -0800
committerPaul Berry <[email protected]>2014-01-10 05:58:49 -0800
commit532b1fecd93fd30d3b1b101b55fd2c6e074088ad (patch)
treeb3da079966c0d2edcac116f1a5ea066251498ab2 /src/mesa/drivers/dri/i965/brw_clear.c
parent28af1dc21772d0b7819dff6080484c67114dc0d1 (diff)
i965: Fix clears of layered framebuffers with mismatched layer counts.
Previously, Mesa enforced the following rule (from ARB_geometry_shader4's list of criteria for framebuffer completeness): * If any framebuffer attachment is layered, all attachments must have the same layer count. For three-dimensional textures, the layer count is the depth of the attached volume. For cube map textures, the layer count is always six. For one- and two-dimensional array textures, the layer count is simply the number of layers in the array texture. { FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB } However, when ARB_geometry_shader4 was adopted into GL 3.2, this rule was dropped; GL 3.2 permits different attachments to have different layer counts. This patch brings Mesa in line with GL 3.2. In order to ensure that layered clears properly clear all layers, we now have to keep track of the maximum number of layers in a layered framebuffer. Fixes the following piglit tests in spec/!OpenGL 3.2/layered-rendering: - clear-color-all-types 1d_array mipmapped - clear-color-all-types 1d_array single_level - clear-color-mismatched-layer-count - framebuffer-layer-count-mismatch Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_clear.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_clear.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
index 1cac996482d..fe68d9efcb9 100644
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@ -181,9 +181,9 @@ brw_fast_clear_depth(struct gl_context *ctx)
*/
intel_batchbuffer_emit_mi_flush(brw);
- if (fb->NumLayers > 0) {
- assert(fb->NumLayers == depth_irb->mt->level[depth_irb->mt_level].depth);
- for (unsigned layer = 0; layer < fb->NumLayers; layer++) {
+ if (fb->MaxNumLayers > 0) {
+ unsigned num_layers = depth_irb->mt->level[depth_irb->mt_level].depth;
+ for (unsigned layer = 0; layer < num_layers; layer++) {
intel_hiz_exec(brw, mt, depth_irb->mt_level, layer,
GEN6_HIZ_OP_DEPTH_CLEAR);
}