diff options
author | Kenneth Graunke <[email protected]> | 2019-04-23 20:19:37 -0700 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2019-08-26 09:58:42 +0000 |
commit | 4d3dc926280507f32e71145b5ac71bf06c5bd39b (patch) | |
tree | f6b626e61f32875569a5199d844f62163555de9b /src | |
parent | 4f4a38289b9477b28a9f79ca0ab06debc5e86030 (diff) |
iris: Drop copy format hacks from copy region based transfer path.
This doesn't work for compressed formats, as the source texture and
temporary texture would have different block sizes. (Forcing the driver
to always take the GPU path would expose the bug.) Instead, just use
the source format for the temporary, and let blorp_copy deal with
overrides.
The one case where we can't do this is ASTC, because isl won't let us
create a linear ASTC surface. Fall back to the CPU paths there for now.
Fixes: 9d1334d2a0f ("iris: Use copy_region and staging resources to avoid transfer stalls")
Reviewed-by: Rafael Antognolli <[email protected]>
(cherry picked from commit 136629a1e3aace12297ff61c2ee32caa21aba99b)
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/iris/iris_resource.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 3770c96d6f2..343339685b7 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -1003,6 +1003,7 @@ iris_map_copy_region(struct iris_transfer *map) .nr_samples = xfer->resource->nr_samples, .nr_storage_samples = xfer->resource->nr_storage_samples, .array_size = box->depth, + .format = res->internal_format, }; if (xfer->resource->target == PIPE_BUFFER) @@ -1012,22 +1013,6 @@ iris_map_copy_region(struct iris_transfer *map) else templ.target = PIPE_TEXTURE_2D; - /* Depth, stencil, and ASTC can't be linear surfaces, so we can't use - * xfer->resource->format directly. Pick a bpb compatible format so - * resource creation will succeed; blorp_copy will override it anyway. - */ - switch (util_format_get_blocksizebits(res->internal_format)) { - case 8: templ.format = PIPE_FORMAT_R8_UINT; break; - case 16: templ.format = PIPE_FORMAT_R8G8_UINT; break; - case 24: templ.format = PIPE_FORMAT_R8G8B8_UINT; break; - case 32: templ.format = PIPE_FORMAT_R8G8B8A8_UINT; break; - case 48: templ.format = PIPE_FORMAT_R16G16B16_UINT; break; - case 64: templ.format = PIPE_FORMAT_R16G16B16A16_UINT; break; - case 96: templ.format = PIPE_FORMAT_R32G32B32_UINT; break; - case 128: templ.format = PIPE_FORMAT_R32G32B32A32_UINT; break; - default: unreachable("Invalid bpb"); - } - map->staging = iris_resource_create(pscreen, &templ); assert(map->staging); @@ -1443,6 +1428,10 @@ iris_transfer_map(struct pipe_context *ctx, no_gpu = true; } + const struct isl_format_layout *fmtl = isl_format_get_layout(surf->format); + if (fmtl->txc == ISL_TXC_ASTC) + no_gpu = true; + if ((map_would_stall || res->aux.usage == ISL_AUX_USAGE_CCS_E) && !no_gpu) { /* If we need a synchronous mapping and the resource is busy, * we copy to/from a linear temporary buffer using the GPU. |