etnaviv: keep track of buffer valid ranges for PIPE_BUFFER
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 6 Sep 2019 13:13:51 +0000 (15:13 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Sun, 20 Oct 2019 09:03:06 +0000 (09:03 +0000)
commita6de05a968dafc2f677df86376deb78ddce421e3
tree3000988d7c5d50e9ad8d08d3c19d24f617beed87
parenteab6d75066463365fb89f99ad6185e462ecb33ea
etnaviv: keep track of buffer valid ranges for PIPE_BUFFER

This allows a write to proceed to an uninitialized part of a buffer
even when the GPU is using the previously-initialized portions.

Such a situation can be triggered with the following API usage example:

  glBufferSubData(..., offset, size, data1);
  glDrawArrays(...);
  // append new vertex data
  glBufferSubData(..., offset+size, size, data2);
  glDrawArrays(...);

Same is done for freedreno, nouveau and radeon.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/drivers/etnaviv/etnaviv_resource.c
src/gallium/drivers/etnaviv/etnaviv_resource.h
src/gallium/drivers/etnaviv/etnaviv_transfer.c