pipe_resource_reference(&pres, NULL);
}
_mesa_set_clear(cmdbuf->resources, NULL);
+
+ util_dynarray_foreach(&cmdbuf->zombie_samplers, VkSampler, samp) {
+ vkDestroySampler(screen->dev, *samp, NULL);
+ }
+ util_dynarray_clear(&cmdbuf->zombie_samplers);
}
struct zink_cmdbuf *
#include <vulkan/vulkan.h>
+#include "util/u_dynarray.h"
+
struct zink_context;
struct zink_fence;
struct zink_framebuffer;
struct zink_framebuffer *fb;
struct set *resources;
+
+ struct util_dynarray zombie_samplers;
};
struct zink_cmdbuf *
zink_delete_sampler_state(struct pipe_context *pctx,
void *sampler_state)
{
- struct zink_screen *screen = zink_screen(pctx->screen);
- vkDestroySampler(screen->dev, sampler_state, NULL);
+ struct zink_cmdbuf *cmdbuf = zink_context_curr_cmdbuf(zink_context(pctx));
+ util_dynarray_append(&cmdbuf->zombie_samplers,
+ VkSampler, sampler_state);
}
_mesa_key_pointer_equal);
if (!ctx->cmdbufs[i].resources)
goto fail;
+
+ util_dynarray_init(&ctx->cmdbufs[i].zombie_samplers, NULL);
}
VkDescriptorPoolSize sizes[] = {