SampleCmp with gradient or bias flag is lost when a later sample in the function has none
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza con lib/DXIL/DxilShaderFlags.cpp, donde el issue identifica la asignación del flag, y luego busca el código del validador que calcula el mismo flag. Comprueba cómo se actualiza el flag en los opcodes de sample indicados y compáralo con el comportamiento esperado en DXIL.rst. El trabajo está terminado cuando ambas rutas de cálculo del flag conservan el flag si SampleCmpBias o SampleCmpGrad aparece antes de otra instrucción de sample, y la validación acepta la declaración correspondiente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
The SampleCmpGradientOrBias shader flag is not set when SampleCmpBias or SampleCmpGrad is followed in the same function by Sample, SampleBias, SampleGrad, or SampleCmp. It seems the flag depends on the order of the instructions and not on whether SampleCmpBias or SampleCmpGrad itself is used.
Steps to Reproduce
Texture2D<float> depth : register(t0);
SamplerComparisonState less : register(s0);
float4 main(float2 uv : TEXCOORD0) : SV_Target {
return depth.SampleCmpBias(less, uv, 0.5, 1.0) + depth.SampleCmp(less, uv, 0.25);
}
Compiled with dxc -T ps_6_8 -E main you will find no additional functionality is listed, but with the two calls swapped the listing will contain
; Note: shader requires additional functionality:
; SampleCmp with gradient or bias
Expected
The flag should be set whenever SampleCmpBias or SampleCmpGrad is used. The documentation in DXIL.rst says the feature should be listed if "Use of the instructions SampleCmpGrad or SampleCmpBias". When the flag is not present the shader is accepted on devices that lack SampleCmpGradientAndBiasSupported.
Cause
It looks like the flag is assigned rather than accumulated in lib/DXIL/DxilShaderFlags.cpp:
case DXIL::OpCode::Sample:
case DXIL::OpCode::SampleBias:
case DXIL::OpCode::SampleCmp:
case DXIL::OpCode::SampleCmpBias:
...
hasSampleCmpGradientOrBias = dxilOp == DXIL::OpCode::SampleCmpBias;
Since SampleGrad and SampleCmpGrad have a case of their own with the same assignment against SampleCmpGrad, whichever of these instructions comes last in the function decides the flag. I suspect this should've been |= rather than =.
The validator also computes the flags the same way so it has the same issue. If you have a a module that declares the flag for the shader above, it too fails validation with "Flags must match usage" error.
Environment
- DXC 1.9.2609.5
- Lenguaje dominante
- C++
- Estrellas
- 3.7k
- Forks
- 918
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 41
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 65/100
microsoft/DirectXShaderCompiler#9155 ·
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 11 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
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/DirectXShaderCompiler#9015 ·
Los mantenedores suelen responder en 2 días
-
TimeValue.h fails to compile as C++26 with Clang 22Posiblemente ocupada @reginaldalfret la tomó hace 41 días. Abiertobug needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
microsoft/DirectXShaderCompiler#8992 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/DirectXShaderCompiler
Issues similares
-
Errors in 1.20 proseAbiertoCampaign DiD Campaign EI Campaign HttT Campaign TDG Campaign TSG Campaign WoF Enhancement Help Prose Stable 1.20
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wesnoth/wesnoth#11749 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
trabucayre/openFPGALoader#767 ·
Los mantenedores suelen responder en 1 día
-
agent:Windows bug in progress pri:medium sev:low testing windows
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
protocolbuffers/protobuf#31768 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
godotengine/godot#125651 ·
Los mantenedores suelen responder en 1 día