i965: Add an interface for doing hiz ops from C code.
authorEric Anholt <eric@anholt.net>
Mon, 21 May 2012 16:30:35 +0000 (09:30 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 23 May 2012 17:18:27 +0000 (10:18 -0700)
This required moving gen6_hiz_op, and I put it in intel_resolve_map.h
for the next commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_blorp.cpp
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/intel/intel_mipmap_tree.h
src/mesa/drivers/dri/intel/intel_resolve_map.h

index 994d646296c5f960e8851c22041557316eadb098..fc9b2acbd70e44af117efecff7e3845889fde132 100644 (file)
@@ -98,6 +98,17 @@ brw_blorp_params::brw_blorp_params()
 {
 }
 
+extern "C" {
+void
+intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt,
+              unsigned int level, unsigned int layer, gen6_hiz_op op)
+{
+   brw_hiz_op_params params(mt, level, layer, op);
+   brw_blorp_exec(intel, &params);
+}
+
+} /* extern "C" */
+
 void
 brw_blorp_exec(struct intel_context *intel, const brw_blorp_params *params)
 {
index 65662c068f89b1e6b63b169d1097d4bc3a7eb715..9aa5efa42945d07225ee3bc9eaf1c77a661d95a6 100644 (file)
 
 #include <stdint.h>
 
+#include "brw_context.h"
 #include "intel_mipmap_tree.h"
 
 struct brw_context;
 
 
-/**
- * For an overview of the HiZ operations, 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 gen6_hiz_op {
-   GEN6_HIZ_OP_DEPTH_CLEAR,
-   GEN6_HIZ_OP_DEPTH_RESOLVE,
-   GEN6_HIZ_OP_HIZ_RESOLVE,
-   GEN6_HIZ_OP_NONE,
-};
-
-
 /**
  * Binding table indices used by BLORP.
  */
index ca1666da2f56f39c56d568b8397875c52a978e7d..e690a12312b0a0e6261fd1986c4085378f335573 100644 (file)
@@ -421,6 +421,21 @@ intel_miptree_unmap(struct intel_context *intel,
                    unsigned int level,
                    unsigned int slice);
 
+#ifdef I915
+static inline void
+intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt,
+              unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+{
+   /* Stub on i915.  It would be nice if we didn't execute resolve code at all
+    * there.
+    */
+}
+#else
+void
+intel_hiz_exec(struct intel_context *intel, struct intel_mipmap_tree *mt,
+              unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 1082c10e2143d78568509e5522b98ab591714188..0f31ca801175641c0437b12ba1485e0dba72f389 100644 (file)
 
 #include <stdint.h>
 
+/**
+ * For an overview of the HiZ operations, 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
+ *
+ * Of these, two get entered in the resolve map as needing to be done to the
+ * buffer: depth resolve and hiz resolve.
+ */
+enum gen6_hiz_op {
+   GEN6_HIZ_OP_DEPTH_CLEAR,
+   GEN6_HIZ_OP_DEPTH_RESOLVE,
+   GEN6_HIZ_OP_HIZ_RESOLVE,
+   GEN6_HIZ_OP_NONE,
+};
+
 enum intel_need_resolve {
    INTEL_NEED_HIZ_RESOLVE,
    INTEL_NEED_DEPTH_RESOLVE,