mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Move to gfx master
This commit is contained in:
parent
623763bf96
commit
9e2f6c2f01
38
.github/workflows/ci.yml
vendored
38
.github/workflows/ci.yml
vendored
@ -23,10 +23,14 @@ jobs:
|
||||
runs-on: ubuntu-18.04
|
||||
env:
|
||||
TARGET: aarch64-linux-android
|
||||
PKG_CONFIG_ALLOW_CROSS: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install NDK
|
||||
run: echo "$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
|
||||
- name: Prepare
|
||||
run: |
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install -y -qq libegl1-mesa-dev
|
||||
echo "$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
|
||||
- run: rustup component add clippy
|
||||
- run: rustup target add ${{ env.TARGET }}
|
||||
- run: cargo clippy --target ${{ env.TARGET }}
|
||||
@ -45,40 +49,44 @@ jobs:
|
||||
- name: MacOS Stable
|
||||
channel: stable
|
||||
os: macos-10.15
|
||||
build_command: cargo clippy
|
||||
prepare_command:
|
||||
additional_core_features: trace
|
||||
additional_player_features: winit
|
||||
- name: MacOS Nightly
|
||||
os: macos-10.15
|
||||
channel: nightly
|
||||
build_command: cargo test -- --nocapture
|
||||
prepare_command:
|
||||
additional_core_features:
|
||||
additional_player_features:
|
||||
- name: Ubuntu Stable
|
||||
os: ubuntu-18.04
|
||||
channel: stable
|
||||
build_command: cargo clippy
|
||||
prepare_command: |
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install -y -qq libegl1-mesa-dev
|
||||
additional_core_features: trace,replay
|
||||
additional_player_features:
|
||||
- name: Ubuntu Nightly
|
||||
os: ubuntu-18.04
|
||||
channel: nightly
|
||||
build_command: |
|
||||
sudo add-apt-repository ppa:oibaf/graphics-drivers;
|
||||
sudo apt-get install mesa-vulkan-drivers;
|
||||
cargo test -- --nocapture;
|
||||
prepare_command: |
|
||||
sudo apt-get update -y -qq
|
||||
echo "Installing EGL"
|
||||
sudo apt-get install -y -qq libegl1-mesa-dev
|
||||
echo "Installing Vulkan"
|
||||
sudo apt-get install -y -qq mesa-vulkan-drivers
|
||||
additional_core_features: serial-pass
|
||||
additional_player_features: winit
|
||||
- name: Windows Stable
|
||||
os: windows-2019
|
||||
channel: stable
|
||||
build_command: rustup default stable-msvc; cargo clippy
|
||||
prepare_command: rustup default stable-msvc
|
||||
additional_core_features: trace,serial-pass
|
||||
additional_player_features: renderdoc
|
||||
- name: Windows Nightly
|
||||
os: windows-2019
|
||||
channel: nightly
|
||||
build_command: rustup default nightly-msvc; cargo test -- --nocapture
|
||||
prepare_command: rustup default nightly-msvc
|
||||
additional_core_features:
|
||||
additional_player_features:
|
||||
steps:
|
||||
@ -91,6 +99,9 @@ jobs:
|
||||
override: true
|
||||
- if: matrix.channel == 'stable'
|
||||
run: rustup component add clippy
|
||||
# prepare
|
||||
- if: matrix.prepare_command != ''
|
||||
run: ${{ matrix.prepare_command }}
|
||||
# build with no features first
|
||||
- if: matrix.additional_core_features == ''
|
||||
run: cargo check --manifest-path wgpu-core/Cargo.toml --no-default-features
|
||||
@ -98,4 +109,7 @@ jobs:
|
||||
run: cargo check --manifest-path wgpu-core/Cargo.toml --features ${{ matrix.additional_core_features }}
|
||||
- if: matrix.additional_player_features != ''
|
||||
run: cargo check --manifest-path player/Cargo.toml --features ${{ matrix.additional_player_features }}
|
||||
- run: ${{ matrix.build_command }}
|
||||
- if: matrix.channel == 'stable'
|
||||
run: cargo clippy
|
||||
- if: matrix.channel == 'nightly'
|
||||
run: cargo test -- --nocapture
|
||||
|
||||
613
Cargo.lock
generated
613
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -39,8 +39,5 @@ git = "https://github.com/gfx-rs/subscriber.git"
|
||||
rev = "cdc9feb53f152f9c41905ed9efeff2c1ed214361"
|
||||
version = "0.1"
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies]
|
||||
gfx-backend-vulkan = { version = "0.6", features = ["x11"] }
|
||||
|
||||
[dev-dependencies]
|
||||
serde = "1"
|
||||
|
||||
@ -25,8 +25,8 @@ arrayvec = "0.5"
|
||||
bitflags = "1.0"
|
||||
copyless = "0.1"
|
||||
fxhash = "0.2"
|
||||
hal = { package = "gfx-hal", version = "0.6" }
|
||||
gfx-backend-empty = "0.6"
|
||||
hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
parking_lot = "0.11"
|
||||
raw-window-handle = { version = "0.3", optional = true }
|
||||
ron = { version = "0.6", optional = true }
|
||||
@ -48,20 +48,18 @@ path = "../wgpu-types"
|
||||
package = "wgpu-types"
|
||||
version = "0.6"
|
||||
|
||||
[target.'cfg(all(unix, not(any(target_os = "ios", target_os = "macos"))))'.dependencies]
|
||||
gfx-backend-gl = { version = "0.6" }
|
||||
[target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies]
|
||||
gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
|
||||
[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
|
||||
gfx-backend-metal = { version = "0.6" }
|
||||
gfx-backend-vulkan = { version = "0.6.4", optional = true }
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies]
|
||||
gfx-backend-vulkan = { version = "0.6.4" }
|
||||
gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354", optional = true }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
gfx-backend-dx12 = { version = "0.6" }
|
||||
gfx-backend-dx11 = { version = "0.6" }
|
||||
gfx-backend-vulkan = { version = "0.6.4" }
|
||||
gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354" }
|
||||
|
||||
[dev-dependencies]
|
||||
loom = "0.3"
|
||||
|
||||
@ -534,16 +534,11 @@ impl RenderBundle {
|
||||
.raw
|
||||
.as_ref()
|
||||
.ok_or(ExecutionError::DestroyedBuffer(buffer_id))?;
|
||||
let view = hal::buffer::IndexBufferView {
|
||||
buffer,
|
||||
range: hal::buffer::SubRange {
|
||||
offset,
|
||||
size: size.map(|s| s.get()),
|
||||
},
|
||||
index_type,
|
||||
let range = hal::buffer::SubRange {
|
||||
offset,
|
||||
size: size.map(|s| s.get()),
|
||||
};
|
||||
|
||||
cmd_buf.bind_index_buffer(view);
|
||||
cmd_buf.bind_index_buffer(buffer, range, index_type);
|
||||
}
|
||||
RenderCommand::SetVertexBuffer {
|
||||
slot,
|
||||
|
||||
@ -1164,17 +1164,13 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
if let Some((buffer_id, ref range)) = state.index.bound_buffer_view {
|
||||
let &(ref buffer, _) = buffer_guard[buffer_id].raw.as_ref().unwrap();
|
||||
|
||||
let view = hal::buffer::IndexBufferView {
|
||||
buffer,
|
||||
range: hal::buffer::SubRange {
|
||||
offset: range.start,
|
||||
size: Some(range.end - range.start),
|
||||
},
|
||||
index_type: conv::map_index_format(state.index.format),
|
||||
let range = hal::buffer::SubRange {
|
||||
offset: range.start,
|
||||
size: Some(range.end - range.start),
|
||||
};
|
||||
|
||||
let index_type = conv::map_index_format(state.index.format);
|
||||
unsafe {
|
||||
raw.bind_index_buffer(view);
|
||||
raw.bind_index_buffer(buffer, range, index_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1217,17 +1213,13 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
state.index.bound_buffer_view = Some((id::Valid(buffer_id), offset..end));
|
||||
state.index.update_limit();
|
||||
|
||||
let view = hal::buffer::IndexBufferView {
|
||||
buffer: buf_raw,
|
||||
range: hal::buffer::SubRange {
|
||||
offset,
|
||||
size: Some(end - offset),
|
||||
},
|
||||
index_type: conv::map_index_format(state.index.format),
|
||||
let range = hal::buffer::SubRange {
|
||||
offset,
|
||||
size: Some(end - offset),
|
||||
};
|
||||
|
||||
let index_type = conv::map_index_format(state.index.format);
|
||||
unsafe {
|
||||
raw.bind_index_buffer(view);
|
||||
raw.bind_index_buffer(buf_raw, range, index_type);
|
||||
}
|
||||
}
|
||||
RenderCommand::SetVertexBuffer {
|
||||
|
||||
@ -45,7 +45,7 @@ impl<B: hal::Backend> MemoryAllocator<B> {
|
||||
mem_props
|
||||
.memory_heaps
|
||||
.iter()
|
||||
.map(|mh| gpu_alloc::MemoryHeap { size: *mh })
|
||||
.map(|mh| gpu_alloc::MemoryHeap { size: mh.size })
|
||||
.collect::<Vec<_>>(),
|
||||
),
|
||||
max_memory_allocation_count: if limits.max_memory_allocation_count == 0 {
|
||||
|
||||
@ -787,14 +787,13 @@ impl<B: GfxBackend> Device<B> {
|
||||
None
|
||||
};
|
||||
|
||||
let actual_border: hal::image::PackedColor = desc
|
||||
.border_color
|
||||
.map(|c| match c {
|
||||
wgt::SamplerBorderColor::TransparentBlack => [0., 0., 0., 0.].into(),
|
||||
wgt::SamplerBorderColor::OpaqueBlack => [0., 0., 0., 1.].into(),
|
||||
wgt::SamplerBorderColor::OpaqueWhite => [1., 1., 1., 1.].into(),
|
||||
})
|
||||
.unwrap_or([0., 0., 0., 0.].into());
|
||||
let border = match desc.border_color {
|
||||
None | Some(wgt::SamplerBorderColor::TransparentBlack) => {
|
||||
hal::image::BorderColor::TransparentBlack
|
||||
}
|
||||
Some(wgt::SamplerBorderColor::OpaqueBlack) => hal::image::BorderColor::OpaqueBlack,
|
||||
Some(wgt::SamplerBorderColor::OpaqueWhite) => hal::image::BorderColor::OpaqueWhite,
|
||||
};
|
||||
|
||||
let info = hal::image::SamplerDesc {
|
||||
min_filter: conv::map_filter(desc.min_filter),
|
||||
@ -808,7 +807,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
lod_bias: hal::image::Lod(0.0),
|
||||
lod_range: hal::image::Lod(desc.lod_min_clamp)..hal::image::Lod(desc.lod_max_clamp),
|
||||
comparison: desc.compare.map(conv::map_compare_function),
|
||||
border: actual_border,
|
||||
border,
|
||||
normalized: true,
|
||||
anisotropy_clamp: actual_clamp,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user