Mesa (master): i965: Fix compiler warning about write being undefined.

Eric Anholt anholt at kemper.freedesktop.org
Wed Feb 21 04:25:44 UTC 2018


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

Author: Eric Anholt <eric at anholt.net>
Date:   Sat Feb 10 11:19:00 2018 +0000

i965: Fix compiler warning about write being undefined.

This looks like it should be protected by the assume() about
nr_color_regions, but my compiler warns anyway.

Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/intel/compiler/brw_fs.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index 6fb46e7374..bed632d21b 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -3070,7 +3070,7 @@ fs_visitor::emit_repclear_shader()
                .MOV(vec4(brw_message_reg(color_mrf)), fs_reg(reg));
    }
 
-   fs_inst *write;
+   fs_inst *write = NULL;
    if (key->nr_color_regions == 1) {
       write = bld.emit(FS_OPCODE_REP_FB_WRITE);
       write->saturate = key->clamp_fragment_color;




More information about the mesa-commit mailing list