mt->logical_depth0,
true,
num_samples,
- false /* force_y_tiling */);
+ INTEL_MIPTREE_TILING_ANY);
if (!mt->stencil_mt) {
intel_miptree_release(&mt);
return NULL;
gl_format format,
uint32_t width0,
uint32_t num_samples,
- bool force_y_tiling,
+ enum intel_miptree_tiling_mode requested,
struct intel_mipmap_tree *mt)
{
return I915_TILING_NONE;
}
- if (force_y_tiling)
+ /* Some usages may want only one type of tiling, like depth miptrees (Y
+ * tiled), or temporary BOs for uploading data once (linear).
+ */
+ switch (requested) {
+ case INTEL_MIPTREE_TILING_ANY:
+ break;
+ case INTEL_MIPTREE_TILING_Y:
return I915_TILING_Y;
+ case INTEL_MIPTREE_TILING_NONE:
+ return I915_TILING_NONE;
+ }
if (num_samples > 1) {
/* From p82 of the Sandy Bridge PRM, dw3[1] of SURFACE_STATE ("Tiled
GLuint depth0,
bool expect_accelerated_upload,
GLuint num_samples,
- bool force_y_tiling)
+ enum intel_miptree_tiling_mode requested_tiling)
{
struct intel_mipmap_tree *mt;
gl_format tex_format = format;
}
uint32_t tiling = intel_miptree_choose_tiling(intel, format, width0,
- num_samples, force_y_tiling,
+ num_samples, requested_tiling,
mt);
bool y_or_x = tiling == (I915_TILING_Y | I915_TILING_X);
mt = intel_miptree_create(intel, GL_TEXTURE_2D, format, 0, 0,
width, height, depth, true, num_samples,
- false /* force_y_tiling */);
+ INTEL_MIPTREE_TILING_ANY);
if (!mt)
goto fail;
mt->logical_depth0,
true,
0 /* num_samples */,
- true /* force_y_tiling */);
+ INTEL_MIPTREE_TILING_Y);
/* From the Ivy Bridge PRM, Vol 2 Part 1 p326:
*
mt->logical_depth0,
true,
mt->num_samples,
- false /* force_y_tiling */);
+ INTEL_MIPTREE_TILING_ANY);
if (!mt->hiz_mt)
return false;
GLuint refcount;
};
-
+enum intel_miptree_tiling_mode {
+ INTEL_MIPTREE_TILING_ANY,
+ INTEL_MIPTREE_TILING_Y,
+ INTEL_MIPTREE_TILING_NONE,
+};
struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
GLenum target,
GLuint depth0,
bool expect_accelerated_upload,
GLuint num_samples,
- bool force_y_tiling);
+ enum intel_miptree_tiling_mode);
struct intel_mipmap_tree *
intel_miptree_create_layout(struct intel_context *intel,