680: Update wgpu with Naga fixes and OpenGL backend r=cwfitzgerald a=kvark

This PR makes it easier to build wgpu-rs on Linux, since it doesn't require pkg-config into EGL.
Fixes #607
Fixes https://github.com/gfx-rs/wgpu/issues/1063

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
This commit is contained in:
bors[bot]andDzmitry Malyshau authored and GitHub committed 2020-12-17 21:57:25 +00:00
commit 5bebae49e3
10 files changed
+13 -46

No files matched your search

+3 -23
View File
@@ -13,29 +13,10 @@ jobs:
fail-fast: false
matrix:
os: [macos-10.15, ubuntu-18.04, windows-2019]
include:
- os: macos-10.15
PREPARE_COMMAND: echo "Ready"
CHECK_COMMAND: cargo check --all-targets --all-features
TEST_COMMAND: cargo test --all-targets --no-run
- os: ubuntu-18.04
PREPARE_COMMAND: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libegl1-mesa-dev
CHECK_COMMAND: cargo check --all-targets --all-features
TEST_COMMAND: cargo test --all-targets --no-run
- os: windows-2019
PREPARE_COMMAND: rustup default stable-msvc
CHECK_COMMAND: cargo check --all-targets --all-features
TEST_COMMAND: cargo test --all-targets --no-run
steps:
- uses: actions/checkout@v2
- name: Prepare
run: ${{ matrix.PREPARE_COMMAND }}
- name: Check
run: ${{ matrix.CHECK_COMMAND }}
- name: Test
run: ${{ matrix.TEST_COMMAND }}
- run: cargo check --all-targets --all-features
- run: cargo test --all-targets --no-run
wasm:
runs-on: [ubuntu-18.04]
@@ -44,8 +25,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: rustup target add wasm32-unknown-unknown
- name: Check
run: cargo check --all-targets --all-features --target=wasm32-unknown-unknown
- run: cargo check --all-targets --all-features --target=wasm32-unknown-unknown
docs:
runs-on: [ubuntu-18.04]
+2 -10
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"
-1
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,
)
+2 -3
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,
-1
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,
)
+1 -2
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 {
-1
View File
@@ -88,7 +88,6 @@ async fn run(
label: None,
features: wgpu::Features::empty(),
limits: wgpu::Limits::default(),
shader_validation: true,
},
None,
)
+1 -1
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)),
+3 -3
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.
+1 -1
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,
}
}
};