Mesa (master): vc4: Don' t bother zero-initializing the shader reloc indices.

Eric Anholt anholt at kemper.freedesktop.org
Fri Dec 26 01:47:55 UTC 2014


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Dec 25 12:14:54 2014 -1000

vc4: Don't bother zero-initializing the shader reloc indices.

They should all be set to real values by the time they're read, and
ideally if you used valgrind you'd see uninitialized value uses.

---

 src/gallium/drivers/vc4/vc4_cl.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_cl.h b/src/gallium/drivers/vc4/vc4_cl.h
index 36df11b..5c67f22 100644
--- a/src/gallium/drivers/vc4/vc4_cl.h
+++ b/src/gallium/drivers/vc4/vc4_cl.h
@@ -107,8 +107,8 @@ cl_start_shader_reloc(struct vc4_cl *cl, uint32_t n)
         cl->reloc_count = n;
         cl->reloc_next = cl->next - cl->base;
 
-        for (int i = 0; i < n; i++)
-                cl_u32(cl, 0); /* Space where hindex will be written. */
+        /* Space where hindex will be written. */
+        cl->next += n * 4;
 }
 
 static inline void




More information about the mesa-commit mailing list