You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+38-2Lines changed: 38 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,8 +102,44 @@ Passing an owned value `window` to `Surface` will return a `Surface<'static>`. S
102
102
- 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).
103
103
- Add more metal keywords. By @fornwall in [#4707](https://github.com/gfx-rs/wgpu/pull/4707).
104
104
105
-
- Implement WGSL abstract types (by @jimblandy):
106
-
- Add a new `naga::Literal` variant, `I64`, for signed 64-bit literals. [#4711](https://github.com/gfx-rs/wgpu/pull/4711)
105
+
- Add partial support for WGSL abstract types (@jimblandy in [#4743](https://github.com/gfx-rs/wgpu/pull/4743)).
106
+
107
+
Abstract types make numeric literals easier to use, by
108
+
automatically converting literals and other constant expressions
109
+
from abstract numeric types to concrete types when safe and
110
+
necessary. For example, to build a vector of floating-point
111
+
numbers, Naga previously made you write:
112
+
113
+
vec3<f32>(1.0, 2.0, 3.0)
114
+
115
+
With this change, you can now simply write:
116
+
117
+
vec3<f32>(1, 2, 3)
118
+
119
+
Even though the literals are abstract integers, Naga recognizes
120
+
that it is safe and necessary to convert them to `f32` values in
121
+
order to build the vector. You can also use abstract values as
122
+
initializers for global constants, like this:
123
+
124
+
const unit_x: vec2<f32> = vec2(1, 0);
125
+
126
+
The literals `1` and `0` are abstract integers, and the expression
127
+
`vec2(1, 0)` is an abstract vector. However, Naga recognizes that
128
+
it can convert that to the concrete type `vec2<f32>` to satisfy
129
+
the given type of `unit_x`.
130
+
131
+
The WGSL specification permits abstract integers and
132
+
floating-point values in almost all contexts, but Naga's support
133
+
for this is still incomplete. Many WGSL operators and builtin
134
+
functions are specified to produce abstract results when applied
135
+
to abstract inputs, but for now Naga simply concretizes them all
136
+
before applying the operation. We will expand Naga's abstract type
137
+
support in subsequent pull requests.
138
+
139
+
As part of this work, the public types `naga::ScalarKind` and
140
+
`naga::Literal` now have new variants, `AbstractInt` and `AbstractFloat`.
141
+
142
+
- Add a new `naga::Literal` variant, `I64`, for signed 64-bit literals. [#4711](https://github.com/gfx-rs/wgpu/pull/4711)
107
143
108
144
- Emit and init `struct` member padding always. By @ErichDonGubler in [#4701](https://github.com/gfx-rs/wgpu/pull/4701).
0 commit comments