Repository navigation
Conversation
flyinghead#2452 vectorized the 16-bit framebuffer write modes. The 32-bit ones, 0888 KRGB and 8888 ARGB, still went through the scalar per-pixel writer. One packed pixel is exactly one VRAM word, so they fit the same 8-word interleaved store as the 16-bit path, 8 pixels per iteration. The store is factored out of storeFramebuffer16Pixels() so both use it. 888 (24-bit packed) stays scalar: its pixels straddle VRAM words, so the store pattern only repeats every 4 pixels / 3 words. The address walk is the same as writeFramebufferLW(), so the output is identical to the scalar path, including when the padding isn't a multiple of 4. A harness writing 7,056 frames through both paths (both channel orders, modes 4 to 6, 6 frame sizes, 7 destination addresses including bank and VRAM edges, 7 line strides, 4 clip windows) gives byte-identical VRAM. The same algorithm measured about 2x faster on a 640x480 8888 frame (0.213 ms to 0.105 ms) on Apple Silicon. Other architectures are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2452 vectorized the 16-bit framebuffer write modes. The 32-bit ones,
0888 KRGB and 8888 ARGB, still went through the scalar per-pixel writer.
One packed pixel is exactly one VRAM word, so they fit the same 8-word
interleaved store as the 16-bit path, 8 pixels per iteration. The store
is factored out of storeFramebuffer16Pixels() so both use it.
888 (24-bit packed) stays scalar: its pixels straddle VRAM words, so the
store pattern only repeats every 4 pixels / 3 words.
The address walk is the same as writeFramebufferLW(), so the output is
identical to the scalar path, including when the padding isn't a
multiple of 4. A harness writing 7,056 frames through both paths (both
channel orders, modes 4 to 6, 6 frame sizes, 7 destination addresses
including bank and VRAM edges, 7 line strides, 4 clip windows) gives
byte-identical VRAM. The same algorithm measured about 2x faster on a
640x480 8888 frame (0.213 ms to 0.105 ms) on Apple Silicon.
Other architectures are unchanged.
Testing: byte-identical VRAM vs the scalar writer over the 7,056-case sweep described above. Compiles in the libretro core and the standalone build (macOS arm64); x86 paths are untouched.
🤖 Generated with Claude Code