From: Rob Clark <robcl...@freedesktop.org>

Turn it into call to optional pipe->invalidate_resource().

Signed-off-by: Rob Clark <robcl...@freedesktop.org>
---
 src/mesa/state_tracker/st_cb_fbo.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c 
b/src/mesa/state_tracker/st_cb_fbo.c
index 5707590..597dbf4 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -833,7 +833,17 @@ st_UnmapRenderbuffer(struct gl_context *ctx,
    strb->transfer = NULL;
 }
 
+static void
+st_DiscardTexture(struct gl_context *ctx,
+                  struct gl_framebuffer *fb,
+                  struct gl_renderbuffer_attachment *att)
+{
+   struct st_context *st = st_context(ctx);
+   struct pipe_resource *pt = st_get_texobj_resource(att->Texture);
 
+   if (st->pipe->invalidate_resource && pt)
+      st->pipe->invalidate_resource(st->pipe, pt);
+}
 
 void st_init_fbo_functions(struct dd_function_table *functions)
 {
@@ -850,6 +860,8 @@ void st_init_fbo_functions(struct dd_function_table 
*functions)
 
    functions->MapRenderbuffer = st_MapRenderbuffer;
    functions->UnmapRenderbuffer = st_UnmapRenderbuffer;
+
+   functions->DiscardTexture = st_DiscardTexture;
 }
 
 
-- 
2.4.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to