Fix Voodoo 1 dirty_line tracking in single buffer mode#6688
Merged
Conversation
Added logic to handle VGA pass-through state changes and mark lines dirty for refresh.
Added dirty line marking for single buffer mode.
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.
Summary
Fix missing
dirty_linetracking in Voodoo 1 single buffer mode causing rendered content to not be displayed.When rendering directly to the front buffer in single buffer mode, the render thread and fastfill operations were not marking scanlines as dirty. This caused the display thread to skip updating those lines, resulting in stale content from previous frames being shown on screen.
The fix adds proper
dirty_linetracking when rendering triangles and during fastfill operations in single buffer mode.This was visible in 3DMark99 with Voodoo 1 in single buffer mode, where rendered content would not appear on screen, and in Descent 2 with Voodoo 1, where the top and bottom borders showed stale content from previous frames.
Root Cause
In single buffer mode, both the draw buffer and front buffer point to the same memory location (
draw_offset == front_offset). The display thread relies on thedirty_linearray to determine which scanlines need to be refreshed from the framebuffer to the screen.The render thread in
vid_voodoo_render.cand fastfill operation invid_voodoo_blitter.cwere writing pixels directly to the framebuffer but never marking the corresponding lines in thedirty_linearray. The display thread checksdirty_line[draw_line]before updating the screen, so unmarked lines were never refreshed, causing new content to be written to memory but never displayed.The fix ensures that whenever content is written to the front buffer in single buffer mode, the corresponding
dirty_lineentry is marked, allowing the display thread to properly refresh those scanlines.Checklist