[SM6.10][Bugfix] Fix Size check for input interpreted vector in MultiplyAdd#8388
[SM6.10][Bugfix] Fix Size check for input interpreted vector in MultiplyAdd#8388hekota wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…plyAdd Fixes vector size check for input interpreted vector. Adds tests for MultiplyAdd with odd sizes and with packed input vector. Fixes microsoft#8385
| // clang-format off | ||
| typename hlsl::enable_if< | ||
| InterpretedVector<InputElTy, VecK, InputInterp>::Size == K, | ||
| InterpretedVector<InputElTy, VecK, InputInterp>::Size >= K, |
There was a problem hiding this comment.
Shouldn't this check a range? The min/max would be the same for non-packed components, but would have a range of valid sizes for packed components, accounting for the use of between 1 and 4 components packed into the last scalar.
There was a problem hiding this comment.
But I suppose this change will unblock scenarios for now, since the range check would be significantly more complicated to write.
There was a problem hiding this comment.
I should mention that alternatively, converting K to packed scalar size (div by ElementsPerScalar rounded up) and comparing that to VecK, might be simpler than comparing a range.
tex3d
left a comment
There was a problem hiding this comment.
I think the right check is for a range, but this will unblock valid scenarios for now, so we should at least get this mitigation in.
Fixes vector size check for input interpreted vector.
Adds tests for MultiplyAdd with odd vector and matrix sizes, and with packed input vector.
Fixes #8385