From 441feda0bb374e551a59af24111d3574d9adc948 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 8 Sep 2020 15:51:31 +0200 Subject: [PATCH] gallium/util: do not pass undefined sample-count We forgot to initialize the sample_count member here, leading to it being undefined. This causes problems on MSVC when compiling in debug-mode, where we get a run-time error for using an undefined variable. To avoid similar problems in the future if more fields are added, let's initialize the whole struct to zero to start with. This also allows us to remove a no-longer-needed zero-initialization. Fixes: cf170616daa ("gallium: Add a util_blitter path for using a custom VS and FS.") Reviewed-by: Emil Velikov Part-of: --- src/gallium/auxiliary/util/u_blitter.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 01b56f3de3e..92a180a2c04 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -2734,7 +2734,7 @@ void util_blitter_custom_shader(struct blitter_context *blitter, { struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->base.pipe; - struct pipe_framebuffer_state fb_state; + struct pipe_framebuffer_state fb_state = { 0 }; ctx->custom_vs = custom_vs; @@ -2760,7 +2760,6 @@ void util_blitter_custom_shader(struct blitter_context *blitter, fb_state.height = dstsurf->height; fb_state.nr_cbufs = 1; fb_state.cbufs[0] = dstsurf; - fb_state.zsbuf = 0; pipe->set_framebuffer_state(pipe, &fb_state); pipe->set_sample_mask(pipe, ~0);