Skip to content

Fix #10870: Guard null IRNameHintDecoration in mesh shader legalization#10914

Merged
kaizhangNV merged 1 commit intomasterfrom
dev/trilby/fix-10870
Apr 23, 2026
Merged

Fix #10870: Guard null IRNameHintDecoration in mesh shader legalization#10914
kaizhangNV merged 1 commit intomasterfrom
dev/trilby/fix-10870

Conversation

@nv-slang-bot
Copy link
Copy Markdown
Contributor

@nv-slang-bot nv-slang-bot Bot commented Apr 22, 2026

Summary

When compiling a mesh shader with -obfuscate, the obfuscation pass strips IRNameHintDecoration from IR instructions. The GLSL legalization pass's legalizeMeshOutputParam() and legalizeMeshPayloadInputParam() then crash (segfault) by unconditionally dereferencing the null result of findDecoration<IRNameHintDecoration>().

This patch adds null-guards matching the pattern already used at four other sites in the same file.

Fixes #10870

Changes

  • source/slang/slang-ir-glsl-legalize.cpp: Guard findDecoration<IRNameHintDecoration>() with null-check in legalizeMeshOutputParam() (line 3527) and legalizeMeshPayloadInputParam() (line 3147), matching the existing pattern at lines 2170, 2239, 2966, 3015
  • tests/pipeline/rasterization/mesh/obfuscate-mesh.slang: Regression test verifying mesh shader compiles with -obfuscate without crashing

Test

Added tests/pipeline/rasterization/mesh/obfuscate-mesh.slang — compiles a mesh shader to SPIR-V assembly with -obfuscate and verifies the entry point is emitted correctly.

The obfuscation pass strips IRNameHintDecoration from IR instructions.
legalizeMeshOutputParam() and legalizeMeshPayloadInputParam() in the
GLSL legalization pass unconditionally dereferenced the decoration,
causing a segfault when compiling mesh shaders with -obfuscate. Add
null-guards matching the pattern already used at four other sites in
the same file.

Fixes #10870
@nv-slang-bot nv-slang-bot Bot requested a review from a team as a code owner April 22, 2026 14:48
@nv-slang-bot nv-slang-bot Bot added the pr: non-breaking PRs without breaking changes label Apr 22, 2026
@nv-slang-bot nv-slang-bot Bot requested review from bmillsNV and removed request for a team April 22, 2026 14:48
@kaizhangNV kaizhangNV added this pull request to the merge queue Apr 23, 2026
Merged via the queue into master with commit fa86b2c Apr 23, 2026
73 of 75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: non-breaking PRs without breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

obfuscate flag errors for mesh shaders

2 participants