Skip to content

Clarify SPV_EXT vs SPV_KHR opacity_micromap behavior equivalence#423

Open
dgkoch wants to merge 4 commits into
mainfrom
clarify-spv-omm-vulkan-gating
Open

Clarify SPV_EXT vs SPV_KHR opacity_micromap behavior equivalence#423
dgkoch wants to merge 4 commits into
mainfrom
clarify-spv-omm-vulkan-gating

Conversation

@dgkoch

@dgkoch dgkoch commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Spell out in the SPV_KHR_opacity_micromap Issues resolution that:

  • Declaring either OpExtension string without OpacityMicromapIdKHR produces the same shader behavior.
  • SPV_EXT_opacity_micromap alone does not imply OMMs are always present.
  • Whether OMM data is consumed during traversal is gated by which Vulkan extension is enabled:
    • VK_EXT_opacity_micromap: OMMs always consumed when present.
    • VK_KHR_opacity_micromap: OMMs consumed only when the shader declares OpacityMicromapIdKHR.

Bumps Last Modified Date to 2026-06-12 and revision to 4.

Resolves the ambiguity raised in vulkan/vulkan#4842.

…kan/vulkan#4842)

Spell out in the Issues resolution that:
- Declaring either OpExtension string without OpacityMicromapIdKHR produces
  the same shader behavior.
- SPV_EXT_opacity_micromap alone does not imply OMMs are always present.
- Whether OMM data is consumed is gated by which Vulkan extension is enabled:
  - VK_EXT_opacity_micromap: OMMs always consumed when present.
  - VK_KHR_opacity_micromap: OMMs consumed only when the shader declares
    OpacityMicromapIdKHR.

Bumps Last Modified Date to 2026-06-12 and revision to 4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dgkoch dgkoch requested a review from HansKristian-Work June 12, 2026 20:26
@alan-baker alan-baker requested a review from dnovillo June 17, 2026 15:36
Comment thread extensions/KHR/SPV_KHR_opacity_micromap.asciidoc Outdated
- Reference "when the <feature> is enabled" at the Vulkan API level
  rather than "declaring the extension string."
- Restructure the resolution as a bulleted list for readability.
- Explicitly state that traversing an OMM acceleration structure with
  the VK_KHR_opacity_micromap feature enabled but without declaring
  the OpacityMicromapIdKHR execution mode is undefined behavior, not
  equivalent to skipping opacity micromaps.
@dgkoch

dgkoch commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Iterated per RT TSG 2026-06-25 feedback (600fec0d). Three things changed:

  1. Reference the Vulkan opacity_micromap micromap feature being enabled at the API level, rather than "declaring the extension string." This matches Vulkan's actual gating model (enabling the extension isn't enough — the feature has to be enabled too), and it disambiguates the KHR case where both an extension and a feature are in play.

  2. Restructured the resolution as a bulleted list for readability.

  3. Explicit undefined for the mismatch case. If a shader traces an acceleration structure that contains opacity micromap data with the VK_KHR_opacity_micromap micromap feature enabled but without declaring OpacityMicromapIdKHR, the traversal result is undefined — this is NOT equivalent to a skip-OMM ray flag. Applications must opt in via the execution mode when they intend to use opacity micromap data.

@HansKristian-Work @dnovillo — please take another look.

@dgkoch dgkoch requested a review from dnovillo July 8, 2026 16:32

@dnovillo dnovillo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

Comment thread extensions/KHR/SPV_KHR_opacity_micromap.asciidoc
dgkoch added 2 commits July 10, 2026 01:31
…e; terminology

- Add a fourth bullet stating explicitly that declaring the
  OpacityMicromapIdKHR execution mode requires the
  VK_KHR_opacity_micromap `micromap` feature to be enabled, because
  the RayTracingOpacityMicromapExecutionModeKHR capability is only
  valid in the Vulkan SPIR-V environment when that feature is
  enabled. Addresses Wooyoung's case 1.2 question.
- Use "module" instead of "shader" throughout the Issues (1)
  resolution, since this is a SPIR-V spec and shaders are a
  higher-level concept.
Match VUID-*-micromap-11636 and shipped VK_EXT_opacity_micromap
behavior more precisely:

- VK_EXT_opacity_micromap consumption is gated on the extension
  being enabled, not on a "micromap feature." The EXT capability
  entry in vk.xml has been extension-gated since day one (2022);
  only the KHR path is feature-gated. Update the sub-bullet and the
  introductory line accordingly.
- The KHR opt-in requires the OpacityMicromapIdKHR execution mode's
  specialization-constant operand to equal VK_TRUE; declaring the
  execution mode with the operand set to VK_FALSE does not count.
  Reflect this in the KHR sub-bullet and in the undefined-behavior
  bullet.
@dgkoch

dgkoch commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Propagating the same two corrections that landed on the parallel Vulkan-side MR (!8409) after Matt Netsch's review there:

  • VK_EXT_opacity_micromap is extension-gated, not feature-gated. The EXT capability entry in vk.xml has been <enable extension="VK_EXT_opacity_micromap"/> since day one (2022), and VUID-*-micromap-11636 gates on the extension being enabled. Only the KHR path is feature-gated. The EXT sub-bullet and the introductory line have been updated to reflect that (822b0b2).
  • The KHR opt-in requires the OpacityMicromapIdKHR operand to equal VK_TRUE. Per VU 11636, declaring the execution mode with the operand set to VK_FALSE doesn't count as opting in. Reflected in the KHR sub-bullet and in the "traversal result is undefined" bullet (822b0b2).

The fourth bullet (added earlier for Wooyoung) is unchanged — it's about whether the module can declare the execution mode at all, which the operand value doesn't affect.

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.

4 participants