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