Module: Mesa
Branch: master
Commit: 30853f55a3b4c409802ac470ae0530311c36e0c7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=30853f55a3b4c409802ac470ae0530311c36e0c7

Author: Philipp Zabel <[email protected]>
Date:   Thu Jan 19 15:05:36 2017 +0100

gallium: add pipe_screen::resource_changed

Add a hook to tell drivers that an imported resource may have changed
and they need to update their internal derived resources.

Signed-off-by: Philipp Zabel <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>

---

 src/gallium/docs/source/screen.rst  | 14 ++++++++++++++
 src/gallium/include/pipe/p_screen.h |  8 ++++++++
 2 files changed, 22 insertions(+)

diff --git a/src/gallium/docs/source/screen.rst 
b/src/gallium/docs/source/screen.rst
index 64cb0bf..5ae2596 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -707,6 +707,20 @@ which isn't multisampled.
 
 
 
+resource_changed
+^^^^^^^^^^^^^^^^
+
+Mark a resource as changed so derived internal resources will be recreated
+on next use.
+
+When importing external images that can't be directly used as texture sampler
+source, internal copies may have to be created that the hardware can sample
+from. When those resources are reimported, the image data may have changed, and
+the previously derived internal resources must be invalidated to avoid sampling
+from old copies.
+
+
+
 resource_destroy
 ^^^^^^^^^^^^^^^^
 
diff --git a/src/gallium/include/pipe/p_screen.h 
b/src/gallium/include/pipe/p_screen.h
index f04c2ed..b6203f1 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -224,6 +224,14 @@ struct pipe_screen {
                                  struct winsys_handle *handle,
                                  unsigned usage);
 
+   /**
+    * Mark the resource as changed so derived internal resources will be
+    * recreated on next use.
+    *
+    * This is necessary when reimporting external images that can't be directly
+    * used as texture sampler source, to avoid sampling from old copies.
+    */
+   void (*resource_changed)(struct pipe_screen *, struct pipe_resource *pt);
 
    void (*resource_destroy)(struct pipe_screen *,
                            struct pipe_resource *pt);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to