New picking framework - #96
Open
ccpisheden wants to merge 23 commits into
Open
ccpisheden wants to merge 23 commits into
ccpisheden wants to merge 23 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Readback lifetime and region handling defects, duplicate instance identifiers, and changed object-resolution behavior can produce invalid or incorrect picking results.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (6)
Defer DX12 readback resource release until GPU completion · New Reject invalid backend readbacks before mapping · New Handle BeginRenderContext failure before issuing readback commands · New Advance picking indices across merged mesh additions · New Initialize stub readbacks from the source texture data · New Add asynchronous readback coverage for regions and lifetimes · New
What changed in this PR
Introduces asynchronous GPU readbacks and expands picking results to include 64-bit object pointers plus two additional data values.
Changes:
- Adds cross-backend
Tr2ReadbackALsupport. - Reworks scene/debug/instanced-mesh picking and Python APIs.
- Propagates 64-bit picking identifiers through render data.
| File | Description |
|---|---|
trinityal/stub/Tr2TextureALStub.h |
Declares stub readback support. |
trinityal/stub/Tr2TextureALStub.cpp |
Implements stub readbacks. |
trinityal/src/Tr2TextureAL.cpp |
Adds public readback wrapper. |
trinityal/metal/Tr2TextureALMetal.mm |
Implements Metal readbacks. |
trinityal/metal/Tr2TextureALMetal.h |
Declares Metal readback resources. |
trinityal/include/Tr2TextureAL.h |
Exposes the readback API. |
trinityal/dx12/Tr2TextureALDx12.h |
Declares DX12 readback resources. |
trinityal/dx12/Tr2TextureALDx12.cpp |
Implements DX12 readbacks. |
trinityal/dx11/Tr2TextureALDx11.h |
Declares DX11 readback resources. |
trinityal/dx11/Tr2TextureALDx11.cpp |
Implements DX11 readbacks. |
trinity/Utilities/BVH.cpp |
Adds an explicit index cast. |
trinity/Tr2SkinnedModel.cpp |
Propagates picking pointers. |
trinity/Tr2RenderContext.h |
Stores split picking-pointer variables. |
trinity/Tr2RenderContext.cpp |
Uploads pointer halves and area data. |
trinity/Tr2PickBuffer.h |
Simplifies synchronous mapping API. |
trinity/Tr2PickBuffer.cpp |
Updates pick-buffer mapping. |
trinity/Tr2PerObjectData.h |
Replaces user data with 64-bit picking data. |
trinity/Tr2DebugRenderer.h |
Updates debug picking interface. |
trinity/Tr2DebugRenderer.cpp |
Integrates debug geometry into shared picking. |
trinity/ITr2PickableScene.cpp |
Adopts the updated picking API. |
trinity/Interior/Tr2IntSkinnedObject.cpp |
Propagates picking pointers. |
trinity/Eve/SpaceObject/Children/EveChildMesh.cpp |
Simplifies LOD lookup. |
trinity/Eve/SpaceObject/Children/EveChildInstancedMeshes.cpp |
Adds per-instance picking metadata. |
trinity/Eve/EveSpaceScene.h |
Declares new picking buffers and APIs. |
trinity/Eve/EveSpaceScene.cpp |
Implements the new picking pipeline. |
trinity/Eve/EveSpaceScene_Blue.cpp |
Exposes expanded Python picking results. |
trinity/Eve/EvePicking.h |
Redesigns pending readback state. |
trinity/Eve/EvePicking.cpp |
Stores two extra result values. |
trinity/Eve/EveInstancedMeshManager.h |
Extends instance picking data. |
trinity/Eve/EveInstancedMeshManager.cpp |
Uploads and renders new picking metadata. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
This PR replaces the old picking system with a new picking framework, which unifies all types of EveSpaceScene picking and is extensible to new types of rendering.
Linked issue (optional)
https://fenriscreations.atlassian.net/browse/PLAT-11733
Testing
Tested on DX11/DX12, and on Metal. Picking functions as before.
AI assistance
None
Checklist
Since picking is now done with a different texture format (RGBA32_UINT instead of the god-awfull RGBA8_UNORM hack), shaders had to be updated to write out the new picking data. The fixed shaders are in the TE-PICKING-FRAMEWORK Perforce stream, which must be merged after merging this PR.