nir, glsl: move pixel_center_integer/origin_upper_left to shader_info.fs
[mesa.git] / src / intel / blorp / blorp.h
index a1dd57118bb9f18a2c999c889876cb214fe39c82..fd17f95c118ecad82adbbc28750fbcd11f2938ef 100644 (file)
@@ -45,10 +45,10 @@ struct blorp_context {
 
    const struct brw_compiler *compiler;
 
-   bool (*lookup_shader)(struct blorp_context *blorp,
+   bool (*lookup_shader)(struct blorp_batch *batch,
                          const void *key, uint32_t key_size,
                          uint32_t *kernel_out, void *prog_data_out);
-   bool (*upload_shader)(struct blorp_context *blorp,
+   bool (*upload_shader)(struct blorp_batch *batch,
                          const void *key, uint32_t key_size,
                          const void *kernel, uint32_t kernel_size,
                          const struct brw_stage_prog_data *prog_data,
@@ -72,6 +72,11 @@ enum blorp_batch_flags {
 
    /* This flag indicates that the blorp call should be predicated. */
    BLORP_BATCH_PREDICATE_ENABLE      = (1 << 1),
+
+   /* This flag indicates that blorp should *not* update the indirect clear
+    * color buffer.
+    */
+   BLORP_BATCH_NO_UPDATE_CLEAR_COLOR = (1 << 2),
 };
 
 struct blorp_batch {
@@ -86,8 +91,8 @@ void blorp_batch_finish(struct blorp_batch *batch);
 
 struct blorp_address {
    void *buffer;
+   uint64_t offset;
    unsigned reloc_flags;
-   uint32_t offset;
    uint32_t mocs;
 };
 
@@ -109,6 +114,19 @@ struct blorp_surf
     * that it contains a swizzle of RGBA and resource min LOD of 0.
     */
    struct blorp_address clear_color_addr;
+
+   /* Only allowed for simple 2D non-MSAA surfaces */
+   uint32_t tile_x_sa, tile_y_sa;
+};
+
+enum blorp_filter {
+   BLORP_FILTER_NONE,
+   BLORP_FILTER_NEAREST,
+   BLORP_FILTER_BILINEAR,
+   BLORP_FILTER_SAMPLE_0,
+   BLORP_FILTER_AVERAGE,
+   BLORP_FILTER_MIN_SAMPLE,
+   BLORP_FILTER_MAX_SAMPLE,
 };
 
 void
@@ -123,7 +141,8 @@ blorp_blit(struct blorp_batch *batch,
            float src_x1, float src_y1,
            float dst_x0, float dst_y0,
            float dst_x1, float dst_y1,
-           uint32_t filter, bool mirror_x, bool mirror_y);
+           enum blorp_filter filter,
+           bool mirror_x, bool mirror_y);
 
 void
 blorp_copy(struct blorp_batch *batch,
@@ -170,6 +189,17 @@ blorp_can_hiz_clear_depth(uint8_t gen, enum isl_format format,
                           uint32_t num_samples,
                           uint32_t x0, uint32_t y0,
                           uint32_t x1, uint32_t y1);
+void
+blorp_hiz_clear_depth_stencil(struct blorp_batch *batch,
+                              const struct blorp_surf *depth,
+                              const struct blorp_surf *stencil,
+                              uint32_t level,
+                              uint32_t start_layer, uint32_t num_layers,
+                              uint32_t x0, uint32_t y0,
+                              uint32_t x1, uint32_t y1,
+                              bool clear_depth, float depth_value,
+                              bool clear_stencil, uint8_t stencil_value);
+
 
 void
 blorp_gen8_hiz_clear_attachments(struct blorp_batch *batch,
@@ -189,19 +219,17 @@ blorp_clear_attachments(struct blorp_batch *batch,
                         bool clear_depth, float depth_value,
                         uint8_t stencil_mask, uint8_t stencil_value);
 
-enum blorp_fast_clear_op {
-   BLORP_FAST_CLEAR_OP_NONE = 0,
-   BLORP_FAST_CLEAR_OP_CLEAR,
-   BLORP_FAST_CLEAR_OP_RESOLVE_PARTIAL,
-   BLORP_FAST_CLEAR_OP_RESOLVE_FULL,
-};
-
 void
 blorp_ccs_resolve(struct blorp_batch *batch,
                   struct blorp_surf *surf, uint32_t level,
                   uint32_t start_layer, uint32_t num_layers,
                   enum isl_format format,
-                  enum blorp_fast_clear_op resolve_op);
+                  enum isl_aux_op resolve_op);
+
+void
+blorp_ccs_ambiguate(struct blorp_batch *batch,
+                    struct blorp_surf *surf,
+                    uint32_t level, uint32_t layer);
 
 void
 blorp_mcs_partial_resolve(struct blorp_batch *batch,
@@ -209,27 +237,10 @@ blorp_mcs_partial_resolve(struct blorp_batch *batch,
                           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:
- *   - 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_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);
+             enum isl_aux_op op);
 
 #ifdef __cplusplus
 } /* end extern "C" */