Browse Source

shaderpipeline: Fix bad SPIR-V ID in replace variables pass

rdb 10 months ago
parent
commit
c9eff2503e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      panda/src/shaderpipeline/spirVReplaceVariableTypePass.cxx

+ 6 - 0
panda/src/shaderpipeline/spirVReplaceVariableTypePass.cxx

@@ -96,6 +96,12 @@ transform_function_op(Instruction op) {
               components.push_back(0xffffffff);
               ++i;
             }
+
+            if (new_vector->get_scalar_type() == old_vector->get_scalar_type()) {
+              push_id(op.args[1]);
+              temp = op_vector_shuffle(temp, temp, components);
+              return false;
+            }
             temp = op_vector_shuffle(temp, temp, components);
           }
         }