Mesa (master): i965/fs: Silence uninitialized variable warning.

Matt Turner mattst88 at kemper.freedesktop.org
Thu Oct 23 23:19:00 UTC 2014


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

Author: Matt Turner <mattst88 at gmail.com>
Date:   Thu Oct 23 15:45:15 2014 -0700

i965/fs: Silence uninitialized variable warning.

The compiler isn't privy to the knowledge that we're doing at least one
framebuffer write.

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index e941c58..983e8db 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2601,6 +2601,7 @@ fs_visitor::emit_repclear_shader()
       write->header_present = false;
       write->mlen = 1;
    } else {
+      assume(key->nr_color_regions > 0);
       for (int i = 0; i < key->nr_color_regions; ++i) {
          write = emit(FS_OPCODE_REP_FB_WRITE);
          write->saturate = key->clamp_fragment_color;




More information about the mesa-commit mailing list