[Mesa-dev] [PATCH] [RFC] r600g: improve flushed depth texture allocation

Marek Olšák maraeo at gmail.com
Sun Jun 24 08:43:36 PDT 2012


Hi Vadim,

This is:

Reviewed-by: Marek Olšák <maraeo at gmail.com>

I'd like to point out an issue here, which has nothing to do with your
patch, just so you know.

Flushing in create_sampler_view is wrong. Some people have been
wondering why depth flushes are not realiable while there is such
an obvious mistake right in front of them. create_sampler_view has
nothing to do with rendering. The only thing we know for sure is that
create_sampler_view is called sometime before the sampler view is used
(obviously), but it can be called anytime, even at context creation.
The correct place where the depth buffer should be flushed is
set_*_sampler_views (or anytime before the next drawing operation).

Marek

On Sun, Jun 24, 2012 at 3:43 PM, Vadim Girlin <vadimgirlin at gmail.com> wrote:
> Allocate flushed depth texture in the VRAM if we aren't going to access it by
> CPU. If we need CPU access later, then it'll be reallocated in the GTT.
> Currently it's not reallocated in the opposite direction (GTT->VRAM), though
> probably we might want to do it too. Anyway, it helps the apps that don't need
> to access flushed depth texture by CPU at all, e.g. Lightsmark.
>
> Improves performance for Lightsmark.
>
> Signed-off-by: Vadim Girlin <vadimgirlin at gmail.com>
> ---
>
> No regressions on evergreen, also it somehow fixes fbo-clear-formats and
> fbo-generate-mipmap-formats, that were failing on depth/stencil formats.
>
>  src/gallium/drivers/r600/evergreen_state.c |    5 +++--
>  src/gallium/drivers/r600/r600_blit.c       |    2 +-
>  src/gallium/drivers/r600/r600_resource.h   |    3 ++-
>  src/gallium/drivers/r600/r600_state.c      |    2 +-
>  src/gallium/drivers/r600/r600_texture.c    |   31 ++++++++++++++++++++--------
>  5 files changed, 29 insertions(+), 14 deletions(-)


More information about the mesa-dev mailing list