Repository navigation
[field] Fixing GetSceneBounds including the bounds of a field without samples - #47
Merged
sherholz merged 1 commit intoNov 8, 2026
Conversation
… samples Signed-off-by: Euan Hughes <realeuanhughes@gmail.com>
sherholz
approved these changes
Nov 8, 2026
sherholz
left a comment
Contributor
There was a problem hiding this comment.
I would be interested how you found these problems in a practical use case.
Contributor
Author
|
@sherholz I've been adding OpenPGL to my renderer, noting the bugs I find along the way. This came up while I was debugging: I called #48 I found by looking for other uninitialized |
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.
Found this bug when calling
SurfaceVolumeField::getSceneBounds()without callingSetSceneBounds().getSceneBounds()merges the surface and volume field's bounds, even if there are no volume samples. In this case,m_sceneBoundsis then either uninitialized, or stale, sinceresetField()keeps the old bounds.You can reproduce this bug in a scene without volumes by calling
Updatewith surface samples only,GetSceneBounds()returns the surface bounds extended by uninitialized memory. Likewise, afterReset(), a field that gets no new samples still adds its old bounds.The fix is to initialize and reset
m_sceneBoundsasembree::empty, that way merging is a no-op.