SPIR-V codegen complains about capabilities despite understanding them properly
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Rust
- Estrellas
- 3.4k
- Forks
- 126
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I was trying to do this:
#[cfg(all(target_arch = "spirv", not(target_feature = "Int64")))]
And despite I see similar code in spirv-std, I'm getting a warning:
warning: unexpected `cfg` condition value: `Int64`
--> ../src/shader.rs:13:15
|
13 | #[cfg(all(target_arch = "spirv", not(target_feature = "Int64")))]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `target_feature` are: `10e60`, `2e3`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-int8`, `amx-tile`, `atomics`, `avx`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, and `avx512vpopcntdq` and 251 more
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
I did some more testing. SPIR-V codegen backend actually understands both target_arch = "spirv" and target_feature = "Int64", here is a simple test case:
#[cfg(all(target_arch = "spirv", target_feature = "Int64"))]
compile_error!("Hello");
Yet it only generates a warning for target_feature = "Int64" and not target_arch = "spirv".
Regular rustc, obviously, complains about either unless unexpected_cfgs is used to suppress the warning. I don't think this is supposed to happen, both should be accepted without warnings by SPIR-V codegen.
Originally posted by @nazar-pc in https://github.com/Rust-GPU/rust-gpu/discussions/304
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.
Línea de trabajo
Reproduce la advertencia con los ejemplos de cfg del issue e inspecciona cómo el backend de generación de código SPIR-V gestiona target_arch y target_feature. Compara sus valores de configuración aceptados con la comprobación de unexpected_cfgs; se considera terminado cuando tanto spirv como Int64 compilan sin advertencias, mientras el comportamiento demostrado de compile_error sigue funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100