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

Author: Erik Faye-Lund <[email protected]>
Date:   Wed Jul 25 17:20:34 2018 +0200

gallium: initialize ureg_dst::Invariant bit

When this bit was added, it seems the some initialization code
was omitted by mistake.

Since stack-variables have kinda random contents, and we don't
zero initialize the whole struct in these code-paths, we end up
getting random-ish values for this bit.

Spotted by Coverity in the following CIDs:
- 1438115
- 1438123
- 1438130

Fixes: 70425bcfe63c4e9191809659d019ec4af923595d ("gallium: plumb
invariant output attrib thru TGSI")

Signed-off-by: Erik Faye-Lund <[email protected]>
Reviewed-by: Jakob Bornecrantz <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>

---

 src/gallium/auxiliary/tgsi/tgsi_ureg.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h 
b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
index 4d4a954529..c974ed0206 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h
@@ -1019,6 +1019,7 @@ ureg_dst_array_register(unsigned file,
    dst.DimIndIndex = 0;
    dst.DimIndSwizzle = 0;
    dst.ArrayID = array_id;
+   dst.Invariant = 0;
 
    return dst;
 }
@@ -1050,6 +1051,7 @@ ureg_dst( struct ureg_src src )
    dst.DimIndIndex = src.DimIndIndex;
    dst.DimIndSwizzle = src.DimIndSwizzle;
    dst.ArrayID = src.ArrayID;
+   dst.Invariant = 0;
 
    return dst;
 }
@@ -1141,6 +1143,7 @@ ureg_dst_undef( void )
    dst.DimIndIndex = 0;
    dst.DimIndSwizzle = 0;
    dst.ArrayID = 0;
+   dst.Invariant = 0;
 
    return dst;
 }

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

Reply via email to