[Mesa-dev] [RFC PATCH 05/12] gen7 depth surface: determine if layered rendering is being used

Jordan Justen jordan.l.justen at intel.com
Mon Jul 15 17:14:41 PDT 2013


Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 src/mesa/drivers/dri/i965/gen7_misc_state.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/gen7_misc_state.c b/src/mesa/drivers/dri/i965/gen7_misc_state.c
index 14257cc..404d7d2 100644
--- a/src/mesa/drivers/dri/i965/gen7_misc_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_misc_state.c
@@ -22,6 +22,7 @@
  */
 
 #include "main/mtypes.h"
+#include "main/fbobject.h"
 #include "intel_batchbuffer.h"
 #include "intel_mipmap_tree.h"
 #include "intel_regions.h"
@@ -46,6 +47,7 @@ gen7_emit_depth_stencil_hiz(struct brw_context *brw,
    int depth = 1;
    GLenum gl_target = GL_TEXTURE_2D;
    int lod;
+   bool layered = false;
    const struct intel_renderbuffer *irb = NULL;
    const struct gl_renderbuffer *rb = NULL;
 
@@ -62,6 +64,15 @@ gen7_emit_depth_stencil_hiz(struct brw_context *brw,
          gl_target = rb->TexImage->TexObject->Target;
    }
 
+   if (_mesa_is_user_fbo(fb)) {
+      const struct gl_renderbuffer_attachment *depth_att =
+         _mesa_get_attachment(ctx, fb, GL_DEPTH_ATTACHMENT);
+      const struct gl_renderbuffer_attachment *stencil_att =
+         _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT);
+      layered = (depth_att && depth_att->Layered) ||
+                (stencil_att && stencil_att->Layered);
+   }
+
    switch (gl_target) {
    case GL_TEXTURE_CUBE_MAP_ARRAY:
    case GL_TEXTURE_CUBE_MAP:
-- 
1.7.10.4



More information about the mesa-dev mailing list