Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/trunk' into debug_printf
Browse files Browse the repository at this point in the history
  • Loading branch information
exrook committed Nov 16, 2023
2 parents 8590a8e + acaeb8d commit fc5647c
Show file tree
Hide file tree
Showing 117 changed files with 4,848 additions and 3,277 deletions.
43 changes: 36 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,51 @@ Bottom level categories:

## Unreleased

For naga changelogs at or before v0.14.0. See [naga's changelog](naga/CHANGELOG.md).

### Changes

#### General

- Log vulkan validation layer messages during instance creation and destruction: By @exrook in [#4586](https://github.com/gfx-rs/wgpu/pull/4586)
- `TextureFormat::block_size` is deprecated, use `TextureFormat::block_copy_size` instead: By @wumpf in [#4647](https://github.com/gfx-rs/wgpu/pull/4647)

#### Naga

- Introduce a new `Scalar` struct type for use in Naga's IR, and update all frontend, middle, and backend code appropriately. By @jimblandy in [#4673](https://github.com/gfx-rs/wgpu/pull/4673).

### Bug Fixes

#### WGL

- Create a hidden window per `wgpu::Instance` instead of sharing a global one.

#### Naga MSL-OUT
#### Naga

- Improve algorithm used by module compaction. By @jimblandy in [#4662](https://github.com/gfx-rs/wgpu/pull/4662).

- Fix issue where local variables were sometimes using variable names from previous functions.
- When reading GLSL, fix the argument types of the double-precision floating-point overloads of the `dot`, `reflect`, `distance`, and `ldexp` builtin functions. Correct the WGSL generated for constructing 64-bit floating-point matrices. Add tests for all the above. By @jimblandy in [#4684](https://github.com/gfx-rs/wgpu/pull/4684).

## v0.18.1 (2023-11-15)

(naga version 0.14.1)

### Bug Fixes

#### General
- Fix panic in `Surface::configure` in debug builds. By @cwfitzgerald in [#4635](https://github.com/gfx-rs/wgpu/pull/4635)
- Fix crash when all the following are true: By @teoxoy in #[#4642](https://github.com/gfx-rs/wgpu/pull/4642)
- Passing a naga module directly to `Device::create_shader_module`.
- `InstanceFlags::DEBUG` is enabled.

#### DX12
- Always use HLSL 2018 when using DXC to compile HLSL shaders. By @daxpedda in [#4629](https://github.com/gfx-rs/wgpu/pull/4629)

#### Metal
- In Metal Shading Language output, fix issue where local variables were sometimes using variable names from previous functions. By @DJMcNab in [#4594](https://github.com/gfx-rs/wgpu/pull/4594)

## v0.18.0 (2023-10-25)

For naga changelogs at or before v0.14.0. See [naga's changelog](naga/CHANGELOG.md).

### Desktop OpenGL 3.3+ Support on Windows

We now support OpenGL on Windows! This brings support for a vast majority of the hardware that used to be covered by our DX11 backend. As of this writing we support OpenGL 3.3+, though there are efforts to reduce that further.
Expand All @@ -73,7 +98,7 @@ By @Zoxc in [#4248](https://github.com/gfx-rs/wgpu/pull/4248)
Timestamp queries are now supported on both Metal and Desktop OpenGL. On Apple chips on Metal, they only support timestamp queries in command buffers or in the renderpass descriptor,
they do not support them inside a pass.

Metal: By @Wumpf in [#4008](https://github.com/gfx-rs/wgpu/pull/4008)
Metal: By @Wumpf in [#4008](https://github.com/gfx-rs/wgpu/pull/4008)
OpenGL: By @Zoxc in [#4267](https://github.com/gfx-rs/wgpu/pull/4267)

### Render/Compute Pass Query Writes
Expand Down Expand Up @@ -196,7 +221,7 @@ let instance = wgpu::Instance::new(InstanceDescriptor {
});
```

`gles_minor_version`: By @PJB3005 in [#3998](https://github.com/gfx-rs/wgpu/pull/3998)
`gles_minor_version`: By @PJB3005 in [#3998](https://github.com/gfx-rs/wgpu/pull/3998)
`flags`: By @nical in [#4230](https://github.com/gfx-rs/wgpu/pull/4230)

### Many New Examples!
Expand Down Expand Up @@ -242,11 +267,13 @@ By @teoxoy in [#4185](https://github.com/gfx-rs/wgpu/pull/4185)
- Add trace-level logging for most entry points in wgpu-core By @nical in [4183](https://github.com/gfx-rs/wgpu/pull/4183)
- Add `Rgb10a2Uint` format. By @teoxoy in [4199](https://github.com/gfx-rs/wgpu/pull/4199)
- Validate that resources are used on the right device. By @nical in [4207](https://github.com/gfx-rs/wgpu/pull/4207)
- Expose instance flags.
- Expose instance flags.
- Add support for the bgra8unorm-storage feature. By @jinleili and @nical in [#4228](https://github.com/gfx-rs/wgpu/pull/4228)
- Calls to lost devices now return `DeviceError::Lost` instead of `DeviceError::Invalid`. By @bradwerth in [#4238]([https://github.com/gfx-rs/wgpu/pull/4238])
- Let the `"strict_asserts"` feature enable check that wgpu-core's lock-ordering tokens are unique per thread. By @jimblandy in [#4258]([https://github.com/gfx-rs/wgpu/pull/4258])
- Allow filtering labels out before they are passed to GPU drivers by @nical in [https://github.com/gfx-rs/wgpu/pull/4246](4246)
- `DeviceLostClosure` callback mechanism provided so user agents can resolve `GPUDevice.lost` Promises at the appropriate time by @bradwerth in [#4645](https://github.com/gfx-rs/wgpu/pull/4645)


#### Vulkan

Expand All @@ -271,6 +298,8 @@ By @teoxoy in [#4185](https://github.com/gfx-rs/wgpu/pull/4185)
- Fix `clear` texture views being leaked when `wgpu::SurfaceTexture` is dropped before it is presented. By @rajveermalviya in [#4057](https://github.com/gfx-rs/wgpu/pull/4057).
- Add `Feature::SHADER_UNUSED_VERTEX_OUTPUT` to allow unused vertex shader outputs. By @Aaron1011 in [#4116](https://github.com/gfx-rs/wgpu/pull/4116).
- Fix a panic in `surface_configure`. By @nical in [#4220](https://github.com/gfx-rs/wgpu/pull/4220) and [#4227](https://github.com/gfx-rs/wgpu/pull/4227)
- Pipelines register their implicit layouts in error cases. By @bradwerth in [#4624](https://github.com/gfx-rs/wgpu/pull/4624)
- Better handle explicit destruction of textures and buffers. By @nical in [#4657](https://github.com/gfx-rs/wgpu/pull/4657)

#### Vulkan

Expand Down
35 changes: 17 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ deno_url = "0.119.0"
deno_web = "0.150.0"
deno_webidl = "0.119.0"
deno_webgpu = { version = "0.85.0", path = "./deno_webgpu" }
tokio = "1.33.0"
termcolor = "1.3.0"
tokio = "1.34.0"
termcolor = "1.4.0"

[patch."https://github.com/gfx-rs/naga"]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ We have a [wiki](https://github.com/gfx-rs/wgpu/wiki) that serves as a knowledge

:white_check_mark: = First Class Support
:ok: = Downlevel/Best Effort Support
:triangular_ruler: = Requires the [ANGLE](#angle) translation layer (GL ES 3.0 only)
:triangular_ruler: = Requires the [ANGLE](#angle) translation layer (GL ES 3.0 only)
:volcano: = Requires the [MoltenVK](https://vulkan.lunarg.com/sdk/home#mac) translation layer
:hammer_and_wrench: = Unsupported, though open to contributions

Expand Down
2 changes: 1 addition & 1 deletion examples/repeated-compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ path = "src/main.rs"
bytemuck.workspace = true
env_logger.workspace = true
futures-intrusive.workspace = true
getrandom = { version = "0.2.10", features = ["js"] }
getrandom = { version = "0.2.11", features = ["js"] }
log.workspace = true
pollster.workspace = true
wgpu.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions naga/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ harness = false
arbitrary = { version = "1.3", features = ["derive"], optional = true }
bitflags = "2.2"
bit-set = "0.5"
termcolor = { version = "1.0.4", optional = true }
termcolor = { version = "1.4.0", optional = true }
# remove termcolor dep when updating to the next version of codespan-reporting
# termcolor minimum version was wrong and was fixed in
# https://github.com/brendanzab/codespan/commit/e99c867339a877731437e7ee6a903a3d03b5439e
Expand All @@ -52,7 +52,7 @@ log = "0.4"
num-traits = "0.2"
spirv = { version = "0.2", optional = true }
thiserror = "1.0.21"
serde = { version = "1.0.103", features = ["derive"], optional = true }
serde = { version = "1.0.192", features = ["derive"], optional = true }
petgraph = { version = "0.6", optional = true }
pp-rs = { version = "0.2.1", optional = true }
hexf-parse = { version = "0.2.1", optional = true }
Expand Down
14 changes: 7 additions & 7 deletions naga/src/back/glsl/features.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{BackendResult, Error, Version, Writer};
use crate::{
AddressSpace, Binding, Bytes, Expression, Handle, ImageClass, ImageDimension, Interpolation,
Sampling, ScalarKind, ShaderStage, StorageFormat, Type, TypeInner,
AddressSpace, Binding, Expression, Handle, ImageClass, ImageDimension, Interpolation, Sampling,
Scalar, ScalarKind, ShaderStage, StorageFormat, Type, TypeInner,
};
use std::fmt::Write;

Expand Down Expand Up @@ -281,10 +281,10 @@ impl<'a, W> Writer<'a, W> {

for (ty_handle, ty) in self.module.types.iter() {
match ty.inner {
TypeInner::Scalar { kind, width } => self.scalar_required_features(kind, width),
TypeInner::Vector { kind, width, .. } => self.scalar_required_features(kind, width),
TypeInner::Scalar(scalar) => self.scalar_required_features(scalar),
TypeInner::Vector { scalar, .. } => self.scalar_required_features(scalar),
TypeInner::Matrix { width, .. } => {
self.scalar_required_features(ScalarKind::Float, width)
self.scalar_required_features(Scalar::float(width))
}
TypeInner::Array { base, size, .. } => {
if let TypeInner::Array { .. } = self.module.types[base].inner {
Expand Down Expand Up @@ -485,8 +485,8 @@ impl<'a, W> Writer<'a, W> {
}

/// Helper method that checks the [`Features`] needed by a scalar
fn scalar_required_features(&mut self, kind: ScalarKind, width: Bytes) {
if kind == ScalarKind::Float && width == 8 {
fn scalar_required_features(&mut self, scalar: Scalar) {
if scalar.kind == ScalarKind::Float && scalar.width == 8 {
self.features.request(Features::DOUBLE_TYPE);
}
}
Expand Down
Loading

0 comments on commit fc5647c

Please sign in to comment.