The bit fields in zink_framebuffer_state cause a false positive with
MSVC's run-time checks enabled. setting state.num_attachments in
zink_get_framebuffer_imageless(). Writing some bits of num_attachments
involves reading bits from layers and samples that haven't been
initialized.
Fixed by assigning to num_attachments earlier in the function. Not
quite sure why that makes a difference but at a guess there's a
heuristic that considers assignment close to declaration as
initialization.
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14566>
assert(zink_screen(ctx->base.screen)->info.have_KHR_imageless_framebuffer);
struct zink_framebuffer_state state;
+ state.num_attachments = ctx->fb_state.nr_cbufs;
+
const unsigned cresolve_offset = ctx->fb_state.nr_cbufs + !!ctx->fb_state.zsbuf;
unsigned num_resolves = 0;
for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) {
}
}
- state.num_attachments = ctx->fb_state.nr_cbufs;
const unsigned zsresolve_offset = cresolve_offset + num_resolves;
if (ctx->fb_state.zsbuf) {
struct pipe_surface *psurf = ctx->fb_state.zsbuf;