Module: Mesa
Branch: master
Commit: b537d425b39052d9069643d92b465790c1e113ab
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b537d425b39052d9069643d92b465790c1e113ab

Author: Eric Anholt <[email protected]>
Date:   Tue Nov 17 13:43:28 2020 -0800

freedreno: Suppress uninit var warnings from shader stage switch.

It seems we have enough branches that the compiler gets confused now, and
I can also suppress the warning by replacing "unreachable()" with
"return".  Unreachable is good for debugging, so just 0-init the values.

Reviewed-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7664>

---

 src/gallium/drivers/freedreno/a6xx/fd6_program.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c 
b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
index 64690c99c1b..c32ec9decf8 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
@@ -46,8 +46,8 @@ fd6_emit_shader(struct fd_ringbuffer *ring, const struct 
ir3_shader_variant *so)
 {
        enum a6xx_state_block sb = fd6_stage2shadersb(so->type);
 
-       uint32_t obj_start;
-       uint32_t instrlen;
+       uint32_t obj_start = 0;
+       uint32_t instrlen = 0;
 
        switch (so->type) {
        case MESA_SHADER_VERTEX:

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to