zink: handle swapchain handoffs around makecurrent

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>
This commit is contained in:
Mike Blumenkrantz
2023-04-11 17:05:52 -04:00
committed by Marge Bot
parent 5db5218044
commit 7704773619
5 changed files with 11 additions and 4 deletions

View 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

View 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.*

View 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

View 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

View 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;