i965/fs: Mark appropriate fs_inst members as const.
authorMatt Turner <mattst88@gmail.com>
Thu, 27 Mar 2014 16:40:30 +0000 (09:40 -0700)
committerMatt Turner <mattst88@gmail.com>
Sat, 5 Apr 2014 16:47:36 +0000 (09:47 -0700)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h

index c88f7c9..fd9fba7 100644 (file)
@@ -323,7 +323,7 @@ fs_visitor::DEP_RESOLVE_MOV(int grf)
 }
 
 bool
-fs_inst::equals(fs_inst *inst)
+fs_inst::equals(fs_inst *inst) const
 {
    return (opcode == inst->opcode &&
            dst.equals(inst->dst) &&
@@ -344,7 +344,7 @@ fs_inst::equals(fs_inst *inst)
 }
 
 bool
-fs_inst::overwrites_reg(const fs_reg &reg)
+fs_inst::overwrites_reg(const fs_reg &reg) const
 {
    return (reg.file == dst.file &&
            reg.reg == dst.reg &&
@@ -353,7 +353,7 @@ fs_inst::overwrites_reg(const fs_reg &reg)
 }
 
 bool
-fs_inst::is_send_from_grf()
+fs_inst::is_send_from_grf() const
 {
    return (opcode == FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7 ||
            opcode == SHADER_OPCODE_SHADER_TIME_ADD ||
@@ -761,7 +761,7 @@ fs_visitor::pop_force_uncompressed()
  * it.
  */
 bool
-fs_inst::is_partial_write()
+fs_inst::is_partial_write() const
 {
    return ((this->predicate && this->opcode != BRW_OPCODE_SEL) ||
            this->force_uncompressed ||
@@ -769,7 +769,7 @@ fs_inst::is_partial_write()
 }
 
 int
-fs_inst::regs_read(fs_visitor *v, int arg)
+fs_inst::regs_read(fs_visitor *v, int arg) const
 {
    if (is_tex() && arg == 0 && src[0].file == GRF) {
       if (v->dispatch_width == 16)
@@ -781,13 +781,13 @@ fs_inst::regs_read(fs_visitor *v, int arg)
 }
 
 bool
-fs_inst::reads_flag()
+fs_inst::reads_flag() const
 {
    return predicate;
 }
 
 bool
-fs_inst::writes_flag()
+fs_inst::writes_flag() const
 {
    return (conditional_mod && opcode != BRW_OPCODE_SEL) ||
           opcode == FS_OPCODE_MOV_DISPATCH_TO_FLAGS;
index 0d064f6..4086693 100644 (file)
@@ -196,14 +196,14 @@ public:
    fs_inst(enum opcode opcode, fs_reg dst,
            fs_reg src0, fs_reg src1,fs_reg src2);
 
-   bool equals(fs_inst *inst);
-   bool overwrites_reg(const fs_reg &reg);
-   bool is_send_from_grf();
-   bool is_partial_write();
-   int regs_read(fs_visitor *v, int arg);
-
-   bool reads_flag();
-   bool writes_flag();
+   bool equals(fs_inst *inst) const;
+   bool overwrites_reg(const fs_reg &reg) const;
+   bool is_send_from_grf() const;
+   bool is_partial_write() const;
+   int regs_read(fs_visitor *v, int arg) const;
+
+   bool reads_flag() const;
+   bool writes_flag() const;
 
    fs_reg dst;
    fs_reg src[3];