[Mesa-dev] [PATCH 2/7] i965/fs: Mark appropriate fs_inst members as const.
Matt Turner
mattst88 at gmail.com
Mon Mar 31 10:16:24 PDT 2014
---
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 713e477..56cba0e 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 0d064f6..4086693 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];
--
1.8.3.2
More information about the mesa-dev
mailing list