From 8b1ab5c93bfcc22b7f50a5c10958e43d0571f8a0 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 27 Mar 2014 09:40:30 -0700 Subject: [PATCH] i965/fs: Mark appropriate fs_inst members as const. Reviewed-by: Anuj Phogat --- src/mesa/drivers/dri/i965/brw_fs.cpp | 14 +++++++------- src/mesa/drivers/dri/i965/brw_fs.h | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index c88f7c9b7b1..fd9fba73d50 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -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 ®) +fs_inst::overwrites_reg(const fs_reg ®) const { return (reg.file == dst.file && reg.reg == dst.reg && @@ -353,7 +353,7 @@ fs_inst::overwrites_reg(const fs_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; diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 0d064f60888..408669358b2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -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 ®); - 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 ®) 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]; -- 2.30.2