1182: Update all versions r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3620 and a bunch of other fixes in gfx-rs and naga.

**Description**
Updates the dependencies ("gfx-9" naga train) as well as self version to 0.7, to match the v0.7 branch.

**Testing**
Should just work :)

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot] 2021-02-01 05:37:39 +00:00 committed by GitHub
commit 7c7501cab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 76 additions and 78 deletions

48
Cargo.lock generated
View File

@ -475,8 +475,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-auxil" name = "gfx-auxil"
version = "0.5.0" version = "0.8.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"fxhash", "fxhash",
"gfx-hal", "gfx-hal",
@ -485,8 +485,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx11" name = "gfx-backend-dx11"
version = "0.6.0" version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -506,8 +506,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx12" name = "gfx-backend-dx12"
version = "0.6.2" version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bit-set", "bit-set",
@ -526,8 +526,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-empty" name = "gfx-backend-empty"
version = "0.6.0" version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"gfx-hal", "gfx-hal",
"log", "log",
@ -536,8 +536,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-gl" name = "gfx-backend-gl"
version = "0.6.0" version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -558,8 +558,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-metal" name = "gfx-backend-metal"
version = "0.6.0" version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -582,8 +582,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-vulkan" name = "gfx-backend-vulkan"
version = "0.6.5" version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"ash", "ash",
@ -602,8 +602,8 @@ dependencies = [
[[package]] [[package]]
name = "gfx-hal" name = "gfx-hal"
version = "0.6.0" version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"naga", "naga",
@ -878,8 +878,8 @@ dependencies = [
[[package]] [[package]]
name = "metal" name = "metal"
version = "0.20.1" version = "0.21.0"
source = "git+https://github.com/gfx-rs/metal-rs?rev=9a12f4e7e7030f41675d1b438c88f9dd75a994cd#9a12f4e7e7030f41675d1b438c88f9dd75a994cd" source = "git+https://github.com/gfx-rs/metal-rs?rev=439c986eb7a9b91e88b61def2daa66e4043fcbef#439c986eb7a9b91e88b61def2daa66e4043fcbef"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"block", "block",
@ -934,8 +934,8 @@ dependencies = [
[[package]] [[package]]
name = "naga" name = "naga"
version = "0.2.0" version = "0.3.1"
source = "git+https://github.com/gfx-rs/naga?tag=gfx-8#4a13ce022b666a4896ba1dbcbd82121e8b06ad3e" source = "git+https://github.com/gfx-rs/naga?tag=gfx-9#c12003f5648fcade5f20c01debc4cb12bd47073e"
dependencies = [ dependencies = [
"bit-set", "bit-set",
"bitflags", "bitflags",
@ -1200,8 +1200,8 @@ dependencies = [
[[package]] [[package]]
name = "range-alloc" name = "range-alloc"
version = "0.1.1" version = "0.1.2"
source = "git+https://github.com/gfx-rs/gfx?rev=2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8#2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" source = "git+https://github.com/gfx-rs/gfx?rev=d54cdcfac68711a91b55682c56da09f8e5b6f4e7#d54cdcfac68711a91b55682c56da09f8e5b6f4e7"
[[package]] [[package]]
name = "raw-window-handle" name = "raw-window-handle"
@ -1788,7 +1788,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-core" name = "wgpu-core"
version = "0.6.0" version = "0.7.0"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -1830,7 +1830,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-types" name = "wgpu-types"
version = "0.6.0" version = "0.7.0"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"serde", "serde",

View File

@ -12,7 +12,7 @@ This is the core logic of an experimental [WebGPU](https://www.w3.org/community/
The implementation consists of the following parts: The implementation consists of the following parts:
- [![Crates.io](https://img.shields.io/crates/v/wgpu-core.svg?label=wgpu-core)](https://crates.io/crates/wgpu-core) [![docs.rs](https://docs.rs/wgpu-core/badge.svg)](https://docs.rs/wgpu-core/) - internal Rust API for WebGPU implementations to use - [![Crates.io](https://img.shields.io/crates/v/wgpu-core.svg?label=wgpu-core)](https://crates.io/crates/wgpu-core) [![docs.rs](https://docs.rs/wgpu-core/badge.svg)](https://docs.rs/wgpu-core/) - internal Rust API for WebGPU implementations to use
- [![Crates.io](https://img.shields.io/crates/v/wgpu-types.svg?label=wgpu-types)](https://crates.io/crates/wgpu-types) [![docs.rs](https://docs.rs/wgpu-types/badge.svg)](https://docs.rs/wgpu-types/) - Rust types shared between `wgpu-core`, `wgpu-native`, and `wgpu-rs` - [![Crates.io](https://img.shields.io/crates/v/wgpu-types.svg?label=wgpu-types)](https://crates.io/crates/wgpu-types) [![docs.rs](https://docs.rs/wgpu-types/badge.svg)](https://docs.rs/wgpu-types/) - Rust types shared between `wgpu-core` and `wgpu-rs`
- `player` - standalone application for replaying the API traces, uses `winit` - `player` - standalone application for replaying the API traces, uses `winit`
This repository contains the core of `wgpu`, and is not usable directly by applications. This repository contains the core of `wgpu`, and is not usable directly by applications.
@ -23,10 +23,10 @@ If you are looking for the native implementation or bindings to the API in other
API | Windows 7/10 | Linux & Android | macOS & iOS | API | Windows 7/10 | Linux & Android | macOS & iOS |
----- | ------------------ | ------------------ | ------------------ | ----- | ------------------ | ------------------ | ------------------ |
DX11 | :white_check_mark: | | | DX11 | :ok: | | |
DX12 | :heavy_check_mark: | | | DX12 | :white_check_mark: | | |
Vulkan | :heavy_check_mark: | :heavy_check_mark: | | Vulkan | :white_check_mark: | :white_check_mark: | |
Metal | | | :heavy_check_mark: | Metal | | | :white_check_mark: |
OpenGL | | :construction: | :construction: | GL ES3 | | :construction: | |
:heavy_check_mark: = Primary support — :white_check_mark: = Secondary support — :construction: = Unsupported, but support in progress :white_check_mark: = Primary support — :ok: = Secondary support — :construction: = Unsupported, but support in progress

View File

@ -12,5 +12,4 @@ publish = false
[dependencies.wgc] [dependencies.wgc]
path = "../wgpu-core" path = "../wgpu-core"
package = "wgpu-core" package = "wgpu-core"
version = "0.6"
features = ["serial-pass", "trace"] features = ["serial-pass", "trace"]

View File

@ -25,13 +25,11 @@ winit = { version = "0.24", optional = true }
[dependencies.wgt] [dependencies.wgt]
path = "../wgpu-types" path = "../wgpu-types"
package = "wgpu-types" package = "wgpu-types"
version = "0.6"
features = ["replay"] features = ["replay"]
[dependencies.wgc] [dependencies.wgc]
path = "../wgpu-core" path = "../wgpu-core"
package = "wgpu-core" package = "wgpu-core"
version = "0.6"
features = ["replay", "raw-window-handle"] features = ["replay", "raw-window-handle"]
#[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies.gfx-backend-metal] #[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies.gfx-backend-metal]

View File

@ -1,6 +1,6 @@
[package] [package]
name = "wgpu-core" name = "wgpu-core"
version = "0.6.0" version = "0.7.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"
@ -36,34 +36,34 @@ thiserror = "1"
gpu-alloc = { version = "0.3", features = ["tracing"] } gpu-alloc = { version = "0.3", features = ["tracing"] }
gpu-descriptor = { version = "0.1", features = ["tracing"] } gpu-descriptor = { version = "0.1", features = ["tracing"] }
hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" } hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7" }
gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" } gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7" }
[target.'cfg(all(not(target_arch = "wasm32"), all(unix, not(target_os = "ios"), not(target_os = "macos"))))'.dependencies] [target.'cfg(all(not(target_arch = "wasm32"), all(unix, not(target_os = "ios"), not(target_os = "macos"))))'.dependencies]
gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8", features = ["naga"] } gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7", features = ["naga"] }
gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8", features = ["naga"] } gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7", features = ["naga"] }
[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]
gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8", features = ["naga"] } gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7", features = ["naga"] }
gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8", optional = true } gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7", optional = true }
[target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies] [target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies]
gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" } gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7" }
gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8" } gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7" }
gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8", features = ["naga"] } gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7", features = ["naga"] }
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "2fd74dbe1562a3eef05b11dcd300c1c9c9bc12a8", features = ["naga"] } gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "d54cdcfac68711a91b55682c56da09f8e5b6f4e7", features = ["naga"] }
[dependencies.naga] [dependencies.naga]
git = "https://github.com/gfx-rs/naga" git = "https://github.com/gfx-rs/naga"
tag = "gfx-8" tag = "gfx-9"
features = ["spv-in", "spv-out", "wgsl-in"] features = ["spv-in", "spv-out", "wgsl-in"]
[dependencies.wgt] [dependencies.wgt]
path = "../wgpu-types" path = "../wgpu-types"
package = "wgpu-types" package = "wgpu-types"
version = "0.6" version = "0.7"
[dev-dependencies] [dev-dependencies]
loom = "0.3" loom = "0.3"

View File

@ -28,7 +28,7 @@ const CLEANUP_WAIT_MS: u64 = 5000;
/// A struct that keeps lists of resources that are no longer needed by the user. /// A struct that keeps lists of resources that are no longer needed by the user.
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct SuspectedResources { pub(super) struct SuspectedResources {
pub(crate) buffers: Vec<id::Valid<id::BufferId>>, pub(crate) buffers: Vec<id::Valid<id::BufferId>>,
pub(crate) textures: Vec<id::Valid<id::TextureId>>, pub(crate) textures: Vec<id::Valid<id::TextureId>>,
pub(crate) texture_views: Vec<id::Valid<id::TextureViewId>>, pub(crate) texture_views: Vec<id::Valid<id::TextureViewId>>,
@ -43,7 +43,7 @@ pub struct SuspectedResources {
} }
impl SuspectedResources { impl SuspectedResources {
pub(crate) fn clear(&mut self) { pub(super) fn clear(&mut self) {
self.buffers.clear(); self.buffers.clear();
self.textures.clear(); self.textures.clear();
self.texture_views.clear(); self.texture_views.clear();
@ -57,7 +57,7 @@ impl SuspectedResources {
self.query_sets.clear(); self.query_sets.clear();
} }
pub(crate) fn extend(&mut self, other: &Self) { pub(super) fn extend(&mut self, other: &Self) {
self.buffers.extend_from_slice(&other.buffers); self.buffers.extend_from_slice(&other.buffers);
self.textures.extend_from_slice(&other.textures); self.textures.extend_from_slice(&other.textures);
self.texture_views.extend_from_slice(&other.texture_views); self.texture_views.extend_from_slice(&other.texture_views);
@ -75,7 +75,7 @@ impl SuspectedResources {
self.query_sets.extend_from_slice(&other.query_sets); self.query_sets.extend_from_slice(&other.query_sets);
} }
pub(crate) fn add_trackers(&mut self, trackers: &TrackerSet) { pub(super) fn add_trackers(&mut self, trackers: &TrackerSet) {
self.buffers.extend(trackers.buffers.used()); self.buffers.extend(trackers.buffers.used());
self.textures.extend(trackers.textures.used()); self.textures.extend(trackers.textures.used());
self.texture_views.extend(trackers.views.used()); self.texture_views.extend(trackers.views.used());
@ -216,7 +216,7 @@ pub enum WaitIdleError {
/// 3. When `ActiveSubmission` is retired, the mapped buffers associated with it are moved to `ready_to_map` vector. /// 3. When `ActiveSubmission` is retired, the mapped buffers associated with it are moved to `ready_to_map` vector.
/// 4. Finally, `handle_mapping` issues all the callbacks. /// 4. Finally, `handle_mapping` issues all the callbacks.
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct LifetimeTracker<B: hal::Backend> { pub(super) struct LifetimeTracker<B: hal::Backend> {
/// Resources that the user has requested be mapped, but are still in use. /// Resources that the user has requested be mapped, but are still in use.
mapped: Vec<Stored<id::BufferId>>, mapped: Vec<Stored<id::BufferId>>,
/// Buffers can be used in a submission that is yet to be made, by the /// Buffers can be used in a submission that is yet to be made, by the
@ -375,7 +375,7 @@ impl<B: hal::Backend> LifetimeTracker<B> {
} }
impl<B: GfxBackend> LifetimeTracker<B> { impl<B: GfxBackend> LifetimeTracker<B> {
pub(crate) fn triage_suspected<G: GlobalIdentityHandlerFactory>( pub(super) fn triage_suspected<G: GlobalIdentityHandlerFactory>(
&mut self, &mut self,
hub: &Hub<B, G>, hub: &Hub<B, G>,
trackers: &Mutex<TrackerSet>, trackers: &Mutex<TrackerSet>,
@ -636,7 +636,7 @@ impl<B: GfxBackend> LifetimeTracker<B> {
} }
} }
pub(crate) fn triage_mapped<G: GlobalIdentityHandlerFactory>( pub(super) fn triage_mapped<G: GlobalIdentityHandlerFactory>(
&mut self, &mut self,
hub: &Hub<B, G>, hub: &Hub<B, G>,
token: &mut Token<super::Device<B>>, token: &mut Token<super::Device<B>>,
@ -666,7 +666,7 @@ impl<B: GfxBackend> LifetimeTracker<B> {
} }
} }
pub(crate) fn handle_mapping<G: GlobalIdentityHandlerFactory>( pub(super) fn handle_mapping<G: GlobalIdentityHandlerFactory>(
&mut self, &mut self,
hub: &Hub<B, G>, hub: &Hub<B, G>,
raw: &B::Device, raw: &B::Device,

View File

@ -44,7 +44,7 @@ use std::{
pub mod alloc; pub mod alloc;
pub mod descriptor; pub mod descriptor;
mod life; mod life;
mod queue; pub mod queue;
#[cfg(any(feature = "trace", feature = "replay"))] #[cfg(any(feature = "trace", feature = "replay"))]
pub mod trace; pub mod trace;
@ -379,7 +379,7 @@ impl<B: GfxBackend> Device<B> {
tracker.lock() tracker.lock()
} }
pub(crate) fn lock_life<'this, 'token: 'this>( fn lock_life<'this, 'token: 'this>(
&'this self, &'this self,
//TODO: fix this - the token has to be borrowed for the lock //TODO: fix this - the token has to be borrowed for the lock
token: &mut Token<'token, Self>, token: &mut Token<'token, Self>,

View File

@ -18,7 +18,7 @@ use crate::{
span, FastHashMap, FastHashSet, span, FastHashMap, FastHashSet,
}; };
use hal::{command::CommandBuffer as _, device::Device as _, queue::CommandQueue as _}; use hal::{command::CommandBuffer as _, device::Device as _, queue::Queue as _};
use smallvec::SmallVec; use smallvec::SmallVec;
use std::{iter, ops::Range, ptr}; use std::{iter, ops::Range, ptr};
use thiserror::Error; use thiserror::Error;
@ -148,6 +148,10 @@ impl<B: hal::Backend> super::Device<B> {
} }
} }
#[error("queue is invalid")]
#[derive(Clone, Debug, Error)]
pub struct InvalidQueue;
#[derive(Clone, Debug, Error)] #[derive(Clone, Debug, Error)]
pub enum QueueWriteError { pub enum QueueWriteError {
#[error(transparent)] #[error(transparent)]
@ -809,6 +813,21 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(()) Ok(())
} }
pub fn queue_get_timestamp_period<B: GfxBackend>(
&self,
queue_id: id::QueueId,
) -> Result<f32, InvalidQueue> {
span!(_guard, INFO, "Queue::get_timestamp_period");
let hub = B::hub(self);
let mut token = Token::root();
let (device_guard, _) = hub.devices.read(&mut token);
match device_guard.get(queue_id) {
Ok(device) => Ok(device.queue_group.queues[0].timestamp_period()),
Err(_) => Err(InvalidQueue),
}
}
} }
fn get_lowest_common_denom(a: u32, b: u32) -> u32 { fn get_lowest_common_denom(a: u32, b: u32) -> u32 {

View File

@ -208,7 +208,6 @@ impl<B: GfxBackend> Adapter<B> {
.format_properties(Some(hal::format::Format::D24UnormS8Uint)) .format_properties(Some(hal::format::Format::D24UnormS8Uint))
.optimal_tiling .optimal_tiling
.contains(hal::format::ImageFeature::DEPTH_STENCIL_ATTACHMENT), .contains(hal::format::ImageFeature::DEPTH_STENCIL_ATTACHMENT),
timestamp_period: adapter_limits.timestamp_period,
}; };
let default_limits = wgt::Limits::default(); let default_limits = wgt::Limits::default();
@ -877,22 +876,6 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
.map_err(|_| InvalidAdapter) .map_err(|_| InvalidAdapter)
} }
pub fn adapter_get_timestamp_period<B: GfxBackend>(
&self,
adapter_id: AdapterId,
) -> Result<f32, InvalidAdapter> {
span!(_guard, INFO, "Adapter::get_timestamp_period");
let hub = B::hub(self);
let mut token = Token::root();
let (adapter_guard, _) = hub.adapters.read(&mut token);
adapter_guard
.get(adapter_id)
.map(|adapter| adapter.private_features.timestamp_period)
.map_err(|_| InvalidAdapter)
}
pub fn adapter_drop<B: GfxBackend>(&self, adapter_id: AdapterId) { pub fn adapter_drop<B: GfxBackend>(&self, adapter_id: AdapterId) {
span!(_guard, INFO, "Adapter::drop"); span!(_guard, INFO, "Adapter::drop");

View File

@ -223,7 +223,6 @@ struct PrivateFeatures {
anisotropic_filtering: bool, anisotropic_filtering: bool,
texture_d24: bool, texture_d24: bool,
texture_d24_s8: bool, texture_d24_s8: bool,
timestamp_period: f32,
} }
#[macro_export] #[macro_export]

View File

@ -44,7 +44,7 @@ use crate::{
LifeGuard, PrivateFeatures, Stored, SubmissionIndex, LifeGuard, PrivateFeatures, Stored, SubmissionIndex,
}; };
use hal::{queue::CommandQueue as _, window::PresentationSurface as _}; use hal::{queue::Queue as _, window::PresentationSurface as _};
use thiserror::Error; use thiserror::Error;
use wgt::{SwapChainDescriptor, SwapChainStatus}; use wgt::{SwapChainDescriptor, SwapChainStatus};

View File

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