Module: Mesa
Branch: main
Commit: 82f47acb1617728c8f045e529853e953970f18a9
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=82f47acb1617728c8f045e529853e953970f18a9

Author: Jianxun Zhang <[email protected]>
Date:   Wed Oct 25 07:14:52 2023 -0700

intel/vulkan: Remove private binding on fast clear region

To support modifiers with fast clear color, the region
should be able to export along with main surface, so we
remove the private binding in such case.

Signed-off-by: Jianxun Zhang <[email protected]>
Reviewed-by: Nanley Chery <[email protected]>
Acked-by: Rohan Garg <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25651>

---

 src/intel/vulkan/anv_image.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index b1bd87b7474..09c8b813a55 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -639,8 +639,12 @@ add_aux_state_tracking_buffer(struct anv_device *device,
     * processes with access to the memory may not be aware of it or of
     * its current state. So put that auxiliary data into a separate
     * buffer (ANV_IMAGE_MEMORY_BINDING_PRIVATE).
+    *
+    * But when the image is created with a drm modifier that supports
+    * clear color, it will be exported along with main surface.
     */
-   if (anv_image_is_externally_shared(image)) {
+   if (anv_image_is_externally_shared(image)
+       && 
!isl_drm_modifier_get_info(image->vk.drm_format_mod)->supports_clear_color) {
       binding = ANV_IMAGE_MEMORY_BINDING_PRIVATE;
    }
 
@@ -1117,8 +1121,12 @@ check_memory_bindings(const struct anv_device *device,
           * processes with access to the memory may not be aware of it or of
           * its current state. So put that auxiliary data into a separate
           * buffer (ANV_IMAGE_MEMORY_BINDING_PRIVATE).
+          *
+          * But when the image is created with a drm modifier that supports
+          * clear color, it will be exported along with main surface.
           */
-         if (anv_image_is_externally_shared(image)) {
+         if (anv_image_is_externally_shared(image)
+             && 
!isl_drm_modifier_get_info(image->vk.drm_format_mod)->supports_clear_color) {
             binding = ANV_IMAGE_MEMORY_BINDING_PRIVATE;
          }
 

Reply via email to