zink: add ZINK_DEBUG=rploads to mimic tiler behavior

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36576>
This commit is contained in:
Mike Blumenkrantz 2025-08-05 07:35:56 -04:00 committed by Marge Bot
parent 6775873e9e
commit b717240ffa
4 changed files with 20 additions and 0 deletions

View file

@ -323,6 +323,8 @@ variable:
No precompilation
``msaaopt``
Optimize out loads/stores of MSAA attachments (nonconformant)
``rploads``
Zap renderpass loads for DONT_CARE
Vulkan Validation Layers
^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -3032,6 +3032,22 @@ begin_rendering(struct zink_context *ctx, bool check_msaa_expand)
}
}
}
if (zink_debug & ZINK_DEBUG_RPLOADS) {
for (unsigned i = 0; i < ARRAY_SIZE(ctx->dynamic_fb.attachments); i++) {
if (ctx->dynamic_fb.attachments[i].loadOp != VK_ATTACHMENT_LOAD_OP_DONT_CARE)
continue;
ctx->dynamic_fb.attachments[i].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
if (i >= PIPE_MAX_COLOR_BUFS) {
ctx->dynamic_fb.attachments[i].clearValue.depthStencil.depth = 1.0;
ctx->dynamic_fb.attachments[i].clearValue.depthStencil.stencil = 255;
} else {
ctx->dynamic_fb.attachments[i].clearValue.color.float32[0] = 1.0;
ctx->dynamic_fb.attachments[i].clearValue.color.float32[1] = 0.0;
ctx->dynamic_fb.attachments[i].clearValue.color.float32[2] = 0.0;
ctx->dynamic_fb.attachments[i].clearValue.color.float32[3] = 1.0;
}
}
}
if (changed_size || changed_layout)
ctx->rp_changed = true;
ctx->rp_loadop_changed = false;

View file

@ -117,6 +117,7 @@ zink_debug_options[] = {
{ "quiet", ZINK_DEBUG_QUIET, "Suppress warnings" },
{ "nopc", ZINK_DEBUG_NOPC, "No precompilation" },
{ "msaaopt", ZINK_DEBUG_MSAAOPT, "Optimize out loads/stores of MSAA attachments" },
{ "rploads", ZINK_DEBUG_RPLOADS, "Zap renderpass loads for DONT_CARE" },
DEBUG_NAMED_VALUE_END
};

View file

@ -243,6 +243,7 @@ enum zink_debug {
ZINK_DEBUG_QUIET = (1<<18),
ZINK_DEBUG_NOPC = (1<<19),
ZINK_DEBUG_MSAAOPT = (1<<20),
ZINK_DEBUG_RPLOADS = (1<<22),
};
enum zink_pv_emulation_primitive {