[SPIR-V] lit computes specular as n_dot_h * m and fails for half
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
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).
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C++
- Estrellas
- 3.7k
- Forks
- 926
- Merge medio
- 3 d 22 h
- PR fusionados (30 d)
- 45
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/DirectXShaderCompiler
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/DirectXShaderCompiler#9173 ·
Los mantenedores suelen responder en 2 días
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
microsoft/DirectXShaderCompiler#9155 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/DirectXShaderCompiler#9135 ·
Los mantenedores suelen responder en 2 días
-
DXC emits DW_LANG_C_plus_plus instead of DW_LANG_HLSL for HLSLPosiblemente ocupada @rj123-nv la tomó hace 18 días. Abiertobug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/DirectXShaderCompiler#9087 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/DirectXShaderCompiler#9086 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/DirectXShaderCompiler
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
feature:config kind:docs os:windows toolchain:cmake triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
arch-based bug niri
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
noctalia-dev/noctalia#5552 ·
Los mantenedores suelen responder en 1 día