Skip to content

Commit

Permalink
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Gentile authored and Mauro Gentile committed Nov 16, 2023
2 parents c8a60e2 + 1d7c7c8 commit ff042c4
Show file tree
Hide file tree
Showing 88 changed files with 3,225 additions and 2,907 deletions.
39 changes: 35 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ Bottom level categories:

## Unreleased

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

### Changes

- Arcanization of wgpu core resources: Removed 'Token' and 'LifeTime' related management,
Expand All @@ -50,19 +48,52 @@ removed 'RefCount' and 'MultiRefCount' in favour of using only 'Arc' internal re
#### 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).

- 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).

- When evaluating const-expressions and generating SPIR-V, properly handle `Compose` expressions whose operands are `Splat` expressions. Such expressions are created and marked as constant by the constant evaluator. By @jimblandy in [#4695](https://github.com/gfx-rs/wgpu/pull/4695).

### Examples

- remove winit dependency from hello-compute example by @psvri in [#4699](https://github.com/gfx-rs/wgpu/pull/4699)

- Fix issue where local variables were sometimes using variable names from previous functions.
## 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 Down
5 changes: 2 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ deno_web = "0.150.0"
deno_webidl = "0.119.0"
deno_webgpu = { version = "0.85.0", path = "./deno_webgpu" }
tokio = "1.34.0"
termcolor = "1.3.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
1 change: 0 additions & 1 deletion examples/hello-compute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ env_logger.workspace = true
flume.workspace = true
pollster.workspace = true
wgpu.workspace = true
winit.workspace = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion 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 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 @@ -275,10 +275,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 @@ -463,8 +463,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 ff042c4

Please sign in to comment.