OSDN Git Service

radeon: re-prepare query buffers on begin_query for predicate queries
authorNicolai Hähnle <nhaehnle@gmail.com>
Fri, 20 Nov 2015 11:58:55 +0000 (12:58 +0100)
committerNicolai Hähnle <nhaehnle@gmail.com>
Fri, 20 Nov 2015 21:46:11 +0000 (22:46 +0100)
commit5bda3d0958967b88e739302a480499d1428a0b2a
tree6e29fde9faee5131e416ff404f8f0d970049b138
parent6f4fe8e76ada4cd04f20d37825d7763fcc2b62ae
radeon: re-prepare query buffers on begin_query for predicate queries

The point of prepare_buffer is to ensure that the query buffer contains valid
initial data for conditional rendering: as long as the buffer is initialized
correctly, the GPU is able to tell whether query results have been written
already (and wait or fall back to unconditional rendering if desired).

This means prepare_buffer needs to be called again when a buffer is reused.

Conversely, for queries that cannot be used for conditional rendering
(notably pipeline statistics), we can re-use buffers immediately, and they
do not need to be initialized.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Andy Furniss <adf.lists@gmail.com>
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeon/r600_query.h