- unsigned layout = ETNA_LAYOUT_LINEAR;
- if (etna_resource_sampler_only(templat)) {
- /* The buffer is only used for texturing, so create something
- * directly compatible with the sampler. Such a buffer can
- * never be rendered to. */
- layout = ETNA_LAYOUT_TILED;
-
- if (util_format_is_compressed(templat->format))
- layout = ETNA_LAYOUT_LINEAR;
- } else if (templat->target != PIPE_BUFFER) {
- bool want_multitiled = false;
- bool want_supertiled = screen->specs.can_supertile && !DBG_ENABLED(ETNA_DBG_NO_SUPERTILE);
-
- /* When this GPU supports single-buffer rendering, don't ever enable
- * multi-tiling. This replicates the blob behavior on GC3000.
- */
- if (!screen->specs.single_buffer)
- want_multitiled = screen->specs.pixel_pipes > 1;
-
- /* Keep single byte blocksized resources as tiled, since we
- * are unable to use the RS blit to de-tile them. However,
- * if they're used as a render target or depth/stencil, they
- * must be multi-tiled for GPUs with multiple pixel pipes.
- * Ignore depth/stencil here, but it is an error for a render
- * target.
- */
- if (util_format_get_blocksize(templat->format) == 1 &&
- !(templat->bind & PIPE_BIND_DEPTH_STENCIL)) {
- assert(!(templat->bind & PIPE_BIND_RENDER_TARGET && want_multitiled));
- want_multitiled = want_supertiled = false;
- }
-
- layout = ETNA_LAYOUT_BIT_TILE;
- if (want_multitiled)