[SPIR-V] Mesh shader output writes are dropped or produce invalid SPIR-V
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
Reproduce each numbered case separately with the dxc command in the issue, using repro.hlsl and one numbered line at a time. The four failures are dropped out-parameter writes, invalid SPIR-V for a single-component SV_Position write under -fvk-invert-y, invalid SPIR-V for bool2 outputs, and dropped inherited struct fields in mesh output writes. Done means each case produces valid SPIR-V with the write reaching the output variable.
由索引模型根据 Issue 内容生成。
描述
Description
Four kinds of write to mesh shader out vertices elements are mishandled:
- Passing an output to an out parameter silently drops the write.
- With -fvk-invert-y, writing one component of SV_Position produces invalid SPIR-V.
- Writing a bool2 output produces invalid SPIR-V.
- Writing a vertex or primitive output whose struct inherits fields from a base struct silently drops the inherited fields.
Steps to Reproduce
struct V { float4 pos : SV_Position; bool2 flag : FLAG; };
void setPos(out float4 p) { p = float4(1, 2, 3, 1); }
[numthreads(1, 1, 1)] [outputtopology("triangle")]
void main(out vertices V v[3], out indices uint3 t[1]) {
SetMeshOutputCounts(3, 1);
t[0] = uint3(0, 1, 2);
setPos(v[0].pos); // (1)
v[1].pos.x = 4; // (2)
v[2].flag = bool2(true, false); // (3)
}
struct Base { float a : A; };
struct V : Base { float4 pos : SV_Position; };
[numthreads(1, 1, 1)] [outputtopology("triangle")]
void main(out vertices V v[3], out indices uint3 t[1]) {
SetMeshOutputCounts(3, 1);
t[0] = uint3(0, 1, 2);
V e = (V)0;
e.a = 1;
v[0] = e; // (4)
}
dxc -T ms_6_5 -E main -spirv -fspv-target-env=vulkan1.3 -fvk-invert-y -fcgl repro.hlsl
Keep only one numbered line at a time to see each failure on its own.
Actual Behavior
- setPos writes to a function-local copy of v, and nothing is stored to gl_Position.
- fatal error: generated SPIR-V is invalid: Reached non-composite type while indexes still remain to be traversed.
- fatal error: generated SPIR-V is invalid: OpAccessChain result type ... %v2bool ... does not match ... %v2uint
- out.var.A is declared, but nothing is ever stored to it; only gl_Position is written.
Environment
• DXC version: 1.10.2609.0
• Host Operating System: Windows
- 主要语言
- C++
- 星标
- 3.7k
- 派生
- 926
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 45
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天内回复