Add supported caps info to naga backends (#9068)

* Initial commit

* 3/5 done I think

* Updated naga bin to use new caps

* Made clippy shut up

* Tried to fix dota2 validation error

* HLSL list made, also formatted Cargo.toml

* Made stuff work with snapshots

* Added changelog and GLSL list

* Updated message
This commit is contained in:
Inner Daemons authored and GitHub committed 2026-02-23 06:44:20 -07:00
1 parent 6432094c9e
commit fdd903e6e4
24 files changed
+377 -62

No files matched your search

+15 -13
View File
@@ -628,19 +628,21 @@ fn run() -> anyhow::Result<()> {
let output_paths = files;
// Decide which capabilities our output formats can support.
let validation_caps =
output_paths
.clone()
.fold(naga::valid::Capabilities::all(), |caps, path| {
use naga::valid::Capabilities as C;
let missing = match Path::new(path).extension().and_then(|ex| ex.to_str()) {
Some("wgsl") => C::CLIP_DISTANCE | C::CULL_DISTANCE,
Some("metal") => C::CULL_DISTANCE,
Some("hlsl") => C::empty(),
_ => C::TEXTURE_EXTERNAL,
};
caps & !missing
});
let validation_caps = output_paths
.clone()
.fold(params.capabilities, |caps, path| {
use naga::valid::Capabilities as C;
let allowed = match Path::new(path).extension().and_then(|ex| ex.to_str()) {
Some("wgsl") => naga::back::wgsl::supported_capabilities(),
Some("metal") => naga::back::msl::supported_capabilities(),
Some("hlsl") => naga::back::hlsl::supported_capabilities(),
Some("spv") | Some("spirv") => naga::back::spv::supported_capabilities(),
Some("glsl") | Some("frag") | Some("vert") | Some("comp") | Some("task")
| Some("mesh") => naga::back::glsl::supported_capabilities(),
_ => C::all() - C::TEXTURE_EXTERNAL,
};
caps & allowed
});
// Validate the IR before compaction.
let info = match naga::valid::Validator::new(params.validation_flags, validation_caps)