[Mesa-dev] [PATCH 03/13] i965/fs: remove unneeded fs_reg(...) ctor

Emil Velikov emil.l.velikov at gmail.com
Thu Nov 5 08:17:51 PST 2015


From: Emil Velikov <emil.velikov at collabora.co.uk>

By using a default value for brw_reg_type the compiler will reuse
the existing constructor.

Signed-off-by: Emil Velikov <emil.velikov at collabora.co.uk>
---
 src/mesa/drivers/dri/i965/brw_fs.cpp  | 9 ---------
 src/mesa/drivers/dri/i965/brw_ir_fs.h | 4 ++--
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index b812ef5..46941ae 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -892,15 +892,6 @@ fs_visitor::vgrf(const glsl_type *const type)
                  brw_type_for_base_type(type));
 }
 
-fs_reg::fs_reg(enum brw_reg_file file, int nr)
-{
-   init();
-   this->file = file;
-   this->nr = nr;
-   this->type = BRW_REGISTER_TYPE_F;
-   this->stride = (file == UNIFORM ? 0 : 1);
-}
-
 fs_reg::fs_reg(enum brw_reg_file file, int nr, enum brw_reg_type type)
 {
    init();
diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index ec1654c..2e14917 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -37,8 +37,8 @@ public:
 
    fs_reg();
    fs_reg(struct brw_reg reg);
-   fs_reg(enum brw_reg_file file, int nr);
-   fs_reg(enum brw_reg_file file, int nr, enum brw_reg_type type);
+   fs_reg(enum brw_reg_file file, int nr,
+          enum brw_reg_type type = BRW_REGISTER_TYPE_F);
 
    bool equals(const fs_reg &r) const;
    bool is_contiguous() const;
-- 
2.6.2



More information about the mesa-dev mailing list