diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 6e100367997..b8217b714ff 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -658,6 +658,17 @@ fs_inst::is_partial_write() const if (this->opcode == SHADER_OPCODE_SEND) return false; + /* Special case UNDEF since a lot of places in the backend do things like this : + * + * fs_builder ubld = bld.exec_all().group(1, 0); + * fs_reg tmp = ubld.vgrf(BRW_REGISTER_TYPE_UD); + * ubld.UNDEF(tmp); <- partial write, even if the whole register is concerned + */ + if (this->opcode == SHADER_OPCODE_UNDEF) { + assert(this->dst.is_contiguous()); + return this->size_written < 32; + } + return this->exec_size * type_sz(this->dst.type) < 32 || !this->dst.is_contiguous(); }