Skip to content

[d3d12] Rework signal handlers to dump debug info. Prevent rogue pointer access.#1076

Open
manon-traverse wants to merge 1 commit intollvm:mainfrom
Traverse-Research:render-backend-dx12-signal-handler
Open

[d3d12] Rework signal handlers to dump debug info. Prevent rogue pointer access.#1076
manon-traverse wants to merge 1 commit intollvm:mainfrom
Traverse-Research:render-backend-dx12-signal-handler

Conversation

@manon-traverse
Copy link
Copy Markdown
Contributor

We can register the signal handler on device creation instead of in the executeProgram function. This brings the three executeProgram implementations closer to each other and causes this debug feature to now always be enabled.

Additionally, there was an issue where a rogue pointer access could occur if the signal handler was triggered after device clean-up. That problem is resolved with this PR as well.

@manon-traverse manon-traverse marked this pull request as ready for review April 10, 2026 09:50
template <> char CapabilityValueEnum<directx::ShaderModel>::ID = 0;
template <> char CapabilityValueEnum<directx::RootSignature>::ID = 0;

static std::mutex SignalHandlerMutex;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lock may seem overkill as our use cases are single-threaded at the moment. However, the overhead of this mutex is so small it makes sense to have it there in case we ever go into a complex multi-threaded scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant