Parcourir la source

Fix bad merge conflict for WaveActiveAllEqual Execution Test (#308)

Young Kim il y a 8 ans
Parent
commit
e168e0c711
1 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 7 4
      tools/clang/unittests/HLSL/ExecutionTest.cpp

+ 7 - 4
tools/clang/unittests/HLSL/ExecutionTest.cpp

@@ -363,10 +363,13 @@ struct computeExpected<InType, OutType, ShaderOpKind::WaveActiveAllEqual> {
   OutType operator()(const std::vector<InType> &inputs,
                      const std::vector<int> &masks, int maskValue,
                      unsigned int index) {
-    OutType val = inputs.at(0); // assuming there is always one lane per wave
-    for (size_t i = 1; i < index; ++i) {
-      if (masks.at(i) == maskValue && val != inputs.at(i)) {
-        return 0;
+    const InType *val = nullptr;
+    for (size_t i = 0; i < index; ++i) {
+      if (masks.at(i) == maskValue) {
+        if (val && *val != inputs.at(i)) {
+          return 0;
+        }
+        val = &inputs.at(i);
       }
     }
     return 1;