zink: create a surface for resolve resources
this can be reused since the state tracker doesn't give a surface Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30772>
This commit is contained in:

committed by
Marge Bot

parent
cd7ad7bd7e
commit
2c700bb842
@@ -3850,6 +3850,17 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
|
||||
} else {
|
||||
ctx->depth_bias_scale_factor = 0;
|
||||
}
|
||||
|
||||
if (ctx->fb_state.resolve) {
|
||||
struct zink_resource *res = zink_resource(ctx->fb_state.resolve);
|
||||
if (!res->surface) {
|
||||
struct pipe_surface tmpl = {0};
|
||||
tmpl.format = res->base.b.format;
|
||||
zink_screen_lock_context(screen);
|
||||
res->surface = screen->copy_context->base.create_surface(&screen->copy_context->base, &res->base.b, &tmpl);
|
||||
zink_screen_unlock_context(screen);
|
||||
}
|
||||
}
|
||||
if (depth_bias_scale_factor != ctx->depth_bias_scale_factor &&
|
||||
ctx->rast_state && ctx->rast_state->base.offset_units_unscaled)
|
||||
ctx->rast_state_changed = true;
|
||||
|
@@ -244,6 +244,7 @@ zink_resource_destroy(struct pipe_screen *pscreen,
|
||||
assert(!_mesa_hash_table_num_entries(&res->surface_cache));
|
||||
simple_mtx_destroy(&res->surface_mtx);
|
||||
ralloc_free(res->surface_cache.table);
|
||||
pipe_surface_reference(&res->surface, NULL);
|
||||
}
|
||||
/* no need to do anything for the caches, these objects own the resource lifetimes */
|
||||
|
||||
|
@@ -1288,6 +1288,7 @@ struct zink_resource {
|
||||
enum pipe_format internal_format:16;
|
||||
|
||||
struct zink_resource_object *obj;
|
||||
struct pipe_surface *surface; //for swapchain images
|
||||
uint32_t queue;
|
||||
union {
|
||||
struct {
|
||||
|
Reference in New Issue
Block a user