AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers
BSD 3-Clause "New" or "Revised" License
2.05k stars 347 forks source link

PR/FixBatchedPointCloud #1753

Closed AlexMWells closed 7 months ago

AlexMWells commented 7 months ago

Fixes #1750

Description

Fix issue #1750: Batched shading crashes in point_cloud search if "index" is not passed as an attribute.

Fixed by allocating space for indices on stack before calling into underlying search algorithm which requires them (thus crashed if not provided).

Tests

Added 2 new tests to exercise it with no indices provided and with indices array provided but not long enough. testsuite/pointcloud/rdcloud_varying_mismatch.osl testsuite/pointcloud/rdcloud_varying_no_index.osl

Checklist:

johnhaddon commented 7 months ago

Thanks for jumping on this so quickly @AlexMWells!

AlexMWells commented 7 months ago

@lgritz this is ready for review/merge. It also fixes up the failing CI for icx.

lgritz commented 7 months ago

BTW, don't mind the failure of the "bleeding edge" test -- this is due to something that broke in OpenColorIO's main branch. They have a fix under review currently, so I expect that to go back to passing in the coming days.

lgritz commented 7 months ago

Fixes #1750