summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2011-11-15 18:20:20 -0800
committerChad Versace <[email protected]>2011-11-22 10:50:50 -0800
commit77a18428fffc938a4e3fa9b592e3e104dda0fe7f (patch)
tree8499a11ec8ac6daaadcf930e5391828c1c79e7db /src/mesa/drivers
parent1383e56bd916f9fc4357a6224aac4e8c691303cb (diff)
i965: Add HiZ operation state to brw_context
brw_context::hiz contains state needed to perform HiZ meta-ops and indicates if a HiZ operation is currently in progress. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index e5d2d140b1e..fa2fc72e435 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -899,6 +899,41 @@ struct brw_context
enum state_struct_type type;
} *state_batch_list;
int state_batch_count;
+
+ /**
+ * \brief State needed to execute HiZ meta-ops
+ *
+ * All fields except \c op are initialized by gen6_hiz_init().
+ */
+ struct brw_hiz_state {
+ /**
+ * \brief Indicates which HiZ operation is in progress.
+ *
+ * See the following sections of the Sandy Bridge PRM, Volume 1, Part2:
+ * - 7.5.3.1 Depth Buffer Clear
+ * - 7.5.3.2 Depth Buffer Resolve
+ * - 7.5.3.3 Hierarchical Depth Buffer Resolve
+ */
+ enum brw_hiz_op {
+ BRW_HIZ_OP_NONE = 0,
+ BRW_HIZ_OP_DEPTH_CLEAR,
+ BRW_HIZ_OP_DEPTH_RESOLVE,
+ BRW_HIZ_OP_HIZ_RESOLVE,
+ } op;
+
+ /** \brief Shader state */
+ struct {
+ GLuint program;
+ GLuint position_vbo;
+ GLint position_location;
+ } shader;
+
+ /** \brief VAO for the rectangle primitive's vertices. */
+ GLuint vao;
+
+ GLuint fbo;
+ struct gl_renderbuffer *depth_rb;
+ } hiz;
};