intel/blorp: Add initial support for indirect clear colors
[mesa.git] / src / intel / blorp / blorp.h
index eab75d70ab97ddd34717a8d6df3a27fdce9715d1..6027076afd0bdfb7a62d19d91c681205320611ef 100644 (file)
@@ -45,12 +45,6 @@ struct blorp_context {
 
    const struct brw_compiler *compiler;
 
-   struct {
-      uint32_t tex;
-      uint32_t rb;
-      uint32_t vb;
-   } mocs;
-
    bool (*lookup_shader)(struct blorp_context *blorp,
                          const void *key, uint32_t key_size,
                          uint32_t *kernel_out, void *prog_data_out);
@@ -75,6 +69,9 @@ enum blorp_batch_flags {
     * hardware.
     */
    BLORP_BATCH_NO_EMIT_DEPTH_STENCIL = (1 << 0),
+
+   /* This flag indicates that the blorp call should be predicated. */
+   BLORP_BATCH_PREDICATE_ENABLE      = (1 << 1),
 };
 
 struct blorp_batch {
@@ -89,9 +86,9 @@ void blorp_batch_finish(struct blorp_batch *batch);
 
 struct blorp_address {
    void *buffer;
-   uint32_t read_domains;
-   uint32_t write_domain;
+   unsigned reloc_flags;
    uint32_t offset;
+   uint32_t mocs;
 };
 
 struct blorp_surf
@@ -104,6 +101,14 @@ struct blorp_surf
    enum isl_aux_usage aux_usage;
 
    union isl_color_value clear_color;
+
+   /**
+    * If set (bo != NULL), clear_color is ignored and the actual clear color
+    * is fetched from this address.  On gen7-8, this is all of dword 7 of
+    * RENDER_SURFACE_STATE and is the responsibility of the caller to ensure
+    * that it contains a swizzle of RGBA and resource min LOD of 0.
+    */
+   struct blorp_address clear_color_addr;
 };
 
 void
@@ -130,6 +135,12 @@ blorp_copy(struct blorp_batch *batch,
            uint32_t dst_x, uint32_t dst_y,
            uint32_t src_width, uint32_t src_height);
 
+void
+blorp_buffer_copy(struct blorp_batch *batch,
+                  struct blorp_address src,
+                  struct blorp_address dst,
+                  uint64_t size);
+
 void
 blorp_fast_clear(struct blorp_batch *batch,
                  const struct blorp_surf *surf, enum isl_format format,
@@ -191,6 +202,23 @@ blorp_ccs_resolve(struct blorp_batch *batch,
                   enum isl_format format,
                   enum blorp_fast_clear_op resolve_op);
 
+/* Resolves subresources of the image subresource range specified in the
+ * binding table.
+ */
+void
+blorp_ccs_resolve_attachment(struct blorp_batch *batch,
+                             const uint32_t binding_table_offset,
+                             struct blorp_surf * const surf,
+                             const uint32_t level, const uint32_t num_layers,
+                             const enum isl_format format,
+                             const enum blorp_fast_clear_op resolve_op);
+
+void
+blorp_mcs_partial_resolve(struct blorp_batch *batch,
+                          struct blorp_surf *surf,
+                          enum isl_format format,
+                          uint32_t start_layer, uint32_t num_layers);
+
 /**
  * For an overview of the HiZ operations, see the following sections of the
  * Sandy Bridge PRM, Volume 1, Part2:
@@ -209,9 +237,9 @@ enum blorp_hiz_op {
 };
 
 void
-blorp_gen6_hiz_op(struct blorp_batch *batch,
-                  struct blorp_surf *surf, unsigned level, unsigned layer,
-                  enum blorp_hiz_op op);
+blorp_hiz_op(struct blorp_batch *batch, struct blorp_surf *surf,
+             uint32_t level, uint32_t start_layer, uint32_t num_layers,
+             enum blorp_hiz_op op);
 
 #ifdef __cplusplus
 } /* end extern "C" */