mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
zink: delete zink_resource_object::dt_has_data
this should be on the swapchain image Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17149>
This commit is contained in:
parent
314a24998a
commit
1951065a16
4 changed files with 8 additions and 10 deletions
|
|
@ -493,10 +493,8 @@ zink_batch_resource_usage_set(struct zink_batch *batch, struct zink_resource *re
|
|||
{
|
||||
if (res->obj->dt) {
|
||||
VkSemaphore acquire = zink_kopper_acquire_submit(zink_screen(batch->state->ctx->base.screen), res);
|
||||
if (acquire) {
|
||||
if (acquire)
|
||||
util_dynarray_append(&batch->state->acquires, VkSemaphore, acquire);
|
||||
res->obj->dt_has_data = true;
|
||||
}
|
||||
}
|
||||
if (write && !res->obj->is_buffer) {
|
||||
if (!res->valid && res->fb_binds)
|
||||
|
|
|
|||
|
|
@ -512,8 +512,7 @@ kopper_acquire(struct zink_screen *screen, struct zink_resource *res, uint64_t t
|
|||
res->obj->indefinite_acquire = true;
|
||||
p_atomic_inc(&cdt->swapchain->num_acquires);
|
||||
}
|
||||
cdt->swapchain->dt_has_data = false;
|
||||
res->obj->dt_has_data = false;
|
||||
cdt->swapchain->images[res->obj->dt_idx].dt_has_data = false;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -573,7 +572,8 @@ zink_kopper_acquire_submit(struct zink_screen *screen, struct zink_resource *res
|
|||
{
|
||||
assert(res->obj->dt);
|
||||
struct kopper_displaytarget *cdt = res->obj->dt;
|
||||
if (cdt->swapchain->dt_has_data)
|
||||
assert(res->obj->dt_idx != UINT32_MAX);
|
||||
if (cdt->swapchain->images[res->obj->dt_idx].dt_has_data)
|
||||
return VK_NULL_HANDLE;
|
||||
assert(res->obj->dt_idx != UINT32_MAX);
|
||||
assert(cdt->swapchain->images[res->obj->dt_idx].acquire);
|
||||
|
|
@ -581,7 +581,7 @@ zink_kopper_acquire_submit(struct zink_screen *screen, struct zink_resource *res
|
|||
/* this is now owned by the batch */
|
||||
VkSemaphore acquire = cdt->swapchain->images[res->obj->dt_idx].acquire;
|
||||
cdt->swapchain->images[res->obj->dt_idx].acquire = VK_NULL_HANDLE;
|
||||
cdt->swapchain->dt_has_data = true;
|
||||
cdt->swapchain->images[res->obj->dt_idx].dt_has_data = true;
|
||||
return acquire;
|
||||
}
|
||||
|
||||
|
|
@ -743,7 +743,8 @@ zink_kopper_acquire_readback(struct zink_context *ctx, struct zink_resource *res
|
|||
uint32_t last_dt_idx = res->obj->last_dt_idx;
|
||||
VkResult ret = VK_SUCCESS;
|
||||
/* if this hasn't been presented or if it has data, use this as the readback target */
|
||||
if (res->obj->last_dt_idx == UINT32_MAX || res->obj->dt_has_data)
|
||||
if (res->obj->last_dt_idx == UINT32_MAX ||
|
||||
(zink_kopper_acquired(cdt, res->obj->dt_idx) && cdt->swapchain->images[res->obj->dt_idx].dt_has_data))
|
||||
return false;
|
||||
while (res->obj->dt_idx != last_dt_idx) {
|
||||
if (res->obj->dt_idx != UINT32_MAX && !zink_kopper_present_readback(ctx, res))
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
struct kopper_swapchain_image {
|
||||
bool init;
|
||||
bool acquired;
|
||||
bool dt_has_data;
|
||||
VkImage image;
|
||||
VkSemaphore acquire;
|
||||
};
|
||||
|
|
@ -48,7 +49,6 @@ struct kopper_swapchain {
|
|||
unsigned num_acquires;
|
||||
unsigned max_acquires;
|
||||
unsigned async_presents;
|
||||
bool dt_has_data;
|
||||
struct kopper_swapchain_image *images;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ struct zink_resource_object {
|
|||
uint32_t last_dt_idx;
|
||||
VkSemaphore present;
|
||||
bool new_dt;
|
||||
bool dt_has_data;
|
||||
bool indefinite_acquire;
|
||||
// }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue