zink: handle swapchain handoffs around makecurrent
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 11 Apr 2023 21:05:52 +0000 (17:05 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 12 Apr 2023 21:43:35 +0000 (21:43 +0000)
when a new resource is created for an extant swapchain, the existing
acquire (if any) should be transferred to the resource to ensure
expected behavior

this should be enough to fix piglit's glx-make-current

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22431>

src/gallium/drivers/zink/ci/zink-anv-tgl-fails.txt
src/gallium/drivers/zink/ci/zink-lvp-skips.txt
src/gallium/drivers/zink/ci/zink-radv-navi10-fails.txt
src/gallium/drivers/zink/ci/zink-radv-vangogh-fails.txt
src/gallium/drivers/zink/zink_resource.c

index 5c02ab04e024b2d47344390ca28d1742e9c20f6e..e9c7935336997c7c3709fb64cac8d60c131029b6 100644 (file)
@@ -115,7 +115,6 @@ glx@glx_ext_import_context@query context info,Fail
 glx@glx-buffer-age,Fail
 glx@glx-buffer-age vblank_mode=0,Fail
 
-glx@glx-make-current,Fail
 glx@glx-multi-window-single-context,Crash
 glx@glx-swap-pixmap-bad,Fail
 glx@glx-tfp,Crash
index 5bb31f5caced572a44071666ead7e288ae7fec37..7226486adfb5f729ad7b1459966f1d51e0dda38e 100644 (file)
@@ -10,7 +10,6 @@ KHR-GL46.shader_ballot_tests.ShaderBallotFunctionRead
 
 # ignores copied from the old runner script
 spec@arb_map_buffer_alignment@arb_map_buffer_alignment-map-invalidate-range
-glx@glx-make-current
 spec@arb_timer_query.*
 spec@arb_sample_shading@builtin-gl-sample-mask
 spec@glsl-1.30@execution@tex-miplevel-selection.*
index 7084b29940fbf94d26f1e22d3dbe5af91e83086d..1e2c4a90dba0e9c471dacd899882bcb5dd24896c 100644 (file)
@@ -22,7 +22,6 @@ glx@glx_ext_import_context@imported context has same context id,Fail
 glx@glx_ext_import_context@make current- multi process,Fail
 glx@glx_ext_import_context@make current- single process,Fail
 glx@glx_ext_import_context@query context info,Fail
-glx@glx-make-current,Fail
 glx@glx-swap-pixmap-bad,Fail
 
 # #6322
index 5fac92a1dcf04e9f7c37feb31170782a9487a21e..34bb8784a0dd7addc0bba08ce2d7a96810aa30b4 100644 (file)
@@ -22,7 +22,6 @@ glx@glx_ext_import_context@imported context has same context id,Fail
 glx@glx_ext_import_context@make current- multi process,Fail
 glx@glx_ext_import_context@make current- single process,Fail
 glx@glx_ext_import_context@query context info,Fail
-glx@glx-make-current,Fail
 glx@glx-swap-pixmap-bad,Fail
 
 # #6322
index cf4e5abc1ded386c0e5a8830b94a8c194b93459a..18886c6822b743c76b39c05dc6902b22028f16fb 100644 (file)
@@ -1257,6 +1257,17 @@ resource_create(struct pipe_screen *pscreen,
             FREE_CL(res);
             return NULL;
          }
+         struct kopper_displaytarget *cdt = res->obj->dt;
+         if (cdt->swapchain->num_acquires) {
+            /* this should be a reused swapchain after a MakeCurrent dance that deleted the original resource */
+            for (unsigned i = 0; i < cdt->swapchain->num_images; i++) {
+               if (!cdt->swapchain->images[i].acquired)
+                  continue;
+               res->obj->dt_idx = i;
+               res->obj->image = cdt->swapchain->images[i].image;
+               res->layout = cdt->swapchain->images[i].layout;
+            }
+         }
       } else {
          /* frontbuffer */
          struct zink_resource *back = (void*)loader_private;