[rs] Update wgpu with Naga fixes and OpenGL backend

This commit is contained in:
Dzmitry Malyshau
2020-12-15 01:36:51 -05:00
parent 9090076253
commit bafcc5ace5
9 changed files with 10 additions and 23 deletions

View File

@@ -25,13 +25,13 @@ vulkan-portability = ["wgc/gfx-backend-vulkan"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "42a8dc5b343b1c882d7c5bb03b0718602ea03915"
rev = "89e585af615c5ed2050a1cab7225f6e92a26b3ba"
features = ["raw-window-handle"]
[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "42a8dc5b343b1c882d7c5bb03b0718602ea03915"
rev = "89e585af615c5ed2050a1cab7225f6e92a26b3ba"
[dependencies]
arrayvec = "0.5"
@@ -43,14 +43,6 @@ tracing = { version = "0.1", default-features = false, features = ["std"] }
typed-arena = "2.0.1"
serde = { version = "1", features = ["derive"], optional = true }
# Enable X11 support for GL
# Note: we may consider switching this to "dev-dependencies" if users
# want to opt into X11 explicitly.
[target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies.gfx-backend-gl]
git = "https://github.com/gfx-rs/gfx"
rev = "f1398d29c7ad726968723a37187bd3932c539783"
features = ["x11"]
[dev-dependencies]
cgmath = "0.17"
log = "0.4"

View File

@@ -39,7 +39,6 @@ async fn create_red_image_with_dimensions(
label: None,
features: wgpu::Features::empty(),
limits: wgpu::Limits::default(),
shader_validation: true,
},
None,
)

View File

@@ -142,7 +142,7 @@ async fn setup<E: Example>(title: &str) -> Setup {
compatible_surface: Some(&surface),
})
.await
.unwrap();
.expect("No suitable GPU adapters found on the system!");
#[cfg(not(target_arch = "wasm32"))]
{
@@ -168,12 +168,11 @@ async fn setup<E: Example>(title: &str) -> Setup {
label: None,
features: (optional_features & adapter_features) | required_features,
limits: needed_limits,
shader_validation: false,
},
trace_dir.ok().as_ref().map(std::path::Path::new),
)
.await
.unwrap();
.expect("Unable to find a suitable GPU adapter!");
Setup {
window,

View File

@@ -37,7 +37,6 @@ async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
label: None,
features: wgpu::Features::empty(),
limits: wgpu::Limits::default(),
shader_validation: true,
},
None,
)

View File

@@ -25,7 +25,6 @@ async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu::
label: None,
features: wgpu::Features::empty(),
limits: wgpu::Limits::default(),
shader_validation: true,
},
None,
)
@@ -36,7 +35,7 @@ async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu::
let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor {
label: None,
source: wgpu::ShaderSource::Wgsl(Cow::Borrowed(include_str!("shader.wgsl"))),
experimental_translation: true,
flags: wgpu::ShaderFlags::all(),
});
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {

View File

@@ -88,7 +88,6 @@ async fn run(
label: None,
features: wgpu::Features::empty(),
limits: wgpu::Limits::default(),
shader_validation: true,
},
None,
)

View File

@@ -730,7 +730,7 @@ impl crate::Context for Context {
let global = &self.0;
let descriptor = wgc::pipeline::ShaderModuleDescriptor {
label: desc.label.map(Borrowed),
experimental_translation: desc.experimental_translation,
flags: desc.flags,
};
let source = match desc.source {
ShaderSource::SpirV(ref spv) => wgc::pipeline::ShaderModuleSource::SpirV(Borrowed(spv)),

View File

@@ -38,7 +38,7 @@ pub use wgt::{
DepthStencilStateDescriptor, DynamicOffset, Extent3d, Features, FilterMode, FrontFace,
IndexFormat, InputStepMode, Limits, Origin3d, PolygonMode, PowerPreference, PresentMode,
PrimitiveTopology, PushConstantRange, RasterizationStateDescriptor, SamplerBorderColor,
ShaderLocation, ShaderStage, StencilOperation, StencilStateDescriptor,
ShaderFlags, ShaderLocation, ShaderStage, StencilOperation, StencilStateDescriptor,
StencilStateFaceDescriptor, StorageTextureAccess, SwapChainDescriptor, SwapChainStatus,
TextureAspect, TextureDataLayout, TextureDimension, TextureFormat, TextureSampleType,
TextureUsage, TextureViewDimension, VertexAttributeDescriptor, VertexFormat,
@@ -694,8 +694,8 @@ pub struct ShaderModuleDescriptor<'a> {
pub label: Label<'a>,
/// Source code for the shader.
pub source: ShaderSource<'a>,
/// Experimental translation path attempts to avoid SPIR-V and work with Naga IR directly.
pub experimental_translation: bool,
/// Shader handling flags.
pub flags: ShaderFlags,
}
/// Handle to a pipeline layout.

View File

@@ -52,7 +52,7 @@ macro_rules! include_spirv {
$crate::ShaderModuleDescriptor {
label: Some($($token)*),
source: $crate::util::make_spirv(include_bytes!($($token)*)),
experimental_translation: false,
flags: $crate::ShaderFlags::VALIDATION,
}
}
};