[SPIR-V] lit computes specular as n_dot_h * m and fails for half
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Start by reproducing with dxc -T cs_6_5 -E main -spirv repro.hlsl using the shader in the issue, and compare the OpFMul output with the DXIL path. The lit lowering for SPIR-V needs to emit a Pow (GLSL.std.450) for the specular term, and the half overload must produce operands whose types match the result type. Done means the SPIR-V validates and lit(0.5, 0.25, 2) yields (1, 0.5, 0.0625, 1).
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
lit is wrong when targeting SPIR-V:
- The specular term is computed as
n_dot_h * minstead ofpow(n_dot_h, m). DXIL is correct. - The
halfoverload fails to compile.
Repro
dxc -T cs_6_5 -E main -spirv repro.hlsl
RWStructuredBuffer<float4> Out : register(u0);
StructuredBuffer<float> In : register(t1);
[numthreads(1,1,1)]
void main() {
Out[0] = lit(In[0], In[1], In[2]);
}
Output contains OpFMul %float %n_dot_h %m instead of a Pow. For example, lit(0.5, 0.25, 2) returns (1, 0.5, 0.5, 1) instead of (1, 0.5, 0.0625, 1).
Replacing float with half and adding -enable-16bit-types fails with:
fatal error: generated SPIR-V is invalid: GLSL.std.450 FMax: expected types of all operands to be equal to Result Type
%34 = OpExtInst %float %1 FMax %float_0 %29
With constant half arguments (lit((half)0.25, (half)0.5, (half)3.0)), it fails with Internal compiler error: LLVM Assert.
Found by llvm/offload-test-suite#1724.
- Ngôn ngữ chính
- C++
- Star
- 3.7k
- Fork
- 926
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 45
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/DirectXShaderCompiler
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/DirectXShaderCompiler#9173 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
microsoft/DirectXShaderCompiler#9155 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/DirectXShaderCompiler#9135 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
DXC emits DW_LANG_C_plus_plus instead of DW_LANG_HLSL for HLSLCó thể đã có người làm @rj123-nv đã nhận 18 ngày trước. Đang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/DirectXShaderCompiler#9087 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/DirectXShaderCompiler#9086 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của microsoft/DirectXShaderCompiler
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
feature:config kind:docs os:windows toolchain:cmake triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
arch-based bug niri
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
noctalia-dev/noctalia#5552 ·
Maintainer thường phản hồi trong vòng 1 ngày