aov.cpp, test_aov.py: fix shape_index for JIT variants - #1889
Open
LinasBeres wants to merge 1 commit into
Open
Conversation
Previously, shape_index AOV reinterpreted the raw ShapePtr as a uint32, producing garbage values in JIT/CUDA variants instead of a proper scene index. Fix by iterating over scene.shapes() and match the hit shape. Also adds test08_shape_index_correct which verifies the output contains only valid indices. Fixes mitsuba-renderer#1059.
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.
Fix shape_index AOV for JIT/CUDA variants
Previously, the
shape_indexAOV reinterpreted the rawShapePtras auint32, producing garbage values in JIT/CUDA variants instead of a proper scene index. This made the channel unusable for segmentation masks and per-shape identification in any JIT variant.Further fixes #1059.
Description
The
shape_indexAOV channel is documented to return an integer index into the scene's shape list. In scalar variants this worked correctly. In JIT variants the rawShapePtrvalue was cast touint32, producing arbitrary large integers instead of indices in{0, 1, ..., N}.Testing
Added
test08_shape_index_correctintest_aov.py. The test renders a two-rectangle scene with an orthographic camera, box filter, and spp=1 to avoid fractional blending of indices.Checklist
cuda_*andllvm_*variants. If you can't test this, please leave below