diff options
author | Ilia Mirkin <[email protected]> | 2015-11-20 18:34:03 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-11-20 19:46:21 -0500 |
commit | fe29330406f8ea277b2c02f9c6dd2da78796ea84 (patch) | |
tree | 1ba00808c30fdf4bed22e82219eae0ef408e289b /src/gallium/drivers/freedreno/freedreno_resource.c | |
parent | 39fa5c8419076f6ec84de0252905617feb70f279 (diff) |
freedreno/a4xx: use hardware RGTC texture samplers
a4xx hardware has real support for RGTC so there's no need to fake it
like we do on a3xx. Undo the hacks, and keep track of an "internal
format" of a resource, which on a3xx will be different, triggering the
transfer-time conversions to take place.
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_resource.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 5b1cee8d18d..43b818f4014 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -388,7 +388,8 @@ fd_resource_transfer_map(struct pipe_context *pctx, buf = trans->staging; offset = 0; - } else if (util_format_description(format)->layout == UTIL_FORMAT_LAYOUT_RGTC) { + } else if (rsc->internal_format != format && + util_format_description(format)->layout == UTIL_FORMAT_LAYOUT_RGTC) { assert(trans->base.box.depth == 1); trans->base.stride = util_format_get_stride( @@ -574,9 +575,10 @@ fd_resource_create(struct pipe_screen *pscreen, if (format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) format = PIPE_FORMAT_Z32_FLOAT; - else if (util_format_description(format)->layout == - UTIL_FORMAT_LAYOUT_RGTC) + else if (fd_screen(pscreen)->gpu_id < 400 && + util_format_description(format)->layout == UTIL_FORMAT_LAYOUT_RGTC) format = PIPE_FORMAT_R8G8B8A8_UNORM; + rsc->internal_format = format; rsc->cpp = util_format_get_blocksize(format); assert(rsc->cpp); |