i965: Move the hiz_op enum to blorp
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 19 Aug 2016 10:15:41 +0000 (03:15 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 29 Aug 2016 19:17:34 +0000 (12:17 -0700)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
13 files changed:
src/mesa/drivers/dri/i965/blorp.c
src/mesa/drivers/dri/i965/blorp.h
src/mesa/drivers/dri/i965/blorp_priv.h
src/mesa/drivers/dri/i965/brw_blorp.c
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/brw_clear.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/gen8_depth_state.c
src/mesa/drivers/dri/i965/genX_blorp_exec.h
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.h
src/mesa/drivers/dri/i965/intel_resolve_map.c
src/mesa/drivers/dri/i965/intel_resolve_map.h

index 20477dd086b190afd96829f29752e8db8294284b..16ccd34aab1a3c0162bc6715db64cb5793c3daba 100644 (file)
@@ -144,7 +144,6 @@ void
 brw_blorp_params_init(struct brw_blorp_params *params)
 {
    memset(params, 0, sizeof(*params));
-   params->hiz_op = GEN6_HIZ_OP_NONE;
    params->num_draw_buffers = 1;
    params->num_layers = 1;
 }
@@ -238,7 +237,7 @@ brw_blorp_compile_nir_shader(struct blorp_context *blorp, struct nir_shader *nir
 void
 blorp_gen6_hiz_op(struct blorp_batch *batch,
                   struct brw_blorp_surf *surf, unsigned level, unsigned layer,
-                  enum gen6_hiz_op op)
+                  enum blorp_hiz_op op)
 {
    struct brw_blorp_params params;
    brw_blorp_params_init(&params);
index 87867779d8d8721e1fe0af4760db45723fc92a6c..27f22c9d34c3c786e26af85a56df28150931003f 100644 (file)
@@ -27,7 +27,6 @@
 #include <stdbool.h>
 
 #include "isl/isl.h"
-#include "intel_resolve_map.h" /* needed for enum gen6_hiz_op */
 
 struct brw_context;
 struct brw_wm_prog_key;
@@ -128,10 +127,27 @@ void
 brw_blorp_ccs_resolve(struct blorp_batch *batch,
                       struct brw_blorp_surf *surf, enum isl_format format);
 
+/**
+ * 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 blorp_hiz_op {
+   BLORP_HIZ_OP_NONE,
+   BLORP_HIZ_OP_DEPTH_CLEAR,
+   BLORP_HIZ_OP_DEPTH_RESOLVE,
+   BLORP_HIZ_OP_HIZ_RESOLVE,
+};
+
 void
 blorp_gen6_hiz_op(struct blorp_batch *batch,
                   struct brw_blorp_surf *surf, unsigned level, unsigned layer,
-                  enum gen6_hiz_op op);
+                  enum blorp_hiz_op op);
 
 #ifdef __cplusplus
 } /* end extern "C" */
index 36ff637a79f0ea801b0389a0d9d01c269580092a..a25291b76743cf563803659002cf815c1eba5573 100644 (file)
@@ -174,7 +174,7 @@ struct brw_blorp_params
    uint32_t depth_format;
    struct brw_blorp_surface_info src;
    struct brw_blorp_surface_info dst;
-   enum gen6_hiz_op hiz_op;
+   enum blorp_hiz_op hiz_op;
    enum blorp_fast_clear_op fast_clear_op;
    bool color_write_disable[4];
    struct brw_blorp_wm_inputs wm_inputs;
index e59c26e78838a26617aab3386fdb002da836a180..b2b3f01e8ff3c55b62d9c44e283031de12765fd2 100644 (file)
@@ -839,7 +839,7 @@ brw_blorp_resolve_color(struct brw_context *brw, struct intel_mipmap_tree *mt)
 
 static void
 gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-                    unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+                    unsigned int level, unsigned int layer, enum blorp_hiz_op op)
 {
    intel_miptree_check_level_layer(mt, level, layer);
    intel_miptree_used_for_rendering(mt);
@@ -867,21 +867,21 @@ gen6_blorp_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
  */
 void
 intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op)
 {
    const char *opname = NULL;
 
    switch (op) {
-   case GEN6_HIZ_OP_DEPTH_RESOLVE:
+   case BLORP_HIZ_OP_DEPTH_RESOLVE:
       opname = "depth resolve";
       break;
-   case GEN6_HIZ_OP_HIZ_RESOLVE:
+   case BLORP_HIZ_OP_HIZ_RESOLVE:
       opname = "hiz ambiguate";
       break;
-   case GEN6_HIZ_OP_DEPTH_CLEAR:
+   case BLORP_HIZ_OP_DEPTH_CLEAR:
       opname = "depth clear";
       break;
-   case GEN6_HIZ_OP_NONE:
+   case BLORP_HIZ_OP_NONE:
       opname = "noop?";
       break;
    }
index 1aa1952021808b9e54d97e45adc555d03b52873c..53a732ea27e1dbdc5fb880400ba1d0ed658496fc 100644 (file)
@@ -58,7 +58,7 @@ brw_blorp_resolve_color(struct brw_context *brw,
 
 void
 intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op);
 
 void gen6_blorp_exec(struct blorp_batch *batch,
                      const struct brw_blorp_params *params);
index 18b8fcbe200c7ce17f245c8fbfa297d9cf69926c..0d64d8914d6e4c694b293ccef848966ea2b40171 100644 (file)
@@ -187,11 +187,11 @@ brw_fast_clear_depth(struct gl_context *ctx)
       for (unsigned layer = 0; layer < depth_irb->layer_count; layer++) {
          intel_hiz_exec(brw, mt, depth_irb->mt_level,
                         depth_irb->mt_layer + layer,
-                        GEN6_HIZ_OP_DEPTH_CLEAR);
+                        BLORP_HIZ_OP_DEPTH_CLEAR);
       }
    } else {
       intel_hiz_exec(brw, mt, depth_irb->mt_level, depth_irb->mt_layer,
-                     GEN6_HIZ_OP_DEPTH_CLEAR);
+                     BLORP_HIZ_OP_DEPTH_CLEAR);
    }
 
    if (brw->gen == 6) {
index da80e348a7d3f95d7f8ec47f03882a9f9d6a7c16..a76b25f0b96815309097ee9a7e43f7181be76346 100644 (file)
@@ -1848,7 +1848,7 @@ gen8_emit_depth_stencil_hiz(struct brw_context *brw,
                             uint32_t tile_x, uint32_t tile_y);
 
 void gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-                   unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+                   unsigned int level, unsigned int layer, enum blorp_hiz_op op);
 
 uint32_t get_hw_prim_for_gl_prim(int mode);
 
index a780da6b376293a748b99b1ca94e14eea96c3c92..4930991e3c0f21fd2521effa5c2a4a54d43c4d8e 100644 (file)
@@ -398,9 +398,9 @@ const struct brw_tracked_state gen8_pma_fix = {
  */
 void
 gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op)
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op)
 {
-   if (op == GEN6_HIZ_OP_NONE)
+   if (op == BLORP_HIZ_OP_NONE)
       return;
 
    /* Disable the PMA stall fix since we're about to do a HiZ operation. */
@@ -468,16 +468,16 @@ gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
    uint32_t dw1 = 0;
 
    switch (op) {
-   case GEN6_HIZ_OP_DEPTH_RESOLVE:
+   case BLORP_HIZ_OP_DEPTH_RESOLVE:
       dw1 |= GEN8_WM_HZ_DEPTH_RESOLVE;
       break;
-   case GEN6_HIZ_OP_HIZ_RESOLVE:
+   case BLORP_HIZ_OP_HIZ_RESOLVE:
       dw1 |= GEN8_WM_HZ_HIZ_RESOLVE;
       break;
-   case GEN6_HIZ_OP_DEPTH_CLEAR:
+   case BLORP_HIZ_OP_DEPTH_CLEAR:
       dw1 |= GEN8_WM_HZ_DEPTH_CLEAR;
       break;
-   case GEN6_HIZ_OP_NONE:
+   case BLORP_HIZ_OP_NONE:
       unreachable("Should not get here.");
    }
 
index 7ef6a1dd0aca3f2d77fa66a6b8b4b577edfafa4c..649c3db878040a5d5d3c454cbb5d436a1c63968a 100644 (file)
@@ -566,16 +566,16 @@ blorp_emit_ps_config(struct blorp_batch *batch,
 
    blorp_emit(batch, GENX(3DSTATE_WM), wm) {
       switch (params->hiz_op) {
-      case GEN6_HIZ_OP_DEPTH_CLEAR:
+      case BLORP_HIZ_OP_DEPTH_CLEAR:
          wm.DepthBufferClear = true;
          break;
-      case GEN6_HIZ_OP_DEPTH_RESOLVE:
+      case BLORP_HIZ_OP_DEPTH_RESOLVE:
          wm.DepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_HIZ_RESOLVE:
+      case BLORP_HIZ_OP_HIZ_RESOLVE:
          wm.HierarchicalDepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_NONE:
+      case BLORP_HIZ_OP_NONE:
          break;
       default:
          unreachable("not reached");
@@ -651,16 +651,16 @@ blorp_emit_ps_config(struct blorp_batch *batch,
          batch->blorp->isl_dev->info->max_wm_threads - 1;
 
       switch (params->hiz_op) {
-      case GEN6_HIZ_OP_DEPTH_CLEAR:
+      case BLORP_HIZ_OP_DEPTH_CLEAR:
          wm.DepthBufferClear = true;
          break;
-      case GEN6_HIZ_OP_DEPTH_RESOLVE:
+      case BLORP_HIZ_OP_DEPTH_RESOLVE:
          wm.DepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_HIZ_RESOLVE:
+      case BLORP_HIZ_OP_HIZ_RESOLVE:
          wm.HierarchicalDepthBufferResolveEnable = true;
          break;
-      case GEN6_HIZ_OP_NONE:
+      case BLORP_HIZ_OP_NONE:
          break;
       default:
          unreachable("not reached");
@@ -850,7 +850,7 @@ blorp_emit_depth_stencil_state(struct blorp_batch *batch,
       .DepthBufferWriteEnable = true,
    };
 
-   if (params->hiz_op == GEN6_HIZ_OP_DEPTH_RESOLVE) {
+   if (params->hiz_op == BLORP_HIZ_OP_DEPTH_RESOLVE) {
       ds.DepthTestEnable = true;
       ds.DepthTestFunction = COMPAREFUNCTION_NEVER;
    }
index c33d8fcbf2c0642d3db703d09b308b99cbf537a9..08beea86447bb73138285085918cf7f3d0600396 100644 (file)
@@ -2004,7 +2004,7 @@ intel_miptree_alloc_hiz(struct brw_context *brw,
          exec_node_init(&m->link);
          m->level = level;
          m->layer = layer;
-         m->need = GEN6_HIZ_OP_HIZ_RESOLVE;
+         m->need = BLORP_HIZ_OP_HIZ_RESOLVE;
 
          exec_list_push_tail(&mt->hiz_map, &m->link);
       }
@@ -2032,7 +2032,7 @@ intel_miptree_slice_set_needs_hiz_resolve(struct intel_mipmap_tree *mt,
       return;
 
    intel_resolve_map_set(&mt->hiz_map,
-                        level, layer, GEN6_HIZ_OP_HIZ_RESOLVE);
+                        level, layer, BLORP_HIZ_OP_HIZ_RESOLVE);
 }
 
 
@@ -2045,7 +2045,7 @@ intel_miptree_slice_set_needs_depth_resolve(struct intel_mipmap_tree *mt,
       return;
 
    intel_resolve_map_set(&mt->hiz_map,
-                        level, layer, GEN6_HIZ_OP_DEPTH_RESOLVE);
+                        level, layer, BLORP_HIZ_OP_DEPTH_RESOLVE);
 }
 
 void
@@ -2065,7 +2065,7 @@ intel_miptree_slice_resolve(struct brw_context *brw,
                            struct intel_mipmap_tree *mt,
                            uint32_t level,
                            uint32_t layer,
-                           enum gen6_hiz_op need)
+                           enum blorp_hiz_op need)
 {
    intel_miptree_check_level_layer(mt, level, layer);
 
@@ -2087,7 +2087,7 @@ intel_miptree_slice_resolve_hiz(struct brw_context *brw,
                                uint32_t layer)
 {
    return intel_miptree_slice_resolve(brw, mt, level, layer,
-                                     GEN6_HIZ_OP_HIZ_RESOLVE);
+                                     BLORP_HIZ_OP_HIZ_RESOLVE);
 }
 
 bool
@@ -2097,13 +2097,13 @@ intel_miptree_slice_resolve_depth(struct brw_context *brw,
                                  uint32_t layer)
 {
    return intel_miptree_slice_resolve(brw, mt, level, layer,
-                                     GEN6_HIZ_OP_DEPTH_RESOLVE);
+                                     BLORP_HIZ_OP_DEPTH_RESOLVE);
 }
 
 static bool
 intel_miptree_all_slices_resolve(struct brw_context *brw,
                                 struct intel_mipmap_tree *mt,
-                                enum gen6_hiz_op need)
+                                enum blorp_hiz_op need)
 {
    bool did_resolve = false;
 
@@ -2124,7 +2124,7 @@ intel_miptree_all_slices_resolve_hiz(struct brw_context *brw,
                                     struct intel_mipmap_tree *mt)
 {
    return intel_miptree_all_slices_resolve(brw, mt,
-                                          GEN6_HIZ_OP_HIZ_RESOLVE);
+                                          BLORP_HIZ_OP_HIZ_RESOLVE);
 }
 
 bool
@@ -2132,7 +2132,7 @@ intel_miptree_all_slices_resolve_depth(struct brw_context *brw,
                                       struct intel_mipmap_tree *mt)
 {
    return intel_miptree_all_slices_resolve(brw, mt,
-                                          GEN6_HIZ_OP_DEPTH_RESOLVE);
+                                          BLORP_HIZ_OP_DEPTH_RESOLVE);
 }
 
 
index e7d4de06a287dc2aad95777d10d43ee886e746c8..27dbfa49e030978177df4aa1a9ca64f549b65636 100644 (file)
@@ -1022,7 +1022,7 @@ intel_miptree_unmap(struct brw_context *brw,
 
 void
 intel_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
-              unsigned int level, unsigned int layer, enum gen6_hiz_op op);
+              unsigned int level, unsigned int layer, enum blorp_hiz_op op);
 
 #ifdef __cplusplus
 }
index 3df4b882b05427d4eb1544dbed79cfe06cad4fb2..26eac8bc65e89609006d5f26b7ca87f418158d07 100644 (file)
@@ -35,7 +35,7 @@ void
 intel_resolve_map_set(struct exec_list *resolve_map,
                      uint32_t level,
                      uint32_t layer,
-                     enum gen6_hiz_op need)
+                     enum blorp_hiz_op need)
 {
    foreach_list_typed(struct intel_resolve_map, map, link, resolve_map) {
       if (map->level == level && map->layer == layer) {
index 726b287722a1a803d1048155856bd024940004e9..672a4aaba7cfded15de5b6db44724515eae2a49c 100644 (file)
 #pragma once
 
 #include <stdint.h>
+#include "blorp.h"
 #include "compiler/glsl/list.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/**
- * 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,
-};
-
 /**
  * \brief Map of miptree slices to needed resolves.
  *
@@ -78,14 +62,14 @@ struct intel_resolve_map {
 
    uint32_t level;
    uint32_t layer;
-   enum gen6_hiz_op need;
+   enum blorp_hiz_op need;
 };
 
 void
 intel_resolve_map_set(struct exec_list *resolve_map,
                      uint32_t level,
                      uint32_t layer,
-                     enum gen6_hiz_op need);
+                     enum blorp_hiz_op need);
 
 struct intel_resolve_map *
 intel_resolve_map_get(struct exec_list *resolve_map,