Skip to content

Support coherent/globallycoherent in DescriptorHandle type modifier#10898

Open
nv-slang-bot[bot] wants to merge 1 commit intomasterfrom
dev/trilby/fix-10852
Open

Support coherent/globallycoherent in DescriptorHandle type modifier#10898
nv-slang-bot[bot] wants to merge 1 commit intomasterfrom
dev/trilby/fix-10852

Conversation

@nv-slang-bot
Copy link
Copy Markdown
Contributor

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

Summary

  • Adds CoherentModifierVal to the type modifier system so DescriptorHandle<coherent T> and DescriptorHandle<globallycoherent T> compile instead of triggering ICE E99999
  • Threads the coherent attribute through the full pipeline: AST → IR → HLSL/GLSL/SPIRV emit
  • Adds regression test tests/bugs/gh-10852.slang

Fixes #10852

Changes

  • AST: New CoherentModifierVal class + ASTBuilder::getCoherentModifierVal() factory
  • Semantic check: Handle GloballyCoherentModifier in checkTypeModifier() (was the ICE source)
  • IR: New CoherentAttr attribute in slang-ir-insts.lua + stable name
  • IR lowering: visitCoherentModifierValkIROp_CoherentAttr
  • HLSL emit: CoherentAttrgloballycoherent prefix
  • GLSL emit: CoherentAttrcoherent prefix
  • SPIRV emit: CoherentAttrOpDecorate Coherent + coherent memory operands for Vulkan memory model; unwrap IRAttributedType in descriptor handle cast

Test

Added tests/bugs/gh-10852.slang — verifies HLSL output includes globallycoherent RWTexture2D<float4> for both coherent and globallycoherent descriptor handles.

Labels

pr: non-breaking

Add CoherentModifierVal to the type modifier system so that
DescriptorHandle<coherent T> and DescriptorHandle<globallycoherent T>
compile instead of triggering ICE E99999 in checkTypeModifier().

Pipeline: GloballyCoherentModifier -> CoherentModifierVal -> CoherentAttr IR
-> target-specific emit (HLSL: globallycoherent, GLSL: coherent, SPIRV:
OpDecorate Coherent / coherent memory operands).

Fixes #10852
@nv-slang-bot nv-slang-bot Bot requested a review from a team as a code owner April 21, 2026 14:46
@nv-slang-bot nv-slang-bot Bot requested review from bmillsNV and removed request for a team April 21, 2026 14:46
@nv-slang-bot nv-slang-bot Bot added the pr: non-breaking PRs without breaking changes label Apr 21, 2026
@slangbot
Copy link
Copy Markdown
Contributor

⚠️ IR Instruction Files Changed

This PR modifies IR instruction definition files. Please review if you need to update the following constants in source/slang/slang-ir.h:

  • k_minSupportedModuleVersion: Should be incremented if you're removing instructions or making breaking changes
  • k_maxSupportedModuleVersion: Should be incremented when adding new instructions

These version numbers help ensure compatibility between different versions of compiled modules.

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.

Support coherent bindless textures

1 participant