Release v0.10 (#1820)

* Release v0.10

* hal/gles: update glow handles logic
This commit is contained in:
Dzmitry Malyshau 2021-08-18 15:06:21 -04:00 committed by GitHub
parent 80ec65e892
commit 9da5c1d3a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 121 additions and 99 deletions

View File

@ -148,7 +148,7 @@ jobs:
cargo run --target ${{ matrix.target }} --bin wgpu-info cargo run --target ${{ matrix.target }} --bin wgpu-info
# run player tests # run player tests
cargo test --target ${{ matrix.target }} --workspace --exclude wpgu --no-fail-fast -- --nocapture cargo test --target ${{ matrix.target }} --workspace --exclude wgpu --no-fail-fast -- --nocapture
# run coretests # run coretests
cargo run --target ${{ matrix.target }} --bin wgpu-info -- cargo test --target ${{ matrix.target }} -p wgpu --no-fail-fast -- --nocapture --test-threads=1 # GLES is currently non-multithreadable cargo run --target ${{ matrix.target }} --bin wgpu-info -- cargo test --target ${{ matrix.target }} -p wgpu --no-fail-fast -- --nocapture --test-threads=1 # GLES is currently non-multithreadable

View File

@ -1,8 +1,9 @@
# Change Log # Change Log
## Unreleased ## v0.10 (2021-08-18)
- Infrastructure: - Infrastructure:
- `gfx-hal` is replaced by the in-house graphics abstraction `wgpu-hal`. Backends: Vulkan, Metal, OpenGL ES-3. - `gfx-hal` is replaced by the in-house graphics abstraction `wgpu-hal`. Backends: Vulkan, Metal, D3D-12, and OpenGL ES-3.
- examples are tested automatically for image snapshots.
- API: - API:
- `cross` feature is removed entirely. Only Rust code from now on. - `cross` feature is removed entirely. Only Rust code from now on.
- processing SPIR-V inputs for later translation now requires `spirv` compile feature enabled - processing SPIR-V inputs for later translation now requires `spirv` compile feature enabled
@ -10,11 +11,24 @@
- several bitflag names are renamed to plural: `TextureUsage`, `BufferUsage`, `ColorWrite`. - several bitflag names are renamed to plural: `TextureUsage`, `BufferUsage`, `ColorWrite`.
- the `SwapChain` is merged into `Surface`. Returned frames are `Texture` instead of `TextureView`. - the `SwapChain` is merged into `Surface`. Returned frames are `Texture` instead of `TextureView`.
- renamed `TextureUsage` bits: `SAMPLED` -> `TEXTURE_BINDING`, `STORAGE` -> `STORAGE_BINDING`. - renamed `TextureUsage` bits: `SAMPLED` -> `TEXTURE_BINDING`, `STORAGE` -> `STORAGE_BINDING`.
- renamed `InputStepMode` to `VertexStepMode` - renamed `InputStepMode` to `VertexStepMode`.
- Implemented `Rgb9e5Ufloat` format. - readable storage textures are no longer a part of the base API. Only exposed via format-specific features, non-portably.
- implemented `Rgb9e5Ufloat` format.
- added limits for binding sizes, vertex data, per-stage bindings, and others.
- reworked downlevel flags, added downlevel limits.
- `resolver = "2"` is now required in top-level cargo manifests
- Fixed: - Fixed:
- `Device::create_query_set` would return an error when creating exactly `QUERY_SET_MAX_QUERIES` (8192) queries. Now it only returns an error when trying to create *more* than `QUERY_SET_MAX_QUERIES` queries. - `Device::create_query_set` would return an error when creating exactly `QUERY_SET_MAX_QUERIES` (8192) queries. Now it only returns an error when trying to create *more* than `QUERY_SET_MAX_QUERIES` queries.
## wgpu-core-0.9.2
- fix `Features::TEXTURE_SPECIFIC_FORMAT_FEATURES` not being supported for rendertargets
## wgpu-core-0.9.1 (2021-07-13)
- fix buffer inits delayed by a frame
- fix query resolves to initialize buffers
- fix pipeline statistics stride
- fix the check for maximum query count
## v0.9 (2021-06-18) ## v0.9 (2021-06-18)
- Updated: - Updated:
- naga to `v0.5`. - naga to `v0.5`.

50
Cargo.lock generated
View File

@ -62,9 +62,9 @@ dependencies = [
[[package]] [[package]]
name = "ash" name = "ash"
version = "0.32.1" version = "0.33.0+1.2.186"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06063a002a77d2734631db74e8f4ce7148b77fe522e6bca46f2ae7774fd48112" checksum = "a2142f1fa77cc4d24ffd2f24dc84f88ce5b1e588d524f10fb473a04b93aef14f"
dependencies = [ dependencies = [
"libloading 0.7.0", "libloading 0.7.0",
] ]
@ -458,8 +458,9 @@ dependencies = [
[[package]] [[package]]
name = "d3d12" name = "d3d12"
version = "0.4.0" version = "0.4.1"
source = "git+https://github.com/gfx-rs/d3d12-rs?rev=79f29c8#79f29c8809d3dc4f97785815567e5efda20e639a" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"libloading 0.7.0", "libloading 0.7.0",
@ -679,8 +680,9 @@ dependencies = [
[[package]] [[package]]
name = "glow" name = "glow"
version = "0.10.0" version = "0.11.0"
source = "git+https://github.com/grovesNL/glow?rev=0864897a28bbdd43f89f4fd8fdd4ed781b719f8a#0864897a28bbdd43f89f4fd8fdd4ed781b719f8a" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f04649123493bc2483cbef4daddb45d40bbdae5adb221a63a23efdb0cc99520"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"slotmap", "slotmap",
@ -690,9 +692,9 @@ dependencies = [
[[package]] [[package]]
name = "gpu-alloc" name = "gpu-alloc"
version = "0.4.7" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc1b6ca374e81862526786d9cb42357ce03706ed1b8761730caafd02ab91f3a" checksum = "c481459c44304a1dfed23bd650bb3912e12c9f77d7871f86d7ed7c9730a52e79"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"gpu-alloc-types", "gpu-alloc-types",
@ -709,9 +711,9 @@ dependencies = [
[[package]] [[package]]
name = "gpu-descriptor" name = "gpu-descriptor"
version = "0.1.1" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a70f1e87a3840ed6a3e99e02c2b861e4dbdf26f0d07e38f42ea5aff46cfce2" checksum = "d7a237f0419ab10d17006d55c62ac4f689a6bf52c75d3f38b8361d249e8d4b0b"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"gpu-descriptor-types", "gpu-descriptor-types",
@ -907,8 +909,9 @@ dependencies = [
[[package]] [[package]]
name = "metal" name = "metal"
version = "0.22.0" version = "0.23.0"
source = "git+https://github.com/gfx-rs/metal-rs?rev=08cc15a3be5a57fc07bb27091eff3569dd60cfd3#08cc15a3be5a57fc07bb27091eff3569dd60cfd3" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79d7d769f1c104b8388294d6594d491d2e21240636f5f94d37f8a0f3d7904450"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"block", "block",
@ -963,8 +966,9 @@ dependencies = [
[[package]] [[package]]
name = "naga" name = "naga"
version = "0.5.0" version = "0.6.0"
source = "git+https://github.com/gfx-rs/naga?rev=4e181d6#4e181d6af4b758c11482b633b3a54b58bfbd4a59" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c70938c43114c164e8ef86e608b39e68d3e4c8bca25e105bf4a3e788042a804a"
dependencies = [ dependencies = [
"bit-set", "bit-set",
"bitflags", "bitflags",
@ -975,7 +979,7 @@ dependencies = [
"petgraph", "petgraph",
"rose_tree", "rose_tree",
"serde", "serde",
"spirv_headers", "spirv",
"thiserror", "thiserror",
] ]
@ -1506,10 +1510,10 @@ dependencies = [
] ]
[[package]] [[package]]
name = "spirv_headers" name = "spirv"
version = "1.5.0" version = "0.2.0+1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f5b132530b1ac069df335577e3581765995cba5a13995cdbbdbc8fb057c532c" checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"num-traits 0.2.14", "num-traits 0.2.14",
@ -1768,7 +1772,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu" name = "wgpu"
version = "0.9.0" version = "0.10.0"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"async-executor", "async-executor",
@ -1802,7 +1806,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-core" name = "wgpu-core"
version = "0.9.0" version = "0.10.0"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -1824,7 +1828,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-hal" name = "wgpu-hal"
version = "0.9.0" version = "0.10.1"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"ash", "ash",
@ -1858,7 +1862,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-info" name = "wgpu-info"
version = "0.9.0" version = "0.10.0"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"wgpu", "wgpu",
@ -1866,7 +1870,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-types" name = "wgpu-types"
version = "0.9.0" version = "0.10.0"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"serde", "serde",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wgpu-core" name = "wgpu-core"
version = "0.9.0" version = "0.10.0"
authors = ["wgpu developers"] authors = ["wgpu developers"]
edition = "2018" edition = "2018"
description = "WebGPU core logic on gfx-hal" description = "WebGPU core logic on gfx-hal"
@ -35,29 +35,30 @@ smallvec = "1"
thiserror = "1" thiserror = "1"
[dependencies.naga] [dependencies.naga]
git = "https://github.com/gfx-rs/naga" #git = "https://github.com/gfx-rs/naga"
rev = "4e181d6" #rev = "4e181d6"
version = "0.6"
features = ["wgsl-in"] features = ["wgsl-in"]
[dependencies.wgt] [dependencies.wgt]
path = "../wgpu-types" path = "../wgpu-types"
package = "wgpu-types" package = "wgpu-types"
version = "0.9" version = "0.10"
[dependencies.hal] [dependencies.hal]
path = "../wgpu-hal" path = "../wgpu-hal"
package = "wgpu-hal" package = "wgpu-hal"
version = "0.9" version = "0.10.1"
[target.'cfg(all(not(target_arch = "wasm32"), any(target_os = "ios", target_os = "macos")))'.dependencies] [target.'cfg(all(not(target_arch = "wasm32"), any(target_os = "ios", target_os = "macos")))'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", features = ["metal"] } hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.10", features = ["metal"] }
#Note: could also enable "vulkan" for Vulkan Portability #Note: could also enable "vulkan" for Vulkan Portability
[target.'cfg(all(not(target_arch = "wasm32"), unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies] [target.'cfg(all(not(target_arch = "wasm32"), unix, not(target_os = "ios"), not(target_os = "macos")))'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", features = ["vulkan", "gles", "renderdoc"] } hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.10", features = ["vulkan", "gles", "renderdoc"] }
[target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies] [target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", features = ["vulkan", "dx12", "renderdoc"] } hal = { path = "../wgpu-hal", package = "wgpu-hal", version = "0.10", features = ["vulkan", "dx12", "renderdoc"] }
[build-dependencies] [build-dependencies]
cfg_aliases = "0.1" cfg_aliases = "0.1"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wgpu-hal" name = "wgpu-hal"
version = "0.9.0" version = "0.10.1"
authors = ["wgpu developers"] authors = ["wgpu developers"]
edition = "2018" edition = "2018"
description = "WebGPU hardware abstraction layer" description = "WebGPU hardware abstraction layer"
@ -24,7 +24,6 @@ bitflags = "1.0"
parking_lot = "0.11" parking_lot = "0.11"
raw-window-handle = "0.3" raw-window-handle = "0.3"
thiserror = "1" thiserror = "1"
wgt = { package = "wgpu-types", path = "../wgpu-types" }
# backends common # backends common
arrayvec = "0.7" arrayvec = "0.7"
@ -37,18 +36,23 @@ block = { version = "0.1", optional = true }
foreign-types = { version = "0.3", optional = true } foreign-types = { version = "0.3", optional = true }
# backend: Vulkan # backend: Vulkan
ash = { version = "0.32", optional = true } ash = { version = "0.33", optional = true }
gpu-alloc = { version = "0.4", optional = true } gpu-alloc = { version = "0.5", optional = true }
gpu-descriptor = { version = "0.1", optional = true } gpu-descriptor = { version = "0.2", optional = true }
inplace_it = { version ="0.3.3", optional = true } inplace_it = { version ="0.3.3", optional = true }
# backend: Gles # backend: Gles
glow = { git = "https://github.com/grovesNL/glow", rev = "0864897a28bbdd43f89f4fd8fdd4ed781b719f8a", optional = true } glow = { version = "0.11", optional = true }
# backend: Dx12 # backend: Dx12
bit-set = { version = "0.5", optional = true } bit-set = { version = "0.5", optional = true }
range-alloc = { version = "0.1", optional = true } range-alloc = { version = "0.1", optional = true }
[dependencies.wgt]
package = "wgpu-types"
path = "../wgpu-types"
version = "0.10"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
egl = { package = "khronos-egl", version = "4.1", features = ["dynamic"], optional = true } egl = { package = "khronos-egl", version = "4.1", features = ["dynamic"], optional = true }
#Note: it's only unused on Apple platforms #Note: it's only unused on Apple platforms
@ -56,20 +60,22 @@ libloading = { version = "0.7", optional = true }
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["libloaderapi", "windef", "winuser"] } winapi = { version = "0.3", features = ["libloaderapi", "windef", "winuser"] }
native = { package = "d3d12", git = "https://github.com/gfx-rs/d3d12-rs", rev = "79f29c8", features = ["libloading"], optional = true } native = { package = "d3d12", version = "0.4.1", features = ["libloading"], optional = true }
[target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies] [target.'cfg(any(target_os="macos", target_os="ios"))'.dependencies]
mtl = { package = "metal", version = "0.22", git="https://github.com/gfx-rs/metal-rs", rev="08cc15a3be5a57fc07bb27091eff3569dd60cfd3" } mtl = { package = "metal", version = "0.23" }
objc = "0.2.5" objc = "0.2.5"
core-graphics-types = "0.1" core-graphics-types = "0.1"
[dependencies.naga] [dependencies.naga]
git = "https://github.com/gfx-rs/naga" #git = "https://github.com/gfx-rs/naga"
rev = "4e181d6" #rev = "4e181d6"
version = "0.6"
[dev-dependencies.naga] [dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga" #git = "https://github.com/gfx-rs/naga"
rev = "4e181d6" #rev = "4e181d6"
version = "0.6"
features = ["wgsl-in"] features = ["wgsl-in"]
[dev-dependencies] [dev-dependencies]

View File

@ -14,7 +14,8 @@ pub(super) struct State {
primitive: super::PrimitiveState, primitive: super::PrimitiveState,
index_format: wgt::IndexFormat, index_format: wgt::IndexFormat,
index_offset: wgt::BufferAddress, index_offset: wgt::BufferAddress,
vertex_buffers: [(super::VertexBufferDesc, super::BufferBinding); crate::MAX_VERTEX_BUFFERS], vertex_buffers:
[(super::VertexBufferDesc, Option<super::BufferBinding>); crate::MAX_VERTEX_BUFFERS],
vertex_attributes: ArrayVec<super::AttributeDesc, { super::MAX_VERTEX_ATTRIBUTES }>, vertex_attributes: ArrayVec<super::AttributeDesc, { super::MAX_VERTEX_ATTRIBUTES }>,
color_targets: ArrayVec<super::ColorTargetDesc, { crate::MAX_COLOR_TARGETS }>, color_targets: ArrayVec<super::ColorTargetDesc, { crate::MAX_COLOR_TARGETS }>,
stencil: super::StencilState, stencil: super::StencilState,
@ -34,7 +35,7 @@ impl super::CommandBuffer {
self.label = None; self.label = None;
self.commands.clear(); self.commands.clear();
self.data_bytes.clear(); self.data_bytes.clear();
self.data_words.clear(); self.queries.clear();
} }
fn add_marker(&mut self, marker: &str) -> Range<u32> { fn add_marker(&mut self, marker: &str) -> Range<u32> {
@ -78,6 +79,7 @@ impl super::CommandEncoder {
if self.state.dirty_vbuf_mask & (1 << index) == 0 { if self.state.dirty_vbuf_mask & (1 << index) == 0 {
continue; continue;
} }
let vb = vb.as_ref().unwrap();
let instance_offset = match vb_desc.step { let instance_offset = match vb_desc.step {
wgt::VertexStepMode::Vertex => 0, wgt::VertexStepMode::Vertex => 0,
wgt::VertexStepMode::Instance => first_instance * vb_desc.stride, wgt::VertexStepMode::Instance => first_instance * vb_desc.stride,
@ -100,13 +102,14 @@ impl super::CommandEncoder {
self.state.vertex_buffers[attribute.buffer_index as usize].clone(); self.state.vertex_buffers[attribute.buffer_index as usize].clone();
let mut attribute_desc = attribute.clone(); let mut attribute_desc = attribute.clone();
attribute_desc.offset += buffer.offset as u32; let vb = buffer.unwrap();
attribute_desc.offset += vb.offset as u32;
if buffer_desc.step == wgt::VertexStepMode::Instance { if buffer_desc.step == wgt::VertexStepMode::Instance {
attribute_desc.offset += buffer_desc.stride * first_instance; attribute_desc.offset += buffer_desc.stride * first_instance;
} }
self.cmd_buffer.commands.push(C::SetVertexAttribute { self.cmd_buffer.commands.push(C::SetVertexAttribute {
buffer: Some(buffer.raw), buffer: Some(vb.raw),
buffer_desc, buffer_desc,
attribute_desc, attribute_desc,
}); });
@ -352,11 +355,11 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
offset: wgt::BufferAddress, offset: wgt::BufferAddress,
_stride: wgt::BufferSize, _stride: wgt::BufferSize,
) { ) {
let start = self.cmd_buffer.data_words.len(); let start = self.cmd_buffer.queries.len();
self.cmd_buffer self.cmd_buffer
.data_words .queries
.extend_from_slice(&set.queries[range.start as usize..range.end as usize]); .extend_from_slice(&set.queries[range.start as usize..range.end as usize]);
let query_range = start as u32..self.cmd_buffer.data_words.len() as u32; let query_range = start as u32..self.cmd_buffer.queries.len() as u32;
self.cmd_buffer.commands.push(C::CopyQueryResults { self.cmd_buffer.commands.push(C::CopyQueryResults {
query_range, query_range,
dst: buffer.raw, dst: buffer.raw,
@ -741,8 +744,10 @@ impl crate::CommandEncoder<super::Api> for super::CommandEncoder {
) { ) {
self.state.dirty_vbuf_mask |= 1 << index; self.state.dirty_vbuf_mask |= 1 << index;
let (_, ref mut vb) = self.state.vertex_buffers[index as usize]; let (_, ref mut vb) = self.state.vertex_buffers[index as usize];
vb.raw = binding.buffer.raw; *vb = Some(super::BufferBinding {
vb.offset = binding.offset; raw: binding.buffer.raw,
offset: binding.offset,
});
} }
unsafe fn set_viewport(&mut self, rect: &crate::Rect<f32>, depth: Range<f32>) { unsafe fn set_viewport(&mut self, rect: &crate::Rect<f32>, depth: Range<f32>) {
self.cmd_buffer.commands.push(C::SetViewport { self.cmd_buffer.commands.push(C::SetViewport {

View File

@ -1,7 +1,7 @@
use super::conv; use super::conv;
use crate::auxil::map_naga_stage; use crate::auxil::map_naga_stage;
use glow::HasContext; use glow::HasContext;
use std::{convert::TryInto, iter, ptr, sync::Arc}; use std::{convert::TryInto, iter, mem, ptr, sync::Arc};
type ShaderStage<'a> = ( type ShaderStage<'a> = (
naga::ShaderStage, naga::ShaderStage,
@ -91,7 +91,9 @@ impl super::Device {
let raw = gl.create_shader(target).unwrap(); let raw = gl.create_shader(target).unwrap();
if gl.supports_debug() { if gl.supports_debug() {
gl.object_label(glow::SHADER, raw, label); //TODO: remove all transmutes from `object_label`
// https://github.com/grovesNL/glow/issues/186
gl.object_label(glow::SHADER, mem::transmute(raw), label);
} }
gl.shader_source(raw, shader); gl.shader_source(raw, shader);
@ -173,7 +175,7 @@ impl super::Device {
let program = gl.create_program().unwrap(); let program = gl.create_program().unwrap();
if let Some(label) = label { if let Some(label) = label {
if gl.supports_debug() { if gl.supports_debug() {
gl.object_label(glow::PROGRAM, program, Some(label)); gl.object_label(glow::PROGRAM, mem::transmute(program), Some(label));
} }
} }
@ -352,7 +354,7 @@ impl crate::Device<super::Api> for super::Device {
if let Some(label) = desc.label { if let Some(label) = desc.label {
if gl.supports_debug() { if gl.supports_debug() {
gl.object_label(glow::BUFFER, raw, Some(label)); gl.object_label(glow::BUFFER, mem::transmute(raw), Some(label));
} }
} }
@ -452,7 +454,7 @@ impl crate::Device<super::Api> for super::Device {
if let Some(label) = desc.label { if let Some(label) = desc.label {
if gl.supports_debug() { if gl.supports_debug() {
gl.object_label(glow::RENDERBUFFER, raw, Some(label)); gl.object_label(glow::RENDERBUFFER, mem::transmute(raw), Some(label));
} }
} }
@ -530,7 +532,7 @@ impl crate::Device<super::Api> for super::Device {
if let Some(label) = desc.label { if let Some(label) = desc.label {
if gl.supports_debug() { if gl.supports_debug() {
gl.object_label(glow::TEXTURE, raw, Some(label)); gl.object_label(glow::TEXTURE, mem::transmute(raw), Some(label));
} }
} }
@ -664,7 +666,7 @@ impl crate::Device<super::Api> for super::Device {
if let Some(label) = desc.label { if let Some(label) = desc.label {
if gl.supports_debug() { if gl.supports_debug() {
gl.object_label(glow::SAMPLER, raw, Some(label)); gl.object_label(glow::SAMPLER, mem::transmute(raw), Some(label));
} }
} }
@ -966,7 +968,7 @@ impl crate::Device<super::Api> for super::Device {
if let Some(label) = desc.label { if let Some(label) = desc.label {
temp_string.clear(); temp_string.clear();
let _ = write!(temp_string, "{}[{}]", label, i); let _ = write!(temp_string, "{}[{}]", label, i);
gl.object_label(glow::QUERY, query, Some(&temp_string)); gl.object_label(glow::QUERY, mem::transmute(query), Some(&temp_string));
} }
} }
queries.push(query); queries.push(query);

View File

@ -217,7 +217,7 @@ enum TextureInner {
impl TextureInner { impl TextureInner {
fn as_native(&self) -> (glow::Texture, BindTarget) { fn as_native(&self) -> (glow::Texture, BindTarget) {
match *self { match *self {
Self::Renderbuffer { raw, .. } => panic!("Unexpected renderbuffer {}", raw), Self::Renderbuffer { raw, .. } => panic!("Unexpected renderbuffer {:?}", raw),
Self::Texture { raw, target } => (raw, target), Self::Texture { raw, target } => (raw, target),
} }
} }
@ -323,7 +323,7 @@ struct AttributeDesc {
format_desc: VertexFormatDesc, format_desc: VertexFormatDesc,
} }
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug)]
struct BufferBinding { struct BufferBinding {
raw: glow::Buffer, raw: glow::Buffer,
offset: wgt::BufferAddress, offset: wgt::BufferAddress,
@ -659,7 +659,7 @@ pub struct CommandBuffer {
label: Option<String>, label: Option<String>,
commands: Vec<Command>, commands: Vec<Command>,
data_bytes: Vec<u8>, data_bytes: Vec<u8>,
data_words: Vec<u32>, queries: Vec<glow::Query>,
} }
//TODO: we would have something like `Arc<typed_arena::Arena>` //TODO: we would have something like `Arc<typed_arena::Arena>`

View File

@ -106,7 +106,7 @@ impl super::Queue {
gl: &glow::Context, gl: &glow::Context,
command: &C, command: &C,
data_bytes: &[u8], data_bytes: &[u8],
data_words: &[u32], queries: &[glow::Query],
) { ) {
match *command { match *command {
C::Draw { C::Draw {
@ -515,9 +515,7 @@ impl super::Queue {
dst_offset, dst_offset,
} => { } => {
self.temp_query_results.clear(); self.temp_query_results.clear();
for &query in for &query in queries[query_range.start as usize..query_range.end as usize].iter() {
data_words[query_range.start as usize..query_range.end as usize].iter()
{
let result = gl.get_query_parameter_u32(query, glow::QUERY_RESULT); let result = gl.get_query_parameter_u32(query, glow::QUERY_RESULT);
self.temp_query_results.push(result as u64); self.temp_query_results.push(result as u64);
} }
@ -948,7 +946,7 @@ impl crate::Queue<super::Api> for super::Queue {
gl.push_debug_group(glow::DEBUG_SOURCE_APPLICATION, DEBUG_ID, label); gl.push_debug_group(glow::DEBUG_SOURCE_APPLICATION, DEBUG_ID, label);
} }
for command in cmd_buf.commands.iter() { for command in cmd_buf.commands.iter() {
self.process(gl, command, &cmd_buf.data_bytes, &cmd_buf.data_words); self.process(gl, command, &cmd_buf.data_bytes, &cmd_buf.queries);
} }
if cmd_buf.label.is_some() { if cmd_buf.label.is_some() {
gl.pop_debug_group(); gl.pop_debug_group();

View File

@ -1,10 +1,6 @@
use super::conv; use super::conv;
use ash::{ use ash::{extensions::khr, vk};
extensions::khr,
version::{DeviceV1_0, InstanceV1_0},
vk,
};
use parking_lot::Mutex; use parking_lot::Mutex;
use std::{ffi::CStr, mem, ptr, sync::Arc}; use std::{ffi::CStr, mem, ptr, sync::Arc};

View File

@ -1,11 +1,7 @@
use super::conv; use super::conv;
use arrayvec::ArrayVec; use arrayvec::ArrayVec;
use ash::{ use ash::{extensions::ext, vk};
extensions::ext,
version::{DeviceV1_0, DeviceV1_2},
vk,
};
use inplace_it::inplace_or_alloc_from_iter; use inplace_it::inplace_or_alloc_from_iter;
use std::{mem, ops::Range, slice}; use std::{mem, ops::Range, slice};

View File

@ -1,11 +1,7 @@
use super::conv; use super::conv;
use arrayvec::ArrayVec; use arrayvec::ArrayVec;
use ash::{ use ash::{extensions::khr, vk};
extensions::khr,
version::{DeviceV1_0, DeviceV1_2},
vk,
};
use inplace_it::inplace_or_alloc_from_iter; use inplace_it::inplace_or_alloc_from_iter;
use parking_lot::Mutex; use parking_lot::Mutex;

View File

@ -8,7 +8,6 @@ use std::{
use ash::{ use ash::{
extensions::{ext, khr}, extensions::{ext, khr},
version::{DeviceV1_0 as _, EntryV1_0 as _, InstanceV1_0 as _},
vk, vk,
}; };

View File

@ -36,7 +36,6 @@ use std::{borrow::Borrow, ffi::CStr, sync::Arc};
use arrayvec::ArrayVec; use arrayvec::ArrayVec;
use ash::{ use ash::{
extensions::{ext, khr}, extensions::{ext, khr},
version::{DeviceV1_0, DeviceV1_2},
vk, vk,
}; };
use parking_lot::Mutex; use parking_lot::Mutex;

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wgpu-info" name = "wgpu-info"
version = "0.9.0" version = "0.10.0"
authors = ["wgpu developers"] authors = ["wgpu developers"]
edition = "2018" edition = "2018"
description = "Adapter information and per-adapter test program" description = "Adapter information and per-adapter test program"
@ -11,4 +11,4 @@ license = "MIT OR Apache-2.0"
[dependencies] [dependencies]
env_logger = "0.8" env_logger = "0.8"
wgpu = { version = "0.9", path = "../wgpu" } wgpu = { version = "0.10", path = "../wgpu" }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wgpu-types" name = "wgpu-types"
version = "0.9.0" version = "0.10.0"
authors = ["wgpu developers"] authors = ["wgpu developers"]
edition = "2018" edition = "2018"
description = "WebGPU types" description = "WebGPU types"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wgpu" name = "wgpu"
version = "0.9.0" version = "0.10.0"
authors = ["wgpu developers"] authors = ["wgpu developers"]
edition = "2018" edition = "2018"
description = "Rusty WebGPU API wrapper" description = "Rusty WebGPU API wrapper"
@ -8,7 +8,7 @@ homepage = "https://wgpu.rs/"
repository = "https://github.com/gfx-rs/wgpu" repository = "https://github.com/gfx-rs/wgpu"
keywords = ["graphics"] keywords = ["graphics"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
exclude = ["etc/**/*", "examples/**/*", "tests/**/*", "Cargo.lock", "target/**/*"] exclude = ["etc/**/*", "examples/**/*.png", "tests/**/*", "Cargo.lock", "target/**/*"]
autotests = false autotests = false
[package.metadata.docs.rs] [package.metadata.docs.rs]
@ -30,21 +30,25 @@ webgl = ["wgc"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc] [target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core" package = "wgpu-core"
path = "../wgpu-core" path = "../wgpu-core"
version = "0.10"
features = ["raw-window-handle"] features = ["raw-window-handle"]
[target.'cfg(target_arch = "wasm32")'.dependencies.wgc] [target.'cfg(target_arch = "wasm32")'.dependencies.wgc]
package = "wgpu-core" package = "wgpu-core"
path = "../wgpu-core" path = "../wgpu-core"
version = "0.10"
features = ["raw-window-handle"] features = ["raw-window-handle"]
optional = true optional = true
[dependencies.wgt] [dependencies.wgt]
package = "wgpu-types" package = "wgpu-types"
path = "../wgpu-types" path = "../wgpu-types"
version = "0.10"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.hal] [target.'cfg(not(target_arch = "wasm32"))'.dependencies.hal]
package = "wgpu-hal" package = "wgpu-hal"
path = "../wgpu-hal" path = "../wgpu-hal"
version = "0.10"
[dependencies] [dependencies]
arrayvec = "0.7" arrayvec = "0.7"
@ -74,14 +78,16 @@ pollster = "0.2"
env_logger = "0.8" env_logger = "0.8"
[dependencies.naga] [dependencies.naga]
git = "https://github.com/gfx-rs/naga" #git = "https://github.com/gfx-rs/naga"
rev = "4e181d6" #rev = "4e181d6"
version = "0.6"
optional = true optional = true
# used to test all the example shaders # used to test all the example shaders
[dev-dependencies.naga] [dev-dependencies.naga]
git = "https://github.com/gfx-rs/naga" #git = "https://github.com/gfx-rs/naga"
rev = "4e181d6" #rev = "4e181d6"
version = "0.6"
features = ["wgsl-in"] features = ["wgsl-in"]
[[example]] [[example]]