[Mesa-dev] [PATCH v3 03/10] mesa/st/tests: base check of number of registers on opcode info

Gert Wollny gw.fossdev at gmail.com
Wed Oct 25 09:51:45 UTC 2017


 * Test number of operands by using num_inst_src_regs/num_inst_dst_regs
   and fix tests accordingly.

Signed-off-by: Gert Wollny <gw.fossdev at gmail.com>
---
 src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp
index 80ea19fa80..1a3c8cfa32 100644
--- a/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp
+++ b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp
@@ -912,7 +912,7 @@ TEST_F(LifetimeEvaluatorExactTest, FRaWSameInstructionInLoopAndCondition)
    const vector<MockCodeline> code = {
       { TGSI_OPCODE_BGNLOOP },
       {   TGSI_OPCODE_BGNLOOP },
-      {     TGSI_OPCODE_IF, {0}, {in0}, {} },
+      {     TGSI_OPCODE_IF, {}, {in0}, {} },
       {       TGSI_OPCODE_ADD, {1}, {1,in0}, {}},
       {     TGSI_OPCODE_ENDIF},
       {     TGSI_OPCODE_MOV, {1}, {in1}, {}},
@@ -1468,8 +1468,8 @@ glsl_to_tgsi_instruction *MockCodeline::get_codeline() const
    next_instr->op = op;
    next_instr->info = tgsi_get_opcode_info(op);
 
-   assert(src.size() < 5);
-   assert(dst.size() < 3);
+   assert(src.size() == num_inst_src_regs(next_instr));
+   assert(dst.size() == num_inst_dst_regs(next_instr));
    assert(tex_offsets.size() < 3);
 
    copy(src.begin(), src.end(), next_instr->src);
-- 
2.13.6



More information about the mesa-dev mailing list