diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2020-09-08 15:51:31 +0200 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2020-11-19 10:47:37 -0800 |
commit | 0368cdd51dfb76d587140652cb386dd07f7faa56 (patch) | |
tree | d7eecc248734436bb3371ea9c156fc2d29056e4f | |
parent | 08153eeb7d22846b08dcb5f05adfa842b0ab6a2f (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>
(cherry picked from commit 441feda0bb374e551a59af24111d3574d9adc948)
-rw-r--r-- | .pick_status.json | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_blitter.c | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/.pick_status.json b/.pick_status.json index 5ff665fe9b9..aa7873224a1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2965,7 +2965,7 @@ "description": "gallium/util: do not pass undefined sample-count", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "cf170616daa6e1a4545c2bbfd35c9b857fdcf2f6" }, @@ -3181,7 +3181,7 @@ "description": "radv: Skip tiny non-visible VRAM heap.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, @@ -3271,7 +3271,7 @@ "description": "spirv: fix GLSLstd450Modf/GLSLstd450Frexp when the destination is vector", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index d5b886ca36f..f2c06d9ac7a 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -2721,7 +2721,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; @@ -2747,7 +2747,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); |