GLuint height0,
GLuint depth0,
GLuint num_samples,
- uint32_t layout_flags)
+ enum intel_miptree_create_flags flags)
{
if (format == MESA_FORMAT_S_UINT8)
return make_surface(brw, target, format, first_level, last_level,
const GLenum base_format = _mesa_get_format_base_format(format);
if ((base_format == GL_DEPTH_COMPONENT ||
base_format == GL_DEPTH_STENCIL) &&
- !(layout_flags & MIPTREE_LAYOUT_TILING_NONE)) {
+ !(flags & MIPTREE_CREATE_LINEAR)) {
/* Fix up the Z miptree format for how we're splitting out separate
* stencil. Gen7 expects there to be no stencil bits in its depth buffer.
*/
return NULL;
}
- if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX))
+ if (!(flags & MIPTREE_CREATE_NO_AUX))
intel_miptree_choose_aux_usage(brw, mt);
return mt;
etc_format = (format != tex_format) ? tex_format : MESA_FORMAT_NONE;
- if (layout_flags & MIPTREE_LAYOUT_ACCELERATED_UPLOAD)
+ if (flags & MIPTREE_CREATE_BUSY)
alloc_flags |= BO_ALLOC_FOR_RENDER;
- isl_tiling_flags_t tiling_flags =
- (layout_flags & MIPTREE_LAYOUT_TILING_NONE) ?
+ isl_tiling_flags_t tiling_flags = (flags & MIPTREE_CREATE_LINEAR) ?
ISL_TILING_LINEAR_BIT : ISL_TILING_ANY_MASK;
/* TODO: This used to be because there wasn't BLORP to handle Y-tiling. */
mt->etc_format = etc_format;
- if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX))
+ if (!(flags & MIPTREE_CREATE_NO_AUX))
intel_miptree_choose_aux_usage(brw, mt);
return mt;
GLuint height0,
GLuint depth0,
GLuint num_samples,
- uint32_t layout_flags)
+ enum intel_miptree_create_flags flags)
{
assert(num_samples > 0);
brw, target, format,
first_level, last_level,
width0, height0, depth0, num_samples,
- layout_flags);
+ flags);
if (!mt)
return NULL;
uint32_t height,
uint32_t depth,
int pitch,
- uint32_t layout_flags)
+ enum intel_miptree_create_flags flags)
{
struct intel_mipmap_tree *mt;
uint32_t tiling, swizzle;
brw_bo_reference(bo);
- if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX))
+ if (!(flags & MIPTREE_CREATE_NO_AUX))
intel_miptree_choose_aux_usage(brw, mt);
return mt;
/* The BO already has a tiling format and we shouldn't confuse the lower
* layers by making it try to find a tiling format again.
*/
- assert((layout_flags & MIPTREE_LAYOUT_TILING_NONE) == 0);
+ assert((flags & MIPTREE_CREATE_LINEAR) == 0);
mt = make_surface(brw, target, format,
0, 0, width, height, depth, 1,
mt->bo = bo;
mt->offset = offset;
- if (!(layout_flags & MIPTREE_LAYOUT_DISABLE_AUX)) {
+ if (!(flags & MIPTREE_CREATE_NO_AUX)) {
intel_miptree_choose_aux_usage(brw, mt);
if (!intel_miptree_alloc_aux(brw, mt)) {
image->offsets[index],
width, height, 1,
image->strides[index],
- MIPTREE_LAYOUT_DISABLE_AUX);
+ MIPTREE_CREATE_NO_AUX);
if (mt == NULL)
return NULL;
* have the opportunity to do resolves. Window system buffers also may be
* used for scanout so we need to flag that appropriately.
*/
- const uint32_t mt_layout_flags =
- is_winsys_image ? 0 : MIPTREE_LAYOUT_DISABLE_AUX;
+ const enum intel_miptree_create_flags mt_create_flags =
+ is_winsys_image ? 0 : MIPTREE_CREATE_NO_AUX;
/* Disable creation of the texture's aux buffers because the driver exposes
* no EGL API to manage them. That is, there is no API for resolving the aux
struct intel_mipmap_tree *mt =
intel_miptree_create_for_bo(brw, image->bo, format,
image->offset, image->width, image->height, 1,
- image->pitch, mt_layout_flags);
+ image->pitch, mt_create_flags);
if (mt == NULL)
return NULL;
struct intel_mipmap_tree *mt;
uint32_t depth = 1;
GLenum target = num_samples > 1 ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
- const uint32_t layout_flags = MIPTREE_LAYOUT_ACCELERATED_UPLOAD;
mt = intel_miptree_create(brw, target, format, 0, 0,
width, height, depth, num_samples,
- layout_flags);
+ MIPTREE_CREATE_BUSY);
if (!mt)
goto fail;
/* last_level */ 0,
map->w, map->h, 1,
/* samples */ 1,
- MIPTREE_LAYOUT_TILING_NONE);
+ MIPTREE_CREATE_LINEAR);
if (!map->linear_mt) {
fprintf(stderr, "Failed to allocate blit temporary\n");
intel_miptree_alloc_ccs(struct brw_context *brw,
struct intel_mipmap_tree *mt);
-enum {
- MIPTREE_LAYOUT_ACCELERATED_UPLOAD = 1 << 0,
- MIPTREE_LAYOUT_DISABLE_AUX = 1 << 3,
+enum intel_miptree_create_flags {
+ /** No miptree create flags */
+ MIPTREE_CREATE_DEFAULT = 0,
- MIPTREE_LAYOUT_TILING_NONE = 1 << 6,
+ /** Miptree creation should try to allocate a currently busy BO
+ *
+ * This may be advantageous if we know the next thing to touch the BO will
+ * be the GPU because the BO will likely already be in the GTT and maybe
+ * even in some caches. If there is a chance that the next thing to touch
+ * the miptree BO will be the CPU, this flag should not be set.
+ */
+ MIPTREE_CREATE_BUSY = 1 << 0,
+
+ /** Create a linear (not tiled) miptree */
+ MIPTREE_CREATE_LINEAR = 1 << 1,
+
+ /** Create the miptree with auxiliary compression disabled
+ *
+ * This does not prevent the caller of intel_miptree_create from coming
+ * along later and turning auxiliary compression back on but it does mean
+ * that the miptree will be created with mt->aux_usage == NONE.
+ */
+ MIPTREE_CREATE_NO_AUX = 1 << 2,
};
struct intel_mipmap_tree *intel_miptree_create(struct brw_context *brw,
GLuint height0,
GLuint depth0,
GLuint num_samples,
- uint32_t flags);
+ enum intel_miptree_create_flags flags);
struct intel_mipmap_tree *
intel_miptree_create_for_bo(struct brw_context *brw,
uint32_t height,
uint32_t depth,
int pitch,
- uint32_t layout_flags);
+ enum intel_miptree_create_flags flags);
struct intel_mipmap_tree *
intel_miptree_create_for_dri_image(struct brw_context *brw,