#include <assert.h>
#include "main/mtypes.h"
+#include "isl/isl.h"
#include "intel_bufmgr.h"
#include "intel_resolve_map.h"
#include <GL/internal/dri_interface.h>
*/
struct intel_mipmap_tree *stencil_mt;
+ /**
+ * \brief Stencil texturing miptree for sampling from a stencil texture
+ *
+ * Some hardware doesn't support sampling from the stencil texture as
+ * required by the GL_ARB_stencil_texturing extenion. To workaround this we
+ * blit the texture into a new texture that can be sampled.
+ *
+ * \see intel_update_r8stencil()
+ */
+ struct intel_mipmap_tree *r8stencil_mt;
+ bool r8stencil_needs_update;
+
/**
* \brief MCS miptree.
*
*/
struct intel_mipmap_tree *mcs_mt;
+ /**
+ * Planes 1 and 2 in case this is a planar surface.
+ */
+ struct intel_mipmap_tree *plane[2];
+
/**
* Fast clear state for this buffer.
*/
* The SURFACE_STATE bits associated with the last fast color clear to this
* color mipmap tree, if any.
*
- * This value will only ever contain ones in bits 28-31, so it is safe to
- * OR into dword 7 of SURFACE_STATE.
+ * Prior to GEN9 there is a single bit for RGBA clear values which gives you
+ * the option of 2^4 clear colors. Each bit determines if the color channel
+ * is fully saturated or unsaturated (Cherryview does add a 32b value per
+ * channel, but it is globally applied instead of being part of the render
+ * surface state). Starting with GEN9, the surface state accepts a 32b value
+ * for each color channel.
*
* @see RENDER_SURFACE_STATE.RedClearColor
* @see RENDER_SURFACE_STATE.GreenClearColor
* @see RENDER_SURFACE_STATE.BlueClearColor
* @see RENDER_SURFACE_STATE.AlphaClearColor
*/
- uint32_t fast_clear_color_value;
+ union {
+ uint32_t fast_clear_color_value;
+ union gl_color_union gen9_fast_clear_color;
+ };
/**
* Disable allocation of auxiliary buffers, such as the HiZ buffer and MCS
*/
bool disable_aux_buffers;
+ /**
+ * Tells if the underlying buffer is to be also consumed by entities other
+ * than the driver. This allows logic to turn off features such as lossless
+ * compression which is not currently understood by client applications.
+ */
+ bool is_scanout;
+
/* These are also refcounted:
*/
GLuint refcount;
};
void
-intel_get_non_msrt_mcs_alignment(struct intel_mipmap_tree *mt,
+intel_get_non_msrt_mcs_alignment(const struct intel_mipmap_tree *mt,
unsigned *width_px, unsigned *height);
+
+bool
+intel_miptree_is_lossless_compressed(const struct brw_context *brw,
+ const struct intel_mipmap_tree *mt);
+
bool
-intel_tiling_supports_non_msrt_mcs(struct brw_context *brw, unsigned tiling);
+intel_tiling_supports_non_msrt_mcs(const struct brw_context *brw,
+ unsigned tiling);
+
bool
-intel_miptree_is_fast_clear_capable(struct brw_context *brw,
- struct intel_mipmap_tree *mt);
+intel_miptree_supports_non_msrt_fast_clear(struct brw_context *brw,
+ const struct intel_mipmap_tree *mt);
+
+bool
+intel_miptree_supports_lossless_compressed(struct brw_context *brw,
+ const struct intel_mipmap_tree *mt);
+
bool
intel_miptree_alloc_non_msrt_mcs(struct brw_context *brw,
- struct intel_mipmap_tree *mt);
+ struct intel_mipmap_tree *mt,
+ bool is_lossless_compressed);
enum {
MIPTREE_LAYOUT_ACCELERATED_UPLOAD = 1 << 0,
MIPTREE_LAYOUT_TILING_NONE = 1 << 6,
MIPTREE_LAYOUT_TILING_ANY = MIPTREE_LAYOUT_TILING_Y |
MIPTREE_LAYOUT_TILING_NONE,
+
+ MIPTREE_LAYOUT_FOR_SCANOUT = 1 << 7,
};
struct intel_mipmap_tree *intel_miptree_create(struct brw_context *brw,
GLuint level, GLuint slice,
GLuint *x, GLuint *y);
+enum isl_surf_dim
+get_isl_surf_dim(GLenum target);
+
+enum isl_dim_layout
+get_isl_dim_layout(const struct gen_device_info *devinfo, uint32_t tiling,
+ GLenum target);
+
+void
+intel_miptree_get_isl_surf(struct brw_context *brw,
+ const struct intel_mipmap_tree *mt,
+ struct isl_surf *surf);
+void
+intel_miptree_get_aux_isl_surf(struct brw_context *brw,
+ const struct intel_mipmap_tree *mt,
+ struct isl_surf *surf,
+ enum isl_aux_usage *usage);
+
+union isl_color_value
+intel_miptree_get_isl_clear_color(struct brw_context *brw,
+ const struct intel_mipmap_tree *mt);
+
void
intel_get_image_dims(struct gl_texture_image *image,
int *width, int *height, int *depth);
void
intel_get_tile_masks(uint32_t tiling, uint32_t tr_mode, uint32_t cpp,
- bool map_stencil_as_y_tiled,
uint32_t *mask_x, uint32_t *mask_y);
void
mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_UNRESOLVED;
}
-void
+/**
+ * Flag values telling color resolve pass which special types of buffers
+ * can be ignored.
+ *
+ * INTEL_MIPTREE_IGNORE_CCS_E: Lossless compressed (single-sample
+ * compression scheme since gen9)
+ */
+#define INTEL_MIPTREE_IGNORE_CCS_E (1 << 0)
+
+bool
intel_miptree_resolve_color(struct brw_context *brw,
- struct intel_mipmap_tree *mt);
+ struct intel_mipmap_tree *mt,
+ int flags);
void
intel_miptree_make_shareable(struct brw_context *brw,
struct intel_mipmap_tree *src,
struct intel_mipmap_tree *dst);
+void
+intel_update_r8stencil(struct brw_context *brw,
+ struct intel_mipmap_tree *mt);
+
/**
* Horizontal distance from one slice to the next in the two-dimensional
* miptree layout.
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
}