Skip to content

Update SPIRV-Tools to 1c336172 - #8738

Merged
Damyan Pepper (damyanp) merged 2 commits into
microsoft:mainfrom
damyanp:user/damyanp/spirv-tools-8603-main
Aug 6, 2026
Merged

Update SPIRV-Tools to 1c336172#8738
Damyan Pepper (damyanp) merged 2 commits into
microsoft:mainfrom
damyanp:user/damyanp/spirv-tools-8603-main

Conversation

@damyanp

@damyanp Damyan Pepper (damyanp) commented Aug 6, 2026

Copy link
Copy Markdown
Member

Fixes #8603: MergeBinaryOpSelect produced an OpSelect with a vector result type and a scalar condition, which is only legal in SPIR-V 1.4+ (KhronosGroup/SPIRV-Tools#6827).

This exposes #8740 where the resource-heap-ext-texture.hlsl test fails validation - for now this is worked around by disabling the test, since #8517 looks like it is reworking it anyway.

Assisted-by: copilot

Fixes microsoft#8603: MergeBinaryOpSelect produced an OpSelect with a vector
result type and a scalar condition, which is only legal in SPIR-V 1.4+
(KhronosGroup/SPIRV-Tools#6827).

Assisted-by: copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b04b21af-2d8b-4af5-b9ad-1b84073588f5
Copilot AI balanced review requested due to automatic review settings August 6, 2026 00:03

Copilot AI 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.

Pull request overview

Updates SPIRV-Tools to address invalid OpSelect generation for SPIR-V 1.3 and earlier.

Changes:

  • Incorporates the upstream SPIRV-Tools fix for issue #8603.
  • Documents the user-visible compiler bug fix in the upcoming release notes.

@damyanp

Copy link
Copy Markdown
Member Author

Hmm, this is failing with:

/Users/runner/work/1/s/tools/clang/test/CodeGenSPIRV/resource-heap-ext-texture.hlsl:43:27: warning: SPV_EXT_descriptor_heap support is incomplete.
    SamplerState mySamp = SamplerDescriptorHeap[0];
                          ^
fatal error: generated SPIR-V is invalid: Array must be explicitly laid out with ArrayStride or ArrayStrideIdEXT decorations. Instantiated via '36[%36]' in the UniformConstant storage class using standard layout rules.
This is may be allowed if you enable the scalarBlockLayout feature (or use the --scalar-block-layout command line flag)
  %_runtimearr_type_2d_image = OpTypeRuntimeArray %type_2d_image

Since #8517 is going to remove this test, I'm inclined to disable the test.

The validator now requires explicit layout for UniformConstant when
SPV_EXT_descriptor_heap is used (KhronosGroup/SPIRV-Tools#6792), which
DXC's descriptor heap codegen does not yet do. Exposed by the
SPIRV-Tools update in 8725f5c.

Assisted-by: copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b04b21af-2d8b-4af5-b9ad-1b84073588f5
Copilot AI review requested due to automatic review settings August 6, 2026 01:09
Comment on lines +3 to +7
// The validator now requires explicit layout for UniformConstant when
// SPV_EXT_descriptor_heap is used (KhronosGroup/SPIRV-Tools#6792). DXC's
// descriptor heap support does not yet emit ArrayStride.
// XFAIL: *

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Jonathan Zakharov (@jzakharovnv), Diego Novillo (@dnovillo) - FYI, please let me know if you think we should be dealing with this some other way.

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

tools/clang/test/CodeGenSPIRV/resource-heap-ext-texture.hlsl:6

  • Marking the entire test XFAIL means none of its existing FileCheck assertions protect descriptor-heap code generation anymore; any unrelated compiler or output regression is accepted as the expected failure. Please isolate the known validator failure instead—for example, keep the current codegen checks on a -Vd RUN and add a separate expected-failure validation RUN—so this test continues covering the emitted extension, heap variables, access chains, loads, and image operations.
// XFAIL: *

@damyanp
Damyan Pepper (damyanp) merged commit ec2ba18 into microsoft:main Aug 6, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[SPIR-V] Env Vulkan 1.1 Validation error: Bad OpSelect instruction produced with optimizations enabled.

4 participants