r600g/compute: Defer the creation of the temporary resource
authorBruno Jiménez <brunojimen@gmail.com>
Thu, 19 Jun 2014 18:20:02 +0000 (20:20 +0200)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 24 Jun 2014 16:37:36 +0000 (12:37 -0400)
commitc997007f66d402aea5a76da5b260b49a91c0fce1
tree91dc4bc9c7d21a43f2d220796094dcf7197ead90
parentfec2a08eae67806d47a435eca8395eb250ccddb4
r600g/compute: Defer the creation of the temporary resource

For the first use of a buffer, we will only need the temporary
resource in the case that a user wants to write/map to this buffer.

But in the cases where the user creates a buffer to act as an
output of a kernel, then we were creating an unneeded resource,
because it will contain garbage, and would be copied to the pool,
and destroyed when promoting.

This patch avoids the creation and copies of resources in
this case.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/drivers/r600/compute_memory_pool.c
src/gallium/drivers/r600/evergreen_compute.c