diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2020-09-08 15:51:31 +0200 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2020-11-09 17:51:56 +0000 |
commit | 441feda0bb374e551a59af24111d3574d9adc948 (patch) | |
tree | c555b215790b5e3ba5ad6c5fbe2ea24532253719 | |
parent | bae5487659636fbbb79021f89ba01ba32e4a3abc (diff) |
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 <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7503>
-rw-r--r-- | src/gallium/auxiliary/util/u_blitter.c | 3 |
1 files changed, 1 insertions, 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); |