Skip to content

Paint: hardware-accelerated flood fill#2333

Merged
ghaerr merged 3 commits intoghaerr:masterfrom
Vutshi:fillflood2
May 7, 2025
Merged

Paint: hardware-accelerated flood fill#2333
ghaerr merged 3 commits intoghaerr:masterfrom
Vutshi:fillflood2

Conversation

@Vutshi
Copy link
Copy Markdown
Contributor

@Vutshi Vutshi commented May 6, 2025

Use VGA Read Mode 1 for hardware-accelerated color comparison to optimize flood fill operations. Add segment expansion functions that leverage VGA color compare features for improved performance with bit-level optimizations.

Use VGA Read Mode 1 for hardware-accelerated color comparison to
optimize flood fill operations. Add segment expansion functions that
leverage VGA color compare features for improved performance with
bit-level optimizations.
@Vutshi Vutshi mentioned this pull request May 6, 2025
Move initialization of VGA color comparison mode from implicit calls in
cmp8() to explicit calls where needed. This provides better control over
VGA mode setting and prevents unnecessary reinitialization.
@ghaerr
Copy link
Copy Markdown
Owner

ghaerr commented May 7, 2025

Very nice work using VGA hardware acceleration to greatly increase drawing speed! Your work is definitely showing how closer attention to the hardware can eliminate what we might have once thought were permanent bottlenecks.

I'm thinking perhaps this approach might also be able to be used to increase the speed of non-XOR cursor drawing, for certain filled cursor shapes. I haven't figured out how that might work yet, though.

Comment thread elkscmd/gui/graphics.c Outdated
@Vutshi
Copy link
Copy Markdown
Contributor Author

Vutshi commented May 7, 2025

another 0.4 second saved: 0m21.690s

@ghaerr
Copy link
Copy Markdown
Owner

ghaerr commented May 7, 2025

Looks good, I'll commit now.

I would say that if in the upper level you calculated a premultiplied y offset for each line, and then tracked x via offset only, that would eliminate lots of x >> 3 and x << 3, and cmp8 would only have to add the x + y offsets together to get the byte.

are you traveling far from home?

I've been in Paris for the last week, working on my French lol. Will be around for another week! :)

@ghaerr ghaerr merged commit 7f181dc into ghaerr:master May 7, 2025
@Vutshi Vutshi deleted the fillflood2 branch May 7, 2025 08:30
@Vutshi
Copy link
Copy Markdown
Contributor Author

Vutshi commented May 7, 2025

I've been in Paris for the last week, working on my French lol. Will be around for another week! :)

I see—have fun! The concentration of ELKS enthusiasts in Europe has become dangerously high, so I’ll be flying to China tomorrow to restore some balance 🙂.

Meanwhile, as you brush up on your French, I’ve got a fresh case of ELKS panic attack for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants