Browse files

GSVector4i: Fix compare64 function.

Fix GSVector4i::compare64 function by adjusting the number of iterations
needed to cover the comparison of all the elements of the input arrays,
where the number of bytes to compare is indicated in the size parameter
of the function.
The function is used only in GSdx-TC to compare CLUT arrays.
On one hand this fix closes the recent #2706 and possibly the color
regressions indicated in #2702 (which were both introduced with the new
PaletteMap mechanism, which partially replaced the GSVector4i::update
logic with the bugged GSVector4i::compare64).
On the other hand this might impact long standing wrong texture cache
lookup when palette was involved with 8-bit palette disabled (to be
verified which ones).

Close #2713
Fixes #2706
Fixes #2715
  • Loading branch information...
AlessandroVetere authored and lightningterror committed Nov 26, 2018
1 parent 9a10612 commit 8ff02492138c5a89c22bff38623c08b92282bee4
Showing with 1 addition and 1 deletion.
  1. +1 −1 plugins/GSdx/GSVector4i.h
@@ -1950,7 +1950,7 @@ class alignas(16) GSVector4i
GSVector4i* s = (GSVector4i*)src;
GSVector4i* d = (GSVector4i*)dst;

for(size_t i = 0; i < size; i += 4)
for(size_t i = 0; i < size; ++i)
GSVector4i v0 = (d[i * 4 + 0] == s[i * 4 + 0]);
GSVector4i v1 = (d[i * 4 + 1] == s[i * 4 + 1]);

1 comment on commit 8ff0249


This comment has been minimized.


willkuer commented on 8ff0249 Nov 26, 2018

Isn‘t the point to check four entries at once?

I.e. isn‘t the correct solution to either add padding to multiples of four or special handling for last iteration/tail if size is not a multiple of four?

Please sign in to comment.