[Mesa-dev] [RFC 0/3] Flesh out DiscardFramebuffer and InvalidateFramebuffer
robdclark at gmail.com
Sun Aug 16 11:56:21 PDT 2015
From: Rob Clark <robclark at freedesktop.org>
Currently, these extension entry points were implemented, but other than
error-checking, they were no-op. (Technically, DiscardFramebuffer had a
driver hook, but no one implemented it.) So refactor the driver API
slightly, and turn these all into calls to DiscardTexture, which in
gallium is now wired up to pipe->invalidate_resource().
NOTE: currently vc4 is the only one implementing ->invalidate_resource()
and to fully take advantage of this, I think it's implementation would
want some tweaks (but this shouldn't break vc4's existing implementation,
afaict). I'll wire this up for freedreno in the near future, but wanted
to send this out as an RFC for now to get early feedback.
NOTE: seems like it should be also possible for radeon/nouveau to take
advantage of pipe->invalidate_resource() to bypass some vram migration.
Although I don't know enough about the existing kernel APIs to suggest
how that might be done. Anyways, seems like the sort of optimization
that would benefit dGPU's in addition to tilers.
Rob Clark (3):
mesa: Driver.DiscardFramebuffer -> Driver.DiscardTexture
mesa: hook up DiscardTexture for InvalidateFramebuffer and friends
mesa/st: wire up DiscardTexture
src/mesa/drivers/common/driverfuncs.c | 2 +-
src/mesa/main/dd.h | 6 ++---
src/mesa/main/fbobject.c | 42 ++++++++++++++++++++++++++++++-----
src/mesa/state_tracker/st_cb_fbo.c | 12 ++++++++++
4 files changed, 53 insertions(+), 9 deletions(-)
More information about the mesa-dev