DXC accepts `TextureCubeArray.SampleCmpGrad` despite explicit exclusion from hlsl-spec proposal 0014
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read proposal 0014’s HLSL and DXIL exclusions, DXC’s TextureCUBEArrayMethods declarations, and tools/clang/test/HLSLFileCheck/hlsl/objects/Texture/SampleCmpGrad.hlsl. Reproduce with the supplied HLSL and compiler arguments, then determine whether cube-array support is intended. Done means the implementation, regression test, and proposal agree on the supported behavior.
索引モデルが issue の本文から書いたものです。
説明
Summary
DXC 1.9.2609 accepts TextureCubeArray<float>.SampleCmpGrad in a pixel shader and emits DXIL sampleCmpGrad (opcode 254) using a cube-array resource. hlsl-specs proposal 0014 explicitly excludes this receiver in both its HLSL and DXIL sections.
It needs to be clarified whether cube-array support is intentional and align the implementation and proposal.
Reproduction
Godbolt: https://godbolt.org/z/PdTavoj7o
Self-contained source; no headers, defines or external files:
TextureCubeArray<float> tex : register(t0);
SamplerComparisonState cmp : register(s0);
float main(float4 location : TEXCOORD0) : SV_Target {
return tex.SampleCmpGrad(cmp, location, 0.5f,
float3(0.01f, 0, 0),
float3(0, 0.01f, 0));
}
Compiler args are -T ps_6_8 -E main -HV 2021 -O3: pixel shader, SM6.8, entry main, HLSL2021, optimized DXIL output. The returned shader value keeps the texture operation observable.
Expected versus actual
Expected under the proposal’s stated exclusion: diagnose SampleCmpGrad on TextureCubeArray rather than generate the operation for that receiver.
Actual: compilation succeeds without diagnostics and generates dx.op.sampleCmpGrad.f32 with opcode 254. Its texture operand comes from an annotateHandle whose resource-properties kind is 9, identified by DXC’s disassembly as TextureCubeArray<F32>.
If cube-array support is intentional: correct the proposal’s HLSL and DXIL exclusions instead of rejecting currently supported programs.
Observed compiler results
Tested 2026-10-21 UTC through Compiler Explorer’s compilation API:
| Compiler ID | Returned name / version | User arguments | Exit code | Decisive result |
|---|---|---|---|---|
dxc_1_9_2609 |
DXC 1.9.2609 / 1.9.2609 |
-T ps_6_8 -E main -HV 2021 -O3 |
0 | Emits dx.op.sampleCmpGrad.f32, opcode 254, using the annotated cube-array handle. |
hlsl_clang_trunk |
Clang (trunk) / (trunk) |
-T ps_6_8 -E main -HV 2021 -O3 |
1 | error: no member named 'SampleCmpGrad' in 'hlsl::TextureCubeArray<float>' |
A nonarray control—replace TextureCubeArray<float> with TextureCube<float> and pass location.xyz—also compiles with DXC. Clang reports the same missing-member error for hlsl::TextureCube<float>. Its failure therefore does not establish that it implements the proposal’s cube-array restriction; it is comparison context, not the correctness oracle.
Compiler Explorer injects -Zi, -Qembed_debug and disassembly-output options. Its Clang adapter additionally supplies --driver-mode=dxc. Clang warns that the injected -Qembed_debug is unused and that HLSL2021 support is incomplete; those warnings are separate from the source diagnostic. Neither API result timed out or was truncated.
Conflicting references
- Proposal 0014, HLSL additions: “
TextureCubeArraydoes not support theSampleCmpGradmethod.” - Proposal 0014, DXIL additions: valid resources follow
sampleGrad, “except thatTextureCubeArrayresources are invalid.” The published proposal still contains both exclusions. - DXC’s intrinsic declarations provide
SampleCmpGradoverloads inTextureCUBEArrayMethods. - DXC’s existing regression shader declares
TextureCubeArray<float4>and calls itsSampleCmpGradmethod, with a check for opcode 254. This is evidence that support is represented in upstream tests, not just an accidental parser acceptance.
- 主要言語
- C++
- スター
- 3.7k
- フォーク
- 926
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/DirectXShaderCompiler のほかの issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/DirectXShaderCompiler#9173 ·
メンテナーはふだん 2 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
microsoft/DirectXShaderCompiler#9155 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/DirectXShaderCompiler#9135 ·
メンテナーはふだん 2 日以内に返信
-
DXC emits DW_LANG_C_plus_plus instead of DW_LANG_HLSL for HLSL対応中かも @rj123-nv が 18 日前に担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/DirectXShaderCompiler#9087 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/DirectXShaderCompiler#9086 ·
メンテナーはふだん 2 日以内に返信
microsoft/DirectXShaderCompiler の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
feature:config kind:docs os:windows toolchain:cmake triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
arch-based bug niri
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
noctalia-dev/noctalia#5552 ·
メンテナーはふだん 1 日以内に返信