zink: delete zink_surface_info
this is no longer needed Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34822>
This commit is contained in:
committed by
Marge Bot
parent
7eae11930f
commit
6b2c39e9d8
@@ -2894,7 +2894,7 @@ zink_update_rendering_info(struct zink_context *ctx)
|
||||
{
|
||||
for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) {
|
||||
struct zink_surface *surf = zink_csurface(ctx->fb_cbufs[i]);
|
||||
ctx->gfx_pipeline_state.rendering_formats[i] = surf ? surf->info.format[0] : VK_FORMAT_UNDEFINED;
|
||||
ctx->gfx_pipeline_state.rendering_formats[i] = surf ? surf->ivci.format : VK_FORMAT_UNDEFINED;
|
||||
}
|
||||
ctx->gfx_pipeline_state.rendering_info.viewMask = ctx->fb_state.viewmask;
|
||||
ctx->gfx_pipeline_state.rendering_info.depthAttachmentFormat = VK_FORMAT_UNDEFINED;
|
||||
@@ -2905,9 +2905,9 @@ zink_update_rendering_info(struct zink_context *ctx)
|
||||
bool has_stencil = util_format_has_stencil(util_format_description(ctx->fb_state.zsbuf.format));
|
||||
|
||||
if (has_depth)
|
||||
ctx->gfx_pipeline_state.rendering_info.depthAttachmentFormat = surf->info.format[0];
|
||||
ctx->gfx_pipeline_state.rendering_info.depthAttachmentFormat = surf->ivci.format;
|
||||
if (has_stencil)
|
||||
ctx->gfx_pipeline_state.rendering_info.stencilAttachmentFormat = surf->info.format[0];
|
||||
ctx->gfx_pipeline_state.rendering_info.stencilAttachmentFormat = surf->ivci.format;
|
||||
}
|
||||
return find_rp_state(ctx);
|
||||
}
|
||||
@@ -3938,7 +3938,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
|
||||
samples = MAX3(transient ? transient->base.nr_samples : 1, psurf->texture->nr_samples, psurf->nr_samples ? psurf->nr_samples : 1);
|
||||
struct zink_resource *res = zink_resource(psurf->texture);
|
||||
check_framebuffer_surface_mutable(pctx, psurf);
|
||||
if (zink_csurface(psurf)->info.layerCount > layers)
|
||||
if (zink_csurface(psurf)->ivci.subresourceRange.layerCount > layers)
|
||||
ctx->fb_layer_mismatch |= BITFIELD_BIT(i);
|
||||
if (res->obj->dt) {
|
||||
/* #6274 */
|
||||
@@ -3968,7 +3968,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
|
||||
ctx->transient_attachments |= BITFIELD_BIT(PIPE_MAX_COLOR_BUFS);
|
||||
if (!samples)
|
||||
samples = MAX3(transient ? transient->base.nr_samples : 1, psurf->texture->nr_samples, psurf->nr_samples ? psurf->nr_samples : 1);
|
||||
if (zink_csurface(psurf)->info.layerCount > layers)
|
||||
if (zink_csurface(psurf)->ivci.subresourceRange.layerCount > layers)
|
||||
ctx->fb_layer_mismatch |= BITFIELD_BIT(PIPE_MAX_COLOR_BUFS);
|
||||
zink_resource(psurf->texture)->fb_bind_count++;
|
||||
zink_resource(psurf->texture)->fb_binds |= BITFIELD_BIT(PIPE_MAX_COLOR_BUFS);
|
||||
|
||||
@@ -1119,10 +1119,10 @@ zink_kopper_fixup_depth_buffer(struct zink_context *ctx)
|
||||
assert(ctx->fb_state.zsbuf.texture->bind & PIPE_BIND_DISPLAY_TARGET);
|
||||
|
||||
struct zink_resource *res = zink_resource(ctx->fb_state.zsbuf.texture);
|
||||
struct zink_surface *surf = zink_csurface(ctx->fb_zsbuf);
|
||||
struct zink_ctx_surface *csurf = (struct zink_ctx_surface*)ctx->fb_zsbuf;
|
||||
if (surf->info.width == ctx->fb_state.width &&
|
||||
surf->info.height == ctx->fb_state.height)
|
||||
unsigned width = pipe_surface_width(&ctx->fb_state.zsbuf);
|
||||
unsigned height = pipe_surface_height(&ctx->fb_state.zsbuf);
|
||||
if (width == ctx->fb_state.width && height == ctx->fb_state.height)
|
||||
return;
|
||||
|
||||
struct pipe_resource templ = *ctx->fb_state.zsbuf.texture;
|
||||
|
||||
@@ -152,7 +152,7 @@ zink_init_color_attachment(struct zink_context *ctx, unsigned i, struct zink_rt_
|
||||
if (psurf) {
|
||||
struct zink_surface *surf = zink_csurface(psurf);
|
||||
struct zink_surface *transient = zink_transient_surface(psurf);
|
||||
rt->format = surf->info.format[0];
|
||||
rt->format = surf->ivci.format;
|
||||
rt->samples = MAX3(transient ? transient->base.nr_samples : 0, psurf->texture->nr_samples, 1);
|
||||
rt->clear_color = zink_fb_clear_enabled(ctx, i) && !zink_fb_clear_first_needs_explicit(&ctx->fb_clears[i]);
|
||||
rt->invalid = !zink_resource(psurf->texture)->valid;
|
||||
@@ -173,7 +173,7 @@ zink_tc_init_color_attachment(struct zink_context *ctx, const struct tc_renderpa
|
||||
if (psurf) {
|
||||
struct zink_surface *surf = zink_csurface(psurf);
|
||||
struct zink_surface *transient = zink_transient_surface(psurf);
|
||||
rt->format = surf->info.format[0];
|
||||
rt->format = surf->ivci.format;
|
||||
rt->samples = MAX3(transient ? transient->base.nr_samples : 0, psurf->texture->nr_samples, 1);
|
||||
rt->clear_color = zink_fb_clear_enabled(ctx, i) && !zink_fb_clear_first_needs_explicit(&ctx->fb_clears[i]);
|
||||
rt->invalid = !zink_resource(psurf->texture)->valid;
|
||||
|
||||
@@ -107,34 +107,6 @@ create_ivci(struct zink_screen *screen,
|
||||
return ivci;
|
||||
}
|
||||
|
||||
/* this is used for framebuffer attachments to set up imageless framebuffers */
|
||||
static void
|
||||
init_surface_info(struct zink_screen *screen, struct zink_surface *surface, struct zink_resource *res, VkImageViewCreateInfo *ivci)
|
||||
{
|
||||
VkImageViewUsageCreateInfo *usage_info = (VkImageViewUsageCreateInfo *)ivci->pNext;
|
||||
surface->info.flags = res->obj->vkflags;
|
||||
surface->info.usage = usage_info ? usage_info->usage : res->obj->vkusage;
|
||||
|
||||
surface->info.width = pipe_surface_width(&surface->base);
|
||||
surface->info.height = pipe_surface_height(&surface->base);
|
||||
surface->info.layerCount = ivci->subresourceRange.layerCount;
|
||||
surface->info.format[0] = ivci->format;
|
||||
if (res->obj->dt) {
|
||||
struct kopper_displaytarget *cdt = res->obj->dt;
|
||||
if (zink_kopper_has_srgb(cdt))
|
||||
surface->info.format[1] = ivci->format == cdt->formats[0] ? cdt->formats[1] : cdt->formats[0];
|
||||
} else {
|
||||
enum pipe_format srgb = util_format_is_srgb(surface->base.format) ? util_format_linear(surface->base.format) : util_format_srgb(surface->base.format);
|
||||
if (srgb == surface->base.format)
|
||||
srgb = PIPE_FORMAT_NONE;
|
||||
if (srgb) {
|
||||
VkFormat format = zink_get_format(screen, srgb);
|
||||
if (format)
|
||||
surface->info.format[1] = format;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
init_pipe_surface_info(struct pipe_context *pctx, struct pipe_surface *psurf, const struct pipe_surface *templ, const struct pipe_resource *pres)
|
||||
{
|
||||
@@ -193,8 +165,6 @@ create_surface(struct pipe_context *pctx,
|
||||
init_pipe_surface_info(pctx, &surface->base, templ, pres);
|
||||
surface->obj = zink_resource(pres)->obj;
|
||||
|
||||
init_surface_info(screen, surface, res, ivci);
|
||||
|
||||
if (!actually)
|
||||
return surface;
|
||||
assert(ivci->image);
|
||||
@@ -477,9 +447,6 @@ zink_rebind_surface(struct zink_context *ctx, struct pipe_surface **psurface)
|
||||
simple_mtx_unlock(&res->obj->view_lock);
|
||||
surface->image_view = image_view;
|
||||
surface->obj = zink_resource(surface->base.texture)->obj;
|
||||
/* update for imageless fb */
|
||||
surface->info.flags = res->obj->vkflags;
|
||||
surface->info.usage = res->obj->vkusage;
|
||||
simple_mtx_unlock(&res->surface_mtx);
|
||||
return true;
|
||||
}
|
||||
@@ -544,7 +511,6 @@ zink_surface_swapchain_update(struct zink_context *ctx, struct zink_surface *sur
|
||||
mesa_loge("ZINK: failed to allocate surface->swapchain!");
|
||||
return;
|
||||
}
|
||||
init_surface_info(screen, surface, res, &surface->ivci);
|
||||
surface->dt_swapchain = cdt->swapchain;
|
||||
}
|
||||
if (!surface->swapchain[res->obj->dt_idx]) {
|
||||
|
||||
@@ -1532,16 +1532,6 @@ zink_screen(struct pipe_screen *pipe)
|
||||
|
||||
/** surface types */
|
||||
|
||||
/* info for validating/creating imageless framebuffers */
|
||||
struct zink_surface_info {
|
||||
VkImageCreateFlags flags;
|
||||
VkImageUsageFlags usage;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t layerCount;
|
||||
VkFormat format[2]; //base format, srgb format (for srgb framebuffer)
|
||||
};
|
||||
|
||||
/* an imageview for a zink_resource:
|
||||
- may be a fb attachment, samplerview, or shader image
|
||||
- cached on the parent zink_resource_object
|
||||
@@ -1552,8 +1542,6 @@ struct zink_surface {
|
||||
/* all the info for creating a new imageview */
|
||||
VkImageViewCreateInfo ivci;
|
||||
VkImageViewUsageCreateInfo usage_info;
|
||||
/* for framebuffer use */
|
||||
struct zink_surface_info info;
|
||||
bool is_swapchain;
|
||||
/* the current imageview */
|
||||
VkImageView image_view;
|
||||
|
||||
Reference in New Issue
Block a user