Commit Graph

17 Commits

Author SHA1 Message Date
fp64 5c67109862 Update NEON PMA to match scalar/SSE2
See https://github.com/hrydgard/ppsspp/pull/20902#issuecomment-3429764588 for details.

WARNING: not at all tested in actual PPSSPP, only godbolt for relevant snippet. Verification that it works would be good.

Again, this should be slightly slower than the current version, which shouldn't matter. The goal is accuracy/consistency here.
2025-10-22 14:13:07 +03:00
fp64 9932ad3f85 Improve accuracy of SSE2 PMA conversion
This makes SSE2 version match the (correctly-rounded)
scalar reference (which the current version doesn't:
see https://godbolt.org/z/hK5938jda).

The new implementation uses the same idea as mentioned in
https://github.com/hrydgard/ppsspp/pull/20870#issuecomment-3413134437

It may be a bit slower than current implementation (which
simply truncates?), but correctness/consistency is
probably worth it.

The difference is slight (by 1 in RGB color channels),
but observable in synthetic examples (in particular the
current implementation darkens completely opaque parts,
including `0xFFFFFFFF` -> `0xFFFEFEFE`, and, more
strikingly,`0xFF010101` -> `0xFF000000`).

This doesn't touch NEON part at all (so "vibe-coded" comment
stays for now), but it shouldn't be too hard to port.
2025-10-21 08:04:37 +03:00
Henrik Rydgård 230fa1a985 Improve the premul alpha conversion 2025-10-16 11:07:05 +02:00
Henrik Rydgård cec4cd28dd Make compatible with SSE2 (_mm_mullo_epi32 is SSE4.1) 2025-10-16 11:07:05 +02:00
Henrik Rydgård f0b5209908 Convert all UI atlas images to premultiplied alpha format 2025-10-16 11:07:05 +02:00
Henrik Rydgård c92b3b6521 Move prototype cross simd wrapper structs to CrossSIMD.h 2024-12-21 14:27:59 +01:00
Henrik Rydgård 6481fc9989 Implement fp64's color conversion function in ConvertRGBA8888ToRGBA5551 2024-12-20 10:45:17 +01:00
Henrik Rydgård d2a96dc7b5 Replace some SSE4-specific operations with SSE2 sequences. 2024-12-19 16:08:59 +01:00
Henrik Rydgård 77825484a0 If available, use 16-bit texture formats for MakePixelTexture when appropriate.
Optimization for God of War on low-end platforms. Avoids calling a color
conversion function that's currently only SIMD-optimized on x86, so will
also benefit ARM a little bit.
2023-11-12 15:58:03 +01:00
Unknown W. Brackets e3fdb183f6 Common: Remove some unused color conv funcs.
We already have versions of these doing other conversions.
2022-12-10 21:13:36 -08:00
Henrik Rydgård 6bc7a699fe Minor cleanups in framebuffer manager 2022-04-30 18:14:53 +02:00
Henrik Rydgård a68ddd0a8d Merge separate NEON functions into the normal functions.
We no longer support non-NEON ARM.

It's nice also to have the NEON and SSE implementations "close" to each
other, easier to port optimizations back and forth etc.
2022-04-12 23:43:21 +02:00
Unknown W. Brackets b4eab72015 Common: Fix conversion of 4444 to BGRA.
This was affecting tests emitting screenshots in 4444 as well as Direct3D
backends.
2022-01-23 19:22:32 -08:00
Unknown W. Brackets 8a00c2d233 GPU: Allow gcc/clang/icc runtime SSE4 usage.
All our builds before were only using SSE4 in jit...
2022-01-08 17:09:09 -08:00
Unknown W. Brackets e869a3979b Draw: Centralize funcs in ColorConv. 2021-05-01 11:20:05 -07:00
Unknown W. Brackets 915265e531 Draw: Optimize GL A1R5G5B5 conversion.
This seems to be enough to trigger SIMD in x86_64 at least.
2021-05-01 11:20:05 -07:00
Unknown W. Brackets 8a8328c431 Common: Move ColorConv to a more appropriate place. 2021-05-01 11:20:05 -07:00