zink: add some breadcrumbs for VK_EXT_multisampled_render_to_single_sampled
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 25 Oct 2022 17:53:52 +0000 (13:53 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Oct 2022 14:43:50 +0000 (14:43 +0000)
at some point someone should hook this extension up to simplify/optimize
the existing msrtt handling

see also #7559

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19307>

src/gallium/drivers/zink/zink_render_pass.c
src/gallium/drivers/zink/zink_surface.c
src/gallium/drivers/zink/zink_types.h

index b1531a3..77234cb 100644 (file)
@@ -675,7 +675,7 @@ zink_begin_render_pass(struct zink_context *ctx)
    setup_framebuffer(ctx);
    if (ctx->batch.in_rp)
       return 0;
-   /* TODO: need replicate EXT */
+   /* TODO: use VK_EXT_multisampled_render_to_single_sampled */
    if (ctx->framebuffer->rp->state.msaa_expand_mask) {
       uint32_t rp_state = ctx->gfx_pipeline_state.rp_state;
       struct zink_render_pass *rp = ctx->gfx_pipeline_state.render_pass;
@@ -719,6 +719,7 @@ zink_end_render_pass(struct zink_context *ctx)
 {
    if (ctx->batch.in_rp) {
       VKCTX(CmdEndRenderPass)(ctx->batch.state->cmdbuf);
+      /* TODO: use VK_EXT_multisampled_render_to_single_sampled */
       for (unsigned i = 0; i < ctx->fb_state.nr_cbufs; i++) {
          struct zink_ctx_surface *csurf = (struct zink_ctx_surface*)ctx->fb_state.cbufs[i];
          if (csurf)
index e992d04..940b390 100644 (file)
@@ -283,6 +283,7 @@ zink_create_surface(struct pipe_context *pctx,
 
    struct zink_ctx_surface *csurf = (struct zink_ctx_surface*)wrap_surface(pctx, psurf);
 
+   /* TODO: use VK_EXT_multisampled_render_to_single_sampled and skip this entirely */
    if (templ->nr_samples) {
       /* transient fb attachment: not cached */
       struct pipe_resource rtempl = *pres;
index d5e0611..4dd7c44 100644 (file)
@@ -1325,9 +1325,9 @@ struct zink_surface {
 struct zink_ctx_surface {
    struct pipe_surface base;
    struct zink_surface *surf;
-   struct zink_ctx_surface *transient; //zink_ctx_surface
-   /* TODO: need replicate EXT */
-   bool transient_init;
+   /* TODO: use VK_EXT_multisampled_render_to_single_sampled */
+   struct zink_ctx_surface *transient; //for use with EXT_multisample_render_to_texture
+   bool transient_init; //whether the transient surface has data
 };
 
 /* use this cast for framebuffer surfaces */