Module: Mesa
Branch: master
Commit: 2e7f35a8bcb7e8c79e08a6a643a151ffbeeb21ad
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e7f35a8bcb7e8c79e08a6a643a151ffbeeb21ad

Author: Gert Wollny <[email protected]>
Date:   Wed Dec 23 15:25:23 2020 +0100

r600/sfn: merge SpecialValue and InlineConstValue

The latter is the only child class of the former and no other use for
SpecialValue is needed.

Signed-off-by: Gert Wollny <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8210>

---

 src/gallium/drivers/r600/sfn/sfn_value.cpp | 24 +++++++++---------------
 src/gallium/drivers/r600/sfn/sfn_value.h   | 14 +++-----------
 2 files changed, 12 insertions(+), 26 deletions(-)

diff --git a/src/gallium/drivers/r600/sfn/sfn_value.cpp 
b/src/gallium/drivers/r600/sfn/sfn_value.cpp
index cdd1367461d..3228b75fb76 100644
--- a/src/gallium/drivers/r600/sfn/sfn_value.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_value.cpp
@@ -153,19 +153,18 @@ bool LiteralValue::is_equal_to(const Value& other) const
            value() == rhs.value());
 }
 
-SpecialValue::SpecialValue(Type type, int value, int chan):
-   Value(type, chan),
+InlineConstValue::InlineConstValue(int value, int chan):
+   Value(Value::cinline,  chan),
    m_value(static_cast<AluInlineConstants>(value))
 {
 }
 
-uint32_t SpecialValue::sel() const
+uint32_t InlineConstValue::sel() const
 {
    return m_value;
 }
 
-
-void SpecialValue::do_print(std::ostream& os) const
+void InlineConstValue::do_print(std::ostream& os) const
 {
    auto sv_info = alu_src_const.find(m_value);
    if (sv_info != alu_src_const.end()) {
@@ -183,16 +182,6 @@ void SpecialValue::do_print(std::ostream& os) const
    }
 }
 
-PValue Value::zero(new InlineConstValue(ALU_SRC_0, 0));
-PValue Value::one_f(new InlineConstValue(ALU_SRC_1, 0));
-PValue Value::one_i(new InlineConstValue(ALU_SRC_1_INT, 0));
-PValue Value::zero_dot_5(new InlineConstValue(ALU_SRC_0_5, 0));
-
-InlineConstValue::InlineConstValue(int value, int chan):
-   SpecialValue(Value::cinline, value, chan)
-{
-}
-
 bool InlineConstValue::is_equal_to(const Value& other) const
 {
    assert(other.type() == Value::Type::cinline);
@@ -200,6 +189,11 @@ bool InlineConstValue::is_equal_to(const Value& other) 
const
    return sel() == rhs.sel();
 }
 
+PValue Value::zero(new InlineConstValue(ALU_SRC_0, 0));
+PValue Value::one_f(new InlineConstValue(ALU_SRC_1, 0));
+PValue Value::one_i(new InlineConstValue(ALU_SRC_1_INT, 0));
+PValue Value::zero_dot_5(new InlineConstValue(ALU_SRC_0_5, 0));
+
 UniformValue::UniformValue(uint32_t sel, uint32_t chan, uint32_t kcache_bank):
    Value(Value::kconst, chan)
 {
diff --git a/src/gallium/drivers/r600/sfn/sfn_value.h 
b/src/gallium/drivers/r600/sfn/sfn_value.h
index 33d3d745b37..7bc4528f919 100644
--- a/src/gallium/drivers/r600/sfn/sfn_value.h
+++ b/src/gallium/drivers/r600/sfn/sfn_value.h
@@ -162,21 +162,13 @@ private:
    } m_value;
 };
 
-class SpecialValue: public Value {
-protected:
-   SpecialValue(Type type, int value, int chan);
+class InlineConstValue: public Value {
+public:
+   InlineConstValue(int value, int chan);
    uint32_t sel() const override final;
 private:
    void do_print(std::ostream& os) const override;
-   AluInlineConstants m_value;
-};
-
-class InlineConstValue: public SpecialValue {
-public:
-   InlineConstValue(int value, int chan);
    bool is_equal_to(const Value& other) const override;
-
-private:
    AluInlineConstants m_value;
 };
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to