diff --git a/Cargo.toml b/Cargo.toml index 919d94470..26769fc2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ all-features = true [lib] [features] -default = ["cross"] +default = [] trace = ["serde", "wgc/trace"] replay = ["serde", "wgc/replay"] # Make Vulkan backend available on platforms where it is by default not, e.g. macOS @@ -45,6 +45,7 @@ rev = "41f106d7fc8e2ca49b21aed0919fa6cc67317f7f" [dependencies] arrayvec = "0.5" +log = "0.4" parking_lot = "0.11" profiling = { version = "0.1.10", default-features = false } # Need 0.1.10+ to avoid compliation error with proc macros off. raw-window-handle = "0.3" diff --git a/examples/README.md b/examples/README.md index f893d173b..674b149fd 100644 --- a/examples/README.md +++ b/examples/README.md @@ -7,12 +7,13 @@ For the simplest examples without using any helping code (see `framework.rs` her Notably, `capture` example shows rendering without a surface/window. It reads back the contents and saves them to a file. +All the examples use [WGSL](https://gpuweb.github.io/gpuweb/wgsl.html) shaders unless specified otherwise. + All framework-based examples render to the window. ## Feature matrix | Feature | boids | cube | mipmap | msaa-line | shadow | skybox | texture-arrays | water | conservative-raster | | ---------------------------- | ------ | ------ | ------ | --------- | ------ | ------ | -------------- | ------ | ------------------- | -| WGSL shaders | :star: | :star: | :star: | :star: | :star: | :star: | | :star: | :star: | | vertex attributes | :star: | :star: | | :star: | :star: | :star: | :star: | :star: | | | instancing | :star: | | | | | | | | | | lines and points | | | | :star: | | | | | :star: | @@ -34,6 +35,7 @@ All framework-based examples render to the window. | render bundles | | | | :star: | | | | :star: | | | compute passes | :star: | | | | | | | | | | *optional extensions* | | | | | | | :star: | | | +| - SPIR-V shaders | | | | | | | :star: | | | | - binding indexing | | | | | | | :star: | | | | - push constants | | | | | | | :star: | | | | - depth clamping | | | | | :star: | | | | | diff --git a/src/backend/direct.rs b/src/backend/direct.rs index cd7c98533..b76a93ce2 100644 --- a/src/backend/direct.rs +++ b/src/backend/direct.rs @@ -1011,6 +1011,11 @@ impl crate::Context for Context { implicit_pipeline_ids )); if let Some(cause) = error { + if let wgc::pipeline::CreateRenderPipelineError::Internal { stage, ref error } = cause { + log::warn!("Shader translation error for stage {:?}: {}", stage, error); + log::warn!("Please report it to https://github.com/gfx-rs/naga"); + log::warn!("Try enabling `wgpu/cross` feature as a workaround."); + } self.handle_error( &device.error_sink, cause, @@ -1053,6 +1058,15 @@ impl crate::Context for Context { implicit_pipeline_ids )); if let Some(cause) = error { + if let wgc::pipeline::CreateComputePipelineError::Internal(ref error) = cause { + log::warn!( + "Shader translation error for stage {:?}: {}", + wgt::ShaderStage::COMPUTE, + error + ); + log::warn!("Please report it to https://github.com/gfx-rs/naga"); + log::warn!("Try enabling `wgpu/cross` feature as a workaround."); + } self.handle_error( &device.error_sink, cause,