tag:github.com,2008:https://github.com/gfx-rs/wgpu/releasesRelease notes from wgpu2025-02-27T02:05:12Ztag:github.com,2008:Repository/148686316/wgpu-hal-v24.0.22025-02-27T02:05:12Zwgpu-hal-v24.0.2No content.cwfitzgeraldtag:github.com,2008:Repository/148686316/wgpu-core-v24.0.22025-02-27T02:05:04Zwgpu-core-v24.0.2No content.cwfitzgeraldtag:github.com,2008:Repository/148686316/v24.0.22025-02-27T02:23:15Zv24.0.2<p>This release bumps <code>wgpu-core</code> and <code>wgpu-hal</code> to <code>24.0.2</code>. All other crates remain at their previous verions.</p>
<h4>Bug Fixes</h4>
<ul>
<li>Fix GLES renderpass clears causing violation of <code>max_color_attachments</code> limit. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/adrian17/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/adrian17">@adrian17</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6994" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6994/hovercard">#6994</a>.</li>
<li>Fix a possible deadlock within <code>Queue::write_texture</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/metamuffin/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/metamuffin">@metamuffin</a> in <a href="https://github.com/gfx-rs/wgpu/pull/7004" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/7004/hovercard">#7004</a></li>
<li>Decrement <code>max_storage_buffer_binding_size</code> by 1 to match <code>max_buffer_size</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/minus1ms/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/minus1ms">@minus1ms</a> in <a href="https://github.com/gfx-rs/wgpu/pull/7217" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/7217/hovercard">#7217</a></li>
</ul>cwfitzgeraldtag:github.com,2008:Repository/148686316/wgpu-v24.0.12025-01-23T00:19:30Zwgpu-v24.0.1<p>chore: Release wgpu version 24.0.1</p>cwfitzgeraldtag:github.com,2008:Repository/148686316/v24.0.12025-01-23T00:22:51Zv24.0.1<p>This release contains <code>wgpu</code> v24.0.1. All other crates remain at v24.0.0.</p>
<h4>Bug Fixes</h4>
<ul>
<li>Fix <code>wgpu</code> not building with <code>--no-default-features</code> on when targeting <code>wasm32-unknown-unknown</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Wumpf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Wumpf">@Wumpf</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6946" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6946/hovercard">#6946</a>.</li>
<li>Implement <code>Clone</code> on <code>ShaderModule</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/a1phyr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/a1phyr">@a1phyr</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6937" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6937/hovercard">#6937</a>.</li>
<li>Fix <code>CopyExternalImageDestInfo</code> not exported on <code>wgpu</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Wumpf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Wumpf">@Wumpf</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6962" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6962/hovercard">#6962</a>.</li>
</ul>cwfitzgeraldtag:github.com,2008:Repository/148686316/v24.0.02025-01-16T16:01:29Zv24.0.0<h3>Major changes</h3>
<h4>Refactored Dispatch Between <code>wgpu-core</code> and <code>webgpu</code></h4>
<p>The crate <code>wgpu</code> has two different "backends", one which targets webgpu in the browser, one which targets <code>wgpu_core</code> on native platforms and webgl. This was previously very difficult to traverse and add new features to. The entire system was refactored to make it simpler. Additionally the new system has zero overhead if there is only one "backend" in use. You can see the new system in action by using go-to-definition on any wgpu functions in your IDE.</p>
<p>By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6619" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6619/hovercard">#6619</a>.</p>
<h4>Most objects in <code>wgpu</code> are now <code>Clone</code></h4>
<p>All types in the <code>wgpu</code> API are now <code>Clone</code>.<br>
This is implemented with internal reference counting, so cloning for instance a <code>Buffer</code> does copies only the "handle" of the GPU buffer, not the underlying resource.</p>
<p>Previously, libraries using <code>wgpu</code> objects like <code>Device</code>, <code>Buffer</code> or <code>Texture</code> etc. often had to manually wrap them in a <code>Arc</code> to allow passing between libraries.<br>
This caused a lot of friction since if one library wanted to use a <code>Buffer</code> by value, calling code had to give up ownership of the resource which may interfere with other subsystems.<br>
Note that this also mimics how the WebGPU javascript API works where objects can be cloned and moved around freely.</p>
<p>By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6665" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6665/hovercard">#6665</a>.</p>
<h4>Render and Compute Passes Now Properly Enforce Their Lifetime</h4>
<p>A regression introduced in 23.0.0 caused lifetimes of render and compute passes to be incorrectly enforced. While this is not<br>
a soundness issue, the intent is to move an error from runtime to compile time. This issue has been fixed and restored to the 22.0.0 behavior.</p>
<h4>Bindless (<code>binding_array</code>) Grew More Capabilities</h4>
<ul>
<li>DX12 now supports <code>PARTIALLY_BOUND_BINDING_ARRAY</code> on Resource Binding Tier 3 Hardware. This is most D3D12 hardware <a href="https://d3d12infodb.boolka.dev/FeatureTable.html" rel="nofollow">D3D12 Feature Table</a> for more information on what hardware supports this feature. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6734" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6734/hovercard">#6734</a>.</li>
</ul>
<h4><code>Device::create_shader_module_unchecked</code> Renamed and Now Has Configuration Options</h4>
<p><code>create_shader_module_unchecked</code> became <code>create_shader_module_trusted</code>.</p>
<p>This allows you to customize which exact checks are omitted so that you can get the correct balance of performance and safety for your use case. Calling the function is still unsafe, but now can be used to skip certain checks only on certain builds.</p>
<p>This also allows users to disable the workarounds in the <code>msl-out</code> backend to prevent the compiler from optimizing infinite loops. This can have a big impact on performance, but is not recommended for untrusted shaders.</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let desc: ShaderModuleDescriptor = include_wgsl!(...)
- let module = unsafe { device.create_shader_module_unchecked(desc) };
+ let module = unsafe { device.create_shader_module_trusted(desc, wgpu::ShaderRuntimeChecks::unchecked()) };"><pre>let desc: ShaderModuleDescriptor = include_wgsl!(...)
<span class="pl-md"><span class="pl-md">-</span> let module = unsafe { device.create_shader_module_unchecked(desc) };</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> let module = unsafe { device.create_shader_module_trusted(desc, wgpu::ShaderRuntimeChecks::unchecked()) };</span></pre></div>
<p>By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rudderbucky/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rudderbucky">@rudderbucky</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6662" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6662/hovercard">#6662</a>.</p>
<h4><code>wgpu::Instance::new</code> now takes <code>InstanceDescriptor</code> by reference</h4>
<p>Previously <code>wgpu::Instance::new</code> took <code>InstanceDescriptor</code> by value (which is overall fairly uncommon in wgpu).<br>
Furthermore, <code>InstanceDescriptor</code> is now cloneable.</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- let instance = wgpu::Instance::new(instance_desc);
+ let instance = wgpu::Instance::new(&instance_desc);"><pre><span class="pl-md"><span class="pl-md">-</span> let instance = wgpu::Instance::new(instance_desc);</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> let instance = wgpu::Instance::new(&instance_desc);</span></pre></div>
<p>By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Wumpf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Wumpf">@Wumpf</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6849" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6849/hovercard">#6849</a>.</p>
<h4>Environment Variable Handling Overhaul</h4>
<p>Previously how various bits of code handled reading settings from environment variables was inconsistent and unideomatic.<br>
We have unified it to (<code>Type::from_env()</code> or <code>Type::from_env_or_default()</code>) and <code>Type::with_env</code> for all types.</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- wgpu::util::backend_bits_from_env()
+ wgpu::Backends::from_env()
- wgpu::util::power_preference_from_env()
+ wgpu::PowerPreference::from_env()
- wgpu::util::dx12_shader_compiler_from_env()
+ wgpu::Dx12Compiler::from_env()
- wgpu::util::gles_minor_version_from_env()
+ wgpu::Gles3MinorVersion::from_env()
- wgpu::util::instance_descriptor_from_env()
+ wgpu::InstanceDescriptor::from_env_or_default()
- wgpu::util::parse_backends_from_comma_list(&str)
+ wgpu::Backends::from_comma_list(&str)"><pre><span class="pl-md"><span class="pl-md">-</span> wgpu::util::backend_bits_from_env()</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> wgpu::Backends::from_env()</span>
<span class="pl-md"><span class="pl-md">-</span> wgpu::util::power_preference_from_env()</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> wgpu::PowerPreference::from_env()</span>
<span class="pl-md"><span class="pl-md">-</span> wgpu::util::dx12_shader_compiler_from_env()</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> wgpu::Dx12Compiler::from_env()</span>
<span class="pl-md"><span class="pl-md">-</span> wgpu::util::gles_minor_version_from_env()</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> wgpu::Gles3MinorVersion::from_env()</span>
<span class="pl-md"><span class="pl-md">-</span> wgpu::util::instance_descriptor_from_env()</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> wgpu::InstanceDescriptor::from_env_or_default()</span>
<span class="pl-md"><span class="pl-md">-</span> wgpu::util::parse_backends_from_comma_list(&str)</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> wgpu::Backends::from_comma_list(&str)</span></pre></div>
<p>By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6895" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6895/hovercard">#6895</a></p>
<h4>Backend-specific instance options are now in separate structs</h4>
<p>In order to better facilitate growing more interesting backend options, we have put them into individual structs. This allows users to more easily understand what options can be defaulted and which they care about. All of these new structs implement <code>from_env()</code> and delegate to their respective <code>from_env()</code> methods.</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
- backends: wgpu::Backends::all(),
- flags: wgpu::InstanceFlags::default(),
- dx12_shader_compiler: wgpu::Dx12Compiler::Dxc,
- gles_minor_version: wgpu::Gles3MinorVersion::Automatic,
- });
+ let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
+ backends: wgpu::Backends::all(),
+ flags: wgpu::InstanceFlags::default(),
+ backend_options: wgpu::BackendOptions {
+ dx12: wgpu::Dx12BackendOptions {
+ shader_compiler: wgpu::Dx12ShaderCompiler::Dxc,
+ },
+ gl: wgpu::GlBackendOptions {
+ gles_minor_version: wgpu::Gles3MinorVersion::Automatic,
+ },
+ },
+ });"><pre><span class="pl-md"><span class="pl-md">-</span> let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {</span>
<span class="pl-md"><span class="pl-md">-</span> backends: wgpu::Backends::all(),</span>
<span class="pl-md"><span class="pl-md">-</span> flags: wgpu::InstanceFlags::default(),</span>
<span class="pl-md"><span class="pl-md">-</span> dx12_shader_compiler: wgpu::Dx12Compiler::Dxc,</span>
<span class="pl-md"><span class="pl-md">-</span> gles_minor_version: wgpu::Gles3MinorVersion::Automatic,</span>
<span class="pl-md"><span class="pl-md">-</span> });</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> backends: wgpu::Backends::all(),</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> flags: wgpu::InstanceFlags::default(),</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> backend_options: wgpu::BackendOptions {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> dx12: wgpu::Dx12BackendOptions {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> shader_compiler: wgpu::Dx12ShaderCompiler::Dxc,</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> },</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> gl: wgpu::GlBackendOptions {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> gles_minor_version: wgpu::Gles3MinorVersion::Automatic,</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> },</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> },</span>
<span class="pl-mi1"><span class="pl-mi1">+</span> });</span></pre></div>
<p>If you do not need any of these options, or only need one backend's info use the <code>default()</code> impl to fill out the remaining feelds.</p>
<p>By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6895" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6895/hovercard">#6895</a></p>
<h4>The <code>diagnostic(…);</code> directive is now supported in WGSL</h4>
<p>Naga now parses <code>diagnostic(…);</code> directives according to the WGSL spec. This allows users to control certain lints, similar to Rust's <code>allow</code>, <code>warn</code>, and <code>deny</code> attributes. For example, in standard WGSL (but, notably, not Naga yet—see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1962275988" data-permission-text="Title is private" data-url="https://github.com/gfx-rs/wgpu/issues/4369" data-hovercard-type="issue" data-hovercard-url="/gfx-rs/wgpu/issues/4369/hovercard" href="https://github.com/gfx-rs/wgpu/issues/4369">#4369</a>) this snippet would emit a uniformity error:</p>
<div class="highlight highlight-source-wgsl notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@group(0) @binding(0) var s : sampler;
@group(0) @binding(2) var tex : texture_2d<f32>;
@group(1) @binding(0) var<storage, read> ro_buffer : array<f32, 4>;
@fragment
fn main(@builtin(position) p : vec4f) -> @location(0) vec4f {
if ro_buffer[0] == 0 {
// Emits a derivative uniformity error during validation.
return textureSample(tex, s, vec2(0.,0.));
}
return vec4f(0.);
}"><pre>@<span class="pl-en">group</span>(<span class="pl-c1">0</span>) @<span class="pl-en">binding</span>(<span class="pl-c1">0</span>) <span class="pl-k">var</span> <span class="pl-smi">s</span> : <span class="pl-smi">sampler</span>;
@<span class="pl-en">group</span>(<span class="pl-c1">0</span>) @<span class="pl-en">binding</span>(<span class="pl-c1">2</span>) <span class="pl-k">var</span> <span class="pl-smi">tex</span> : <span class="pl-smi">texture_2d</span><<span class="pl-k">f32</span>>;
@<span class="pl-en">group</span>(<span class="pl-c1">1</span>) @<span class="pl-en">binding</span>(<span class="pl-c1">0</span>) <span class="pl-k">var</span><<span class="pl-k">storage</span>, <span class="pl-k">read</span>> <span class="pl-smi">ro_buffer</span> : <span class="pl-k">array</span><<span class="pl-k">f32</span>, <span class="pl-c1">4</span>>;
@<span class="pl-smi">fragment</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span>(@<span class="pl-en">builtin</span>(<span class="pl-smi">position</span>) <span class="pl-smi">p</span> : <span class="pl-smi">vec4f</span>) <span class="pl-k">-></span> @<span class="pl-en">location</span>(<span class="pl-c1">0</span>) <span class="pl-smi">vec4f</span> {
<span class="pl-k">if</span> <span class="pl-smi">ro_buffer</span>[<span class="pl-c1">0</span>] <span class="pl-k">==</span> <span class="pl-c1">0</span> {
<span class="pl-c"> // Emits a derivative uniformity error during validation.</span>
<span class="pl-k">return</span> <span class="pl-en">textureSample</span>(<span class="pl-smi">tex</span>, <span class="pl-smi">s</span>, <span class="pl-en">vec2</span>(<span class="pl-c1">0</span><span class="pl-k">.</span>,<span class="pl-c1">0</span><span class="pl-k">.</span>));
}
<span class="pl-k">return</span> <span class="pl-en">vec4f</span>(<span class="pl-c1">0</span><span class="pl-k">.</span>);
}</pre></div>
<p>…but we can now silence it with the <code>off</code> severity level, like so:</p>
<div class="highlight highlight-source-wgsl notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// Disable the diagnosic with this…
diagnostic(off, derivative_uniformity);
@group(0) @binding(0) var s : sampler;
@group(0) @binding(2) var tex : texture_2d<f32>;
@group(1) @binding(0) var<storage, read> ro_buffer : array<f32, 4>;
@fragment
fn main(@builtin(position) p : vec4f) -> @location(0) vec4f {
if ro_buffer[0] == 0 {
// Look ma, no error!
return textureSample(tex, s, vec2(0.,0.));
}
return vec4f(0.);
}"><pre><span class="pl-c">// Disable the diagnosic with this…</span>
<span class="pl-en">diagnostic</span>(<span class="pl-smi">off</span>, <span class="pl-smi">derivative_uniformity</span>);
@<span class="pl-en">group</span>(<span class="pl-c1">0</span>) @<span class="pl-en">binding</span>(<span class="pl-c1">0</span>) <span class="pl-k">var</span> <span class="pl-smi">s</span> : <span class="pl-smi">sampler</span>;
@<span class="pl-en">group</span>(<span class="pl-c1">0</span>) @<span class="pl-en">binding</span>(<span class="pl-c1">2</span>) <span class="pl-k">var</span> <span class="pl-smi">tex</span> : <span class="pl-smi">texture_2d</span><<span class="pl-k">f32</span>>;
@<span class="pl-en">group</span>(<span class="pl-c1">1</span>) @<span class="pl-en">binding</span>(<span class="pl-c1">0</span>) <span class="pl-k">var</span><<span class="pl-k">storage</span>, <span class="pl-k">read</span>> <span class="pl-smi">ro_buffer</span> : <span class="pl-k">array</span><<span class="pl-k">f32</span>, <span class="pl-c1">4</span>>;
@<span class="pl-smi">fragment</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span>(@<span class="pl-en">builtin</span>(<span class="pl-smi">position</span>) <span class="pl-smi">p</span> : <span class="pl-smi">vec4f</span>) <span class="pl-k">-></span> @<span class="pl-en">location</span>(<span class="pl-c1">0</span>) <span class="pl-smi">vec4f</span> {
<span class="pl-k">if</span> <span class="pl-smi">ro_buffer</span>[<span class="pl-c1">0</span>] <span class="pl-k">==</span> <span class="pl-c1">0</span> {
<span class="pl-c"> // Look ma, no error!</span>
<span class="pl-k">return</span> <span class="pl-en">textureSample</span>(<span class="pl-smi">tex</span>, <span class="pl-smi">s</span>, <span class="pl-en">vec2</span>(<span class="pl-c1">0</span><span class="pl-k">.</span>,<span class="pl-c1">0</span><span class="pl-k">.</span>));
}
<span class="pl-k">return</span> <span class="pl-en">vec4f</span>(<span class="pl-c1">0</span><span class="pl-k">.</span>);
}</pre></div>
<p>There are some limitations to keep in mind with this new functionality:</p>
<ul>
<li>We support <code>@diagnostic(…)</code> rules as <code>fn</code> attributes, but prioritization for rules in statement positions (i.e., <code>if (…) @diagnostic(…) { … }</code> is unclear. If you are blocked by not being able to parse <code>diagnostic(…)</code> rules in statement positions, please let us know in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2161458256" data-permission-text="Title is private" data-url="https://github.com/gfx-rs/wgpu/issues/5320" data-hovercard-type="issue" data-hovercard-url="/gfx-rs/wgpu/issues/5320/hovercard" href="https://github.com/gfx-rs/wgpu/issues/5320">#5320</a>, so we can determine how to prioritize it!</li>
<li>Standard WGSL specifies <code>error</code>, <code>warning</code>, <code>info</code>, and <code>off</code> severity levels. These are all technically usable now! A caveat, though: warning- and info-level are only emitted to <code>stderr</code> via the <code>log</code> façade, rather than being reported through a <code>Result::Err</code> in Naga or the <code>CompilationInfo</code> interface in <code>wgpu{,-core}</code>. This will require breaking changes in Naga to fix, and is being tracked by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2609941827" data-permission-text="Title is private" data-url="https://github.com/gfx-rs/wgpu/issues/6458" data-hovercard-type="issue" data-hovercard-url="/gfx-rs/wgpu/issues/6458/hovercard" href="https://github.com/gfx-rs/wgpu/issues/6458">#6458</a>.</li>
<li>Not all lints can be controlled with <code>diagnostic(…)</code> rules. In fact, only the <code>derivative_uniformity</code> triggering rule exists in the WGSL standard. That said, Naga contributors are excited to see how this level of control unlocks a new ecosystem of configurable diagnostics.</li>
<li>Finally, <code>diagnostic(…)</code> rules are not yet emitted in WGSL output. This means that <code>wgsl-in</code> → <code>wgsl-out</code> is currently a lossy process. We felt that it was important to unblock users who needed <code>diagnostic(…)</code> rules (i.e., <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1419529559" data-permission-text="Title is private" data-url="https://github.com/gfx-rs/wgpu/issues/3135" data-hovercard-type="issue" data-hovercard-url="/gfx-rs/wgpu/issues/3135/hovercard" href="https://github.com/gfx-rs/wgpu/issues/3135">#3135</a>) before we took significant effort to fix this (tracked in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2635818234" data-permission-text="Title is private" data-url="https://github.com/gfx-rs/wgpu/issues/6496" data-hovercard-type="issue" data-hovercard-url="/gfx-rs/wgpu/issues/6496/hovercard" href="https://github.com/gfx-rs/wgpu/issues/6496">#6496</a>).</li>
</ul>
<p>By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6456" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6456/hovercard">#6456</a>, <a href="https://github.com/gfx-rs/wgpu/pull/6148" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6148/hovercard">#6148</a>, <a href="https://github.com/gfx-rs/wgpu/pull/6533" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6533/hovercard">#6533</a>, <a href="https://github.com/gfx-rs/wgpu/pull/6353" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6353/hovercard">#6353</a>, <a href="https://github.com/gfx-rs/wgpu/pull/6537" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6537/hovercard">#6537</a>.</p>
<h4>New Features</h4>
<h5>Naga</h5>
<ul>
<li>Support atomic operations on fields of global structs in the SPIR-V frontend. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/schell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/schell">@schell</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6693" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6693/hovercard">#6693</a>.</li>
<li>Clean up tests for atomic operations support in SPIR-V frontend. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/schell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/schell">@schell</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6692" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6692/hovercard">#6692</a></li>
<li>Fix an issue where <code>naga</code> CLI would incorrectly skip the first positional argument when <code>--stdin-file-path</code> was specified. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6480" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6480/hovercard">#6480</a>.</li>
<li>Fix textureNumLevels in the GLSL backend. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/magcius/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/magcius">@magcius</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6483" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6483/hovercard">#6483</a>.</li>
<li>Support 64-bit hex literals and unary operations in constants <a href="https://github.com/gfx-rs/wgpu/pull/6616" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6616/hovercard">#6616</a>.</li>
<li>Implement <code>quantizeToF16()</code> for WGSL frontend, and WGSL, SPIR-V, HLSL, MSL, and GLSL backends. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jamienicol/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jamienicol">@jamienicol</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6519" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6519/hovercard">#6519</a>.</li>
<li>Add support for GLSL <code>usampler*</code> and <code>isampler*</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/DavidPeicho/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/DavidPeicho">@DavidPeicho</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6513" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6513/hovercard">#6513</a>.</li>
<li>Expose Ray Query flags as constants in WGSL. Implement candidate intersections. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kvark/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kvark">@kvark</a> in <a href="https://github.com/gfx-rs/wgpu/pull/5429" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/5429/hovercard">#5429</a></li>
<li>Add new vertex formats (<code>{U,S}{int,norm}{8,16}</code>, <code>Float16</code> and <code>Unorm8x4Bgra</code>). By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nolanderc/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nolanderc">@nolanderc</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6632" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6632/hovercard">#6632</a></li>
<li>Allow for override-expressions in <code>workgroup_size</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kentslaney/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kentslaney">@kentslaney</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6635" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6635/hovercard">#6635</a>.</li>
<li>Add support for OpAtomicCompareExchange in SPIR-V frontend. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/schell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/schell">@schell</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6590" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6590/hovercard">#6590</a>.</li>
<li>Implement type inference for abstract arguments to user-defined functions. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jamienicol/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jamienicol">@jamienicol</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6577" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6577/hovercard">#6577</a>.</li>
<li>Allow for override-expressions in array sizes. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kentslaney/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kentslaney">@kentslaney</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6654" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6654/hovercard">#6654</a>.</li>
</ul>
<h5>General</h5>
<ul>
<li>Add unified documentation for ray-tracing. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vecvec/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vecvec">@Vecvec</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6747" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6747/hovercard">#6747</a></li>
<li>Return submission index in <code>map_async</code> and <code>on_submitted_work_done</code> to track down completion of async callbacks. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/eliemichel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eliemichel">@eliemichel</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6360" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6360/hovercard">#6360</a>.</li>
<li>Move raytracing alignments into HAL instead of in core. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vecvec/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vecvec">@Vecvec</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6563" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6563/hovercard">#6563</a>.</li>
<li>Allow for statically linking DXC rather than including separate <code>.dll</code> files. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/DouglasDwyer/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/DouglasDwyer">@DouglasDwyer</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6574" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6574/hovercard">#6574</a>.</li>
<li><code>DeviceType</code> and <code>AdapterInfo</code> now impl <code>Hash</code> by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6868" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6868/hovercard">#6868</a></li>
<li>Add build support for Apple Vision Pro. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/guusw/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/guusw">@guusw</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6611" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6611/hovercard">#6611</a>.</li>
<li>Add <code>wgsl_language_features</code> for obtaining available WGSL language feature by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sagudev/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sagudev">@sagudev</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6814" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6814/hovercard">#6814</a></li>
<li>Image atomic support in shaders. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/atlv24/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/atlv24">@atlv24</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6706" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6706/hovercard">#6706</a></li>
<li>64 bit image atomic support in shaders. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/atlv24/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/atlv24">@atlv24</a> in <a href="https://github.com/gfx-rs/wgpu/pull/5537" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/5537/hovercard">#5537</a></li>
<li>Add <code>no_std</code> support to <code>wgpu-types</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bushrat011899/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bushrat011899">@bushrat011899</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6892" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6892/hovercard">#6892</a>.</li>
</ul>
<h5>Vulkan</h5>
<ul>
<li>Allow using some 32-bit floating-point atomic operations (load, store, add, sub, exchange) in shaders. It requires the extension <code>VK_EXT_shader_atomic_float</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/AsherJingkongChen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/AsherJingkongChen">@AsherJingkongChen</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6234" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6234/hovercard">#6234</a>.</li>
</ul>
<h5>Metal</h5>
<ul>
<li>Allow using some 32-bit floating-point atomic operations (load, store, add, sub, exchange) in shaders. It requires Metal 3.0+ with Apple 7, 8, 9 or Mac 2. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/AsherJingkongChen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/AsherJingkongChen">@AsherJingkongChen</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6234" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6234/hovercard">#6234</a>.</li>
<li>Add build support for Apple Vision Pro. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/guusw/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/guusw">@guusw</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6611" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6611/hovercard">#6611</a>.</li>
<li>Add <code>raw_handle</code> method to access raw Metal textures in <a href="https://github.com/gfx-rs/wgpu/pull/6894" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6894/hovercard">#6894</a>.</li>
</ul>
<h4>D3D12</h4>
<ul>
<li>Support DXR (DirectX Ray-tracing) in wgpu-hal. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vecvec/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vecvec">@Vecvec</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6777" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6777/hovercard">#6777</a></li>
</ul>
<h4>Changes</h4>
<h5>Naga</h5>
<ul>
<li>Show types of LHS and RHS in binary operation type mismatch errors. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6450" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6450/hovercard">#6450</a>.</li>
<li>The GLSL parser now uses less expressions for function calls. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/magcius/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/magcius">@magcius</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6604" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6604/hovercard">#6604</a>.</li>
<li>Add a note to help with a common syntax error case for global diagnostic filter directives. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/e-hat/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/e-hat">@e-hat</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6718" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6718/hovercard">#6718</a></li>
<li>Change arithmetic operations between two i32 variables to wrap on overflow to match WGSL spec. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/matthew-wong1/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/matthew-wong1">@matthew-wong1</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6835" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6835/hovercard">#6835</a>.</li>
<li>Add directives to suggestions in error message for parsing global items. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/e-hat/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/e-hat">@e-hat</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6723" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6723/hovercard">#6723</a>.</li>
<li>Automatic conversion for <code>override</code> initializers. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sagudev/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sagudev">@sagudev</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6920" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6920/hovercard">6920</a></li>
</ul>
<h5>General</h5>
<ul>
<li>Align Storage Access enums to the webgpu spec. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/atlv24/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/atlv24">@atlv24</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6642" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6642/hovercard">#6642</a></li>
<li>Make <code>Surface::as_hal</code> take an immutable reference to the surface. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jerzywilczek/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jerzywilczek">@jerzywilczek</a> in <a href="https://github.com/gfx-rs/wgpu/pull/9999">#9999</a></li>
<li>Add actual sample type to <code>CreateBindGroupError::InvalidTextureSampleType</code> error message. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6530" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6530/hovercard">#6530</a>.</li>
<li>Improve binding error to give a clearer message when there is a mismatch between resource binding as it is in the shader and as it is in the binding layout. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/eliemichel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/eliemichel">@eliemichel</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6553" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6553/hovercard">#6553</a>.</li>
<li><code>Surface::configure</code> and <code>Surface::get_current_texture</code> are no longer fatal. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alokedesai/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alokedesai">@alokedesai</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6253" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6253/hovercard">#6253</a></li>
<li>Rename <code>BlasTriangleGeometry::index_buffer_offset</code> to <code>BlasTriangleGeometry::first_index</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vecvec/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vecvec">@Vecvec</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6873/files">#6873</a></li>
</ul>
<h5>D3D12</h5>
<ul>
<li>Avoid using FXC as fallback when the DXC container was passed at instance creation. Paths to <code>dxcompiler.dll</code> & <code>dxil.dll</code> are also now required. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/teoxoy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/teoxoy">@teoxoy</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6643" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6643/hovercard">#6643</a>.</li>
</ul>
<h5>Vulkan</h5>
<ul>
<li>Add a cache for samplers, deduplicating any samplers, allowing more programs to stay within the global sampler limit. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6847" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6847/hovercard">#6847</a></li>
</ul>
<h5>HAL</h5>
<ul>
<li>Replace <code>usage: Range<T></code>, for <code>BufferUses</code>, <code>TextureUses</code>, and <code>AccelerationStructureBarrier</code> with a new <code>StateTransition<T></code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/atlv24/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/atlv24">@atlv24</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6703" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6703/hovercard">#6703</a></li>
<li>Change the <code>DropCallback</code> API to use <code>FnOnce</code> instead of <code>FnMut</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jerzywilczek/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jerzywilczek">@jerzywilczek</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6482" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6482/hovercard">#6482</a></li>
</ul>
<h3>Bug Fixes</h3>
<h4>General</h4>
<ul>
<li>Handle query set creation failure as an internal error that loses the <code>Device</code>, rather than panicking. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6505" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6505/hovercard">#6505</a>.</li>
<li>Ensure that <code>Features::TIMESTAMP_QUERY</code> is set when using timestamp writes in render and compute passes. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6497" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6497/hovercard">#6497</a>.</li>
<li>Check for device mismatches when beginning render and compute passes. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6497" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6497/hovercard">#6497</a>.</li>
<li>Lower <code>QUERY_SET_MAX_QUERIES</code> (and enforced limits) from 8192 to 4096 to match WebGPU spec. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6525" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6525/hovercard">#6525</a>.</li>
<li>Allow non-filterable float on texture bindings never used with samplers when using a derived bind group layout. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6531/" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6531/hovercard">#6531</a>.</li>
<li>Replace potentially unsound usage of <code>PreHashedMap</code> with <code>FastHashMap</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jamienicol/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jamienicol">@jamienicol</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6541" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6541/hovercard">#6541</a>.</li>
<li>Add missing validation for timestamp writes in compute and render passes. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6578" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6578/hovercard">#6578</a>, <a href="https://github.com/gfx-rs/wgpu/pull/6583" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6583/hovercard">#6583</a>.
<ul>
<li>Check the status of the <code>TIMESTAMP_QUERY</code> feature before other validation.</li>
<li>Check that indices are in-bounds for the query set.</li>
<li>Check that begin and end indices are not equal.</li>
<li>Check that at least one index is specified.</li>
</ul>
</li>
<li>Reject destroyed buffers in query set resolution. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6579" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6579/hovercard">#6579</a>.</li>
<li>Fix panic when dropping <code>Device</code> on some environments. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Dinnerbone/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Dinnerbone">@Dinnerbone</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6681" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6681/hovercard">#6681</a>.</li>
<li>Reduced the overhead of command buffer validation. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nical/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nical">@nical</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6721" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6721/hovercard">#6721</a>.</li>
<li>Set index type to NONE in <code>get_acceleration_structure_build_sizes</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vecvec/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vecvec">@Vecvec</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6802" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6802/hovercard">#6802</a>.</li>
<li>Fix <code>wgpu-info</code> not showing dx12 adapters. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Wumpf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Wumpf">@Wumpf</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6844" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6844/hovercard">#6844</a>.</li>
<li>Use <code>transform_buffer_offset</code> when initialising <code>transform_buffer</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vecvec/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vecvec">@Vecvec</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6864" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6864/hovercard">#6864</a>.</li>
</ul>
<h4>Naga</h4>
<ul>
<li>Fix crash when a texture argument is missing. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aedm/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/aedm">@aedm</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6486" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6486/hovercard">#6486</a></li>
<li>Emit an error in constant evaluation, rather than crash, in certain cases where <code>vecN</code> constructors have less than N arguments. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ErichDonGubler/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ErichDonGubler">@ErichDonGubler</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6508" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6508/hovercard">#6508</a>.</li>
<li>Fix an error in template list matching <code>>=</code> in <code>a<b>=c</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kentslaney/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kentslaney">@kentslaney</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6898" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6898/hovercard">#6898</a>.</li>
<li>Correctly validate handles in override-sized array types. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jimblandy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jimblandy">@jimblandy</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6882" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6882/hovercard">#6882</a>.</li>
<li>Clean up validation of <code>Statement::ImageStore</code>. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jimblandy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jimblandy">@jimblandy</a> in <a href="https://github.com/gfx-rs/wgpu-pull/6729">#6729</a>.</li>
<li>In compaction, avoid cloning the type arena. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jimblandy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jimblandy">@jimblandy</a> in <a href="https://github.com/gfx-rs/wgpu-pull/6790">#6790</a></li>
<li>In validation, forbid cycles between global expressions and types. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jimblandy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jimblandy">@jimblandy</a> in <a href="https://github.com/gfx-rs/wgpu-pull/6800">#6800</a></li>
<li>Allow abstract scalars in modf and frexp results. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jimblandy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jimblandy">@jimblandy</a> in <a href="https://github.com/gfx-rs/wgpu-pull/6821">#6821</a></li>
<li>In the WGSL front end, apply automatic conversions to values being assigned. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jimblandy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jimblandy">@jimblandy</a> in <a href="https://github.com/gfx-rs/wgpu-pull/6822">#6822</a></li>
</ul>
<h4>Vulkan</h4>
<ul>
<li>Allocate descriptors for acceleration structures. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Vecvec/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Vecvec">@Vecvec</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6861" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6861/hovercard">#6861</a>.</li>
<li><code>max_color_attachment_bytes_per_sample</code> is now correctly set to 128. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6866" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6866/hovercard">#6866</a></li>
</ul>
<h4>D3D12</h4>
<ul>
<li>Fix no longer showing software rasterizer adapters. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Wumpf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Wumpf">@Wumpf</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6843" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6843/hovercard">#6843</a>.</li>
<li><code>max_color_attachment_bytes_per_sample</code> is now correctly set to 128. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/cwfitzgerald/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cwfitzgerald">@cwfitzgerald</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6866" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6866/hovercard">#6866</a></li>
</ul>
<h3>Examples</h3>
<ul>
<li>Add multiple render targets example. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kaphula/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kaphula">@kaphula</a> in <a href="https://github.com/gfx-rs/wgpu/pull/5313" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/5313/hovercard">#5297</a></li>
</ul>cwfitzgeraldtag:github.com,2008:Repository/148686316/v23.1.02024-12-16T20:19:59Zv23.1.0 (2024-12-16)<p>This release only contains naga <code>v23.1.0</code> all other packages are still at their previous versions.</p>
<h3>New Features</h3>
<h4>Naga</h4>
<ul>
<li>Expose Ray Query flags as constants in WGSL. Implement candidate intersections. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/kvark/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/kvark">@kvark</a> in <a href="https://github.com/gfx-rs/wgpu/pull/5429" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/5429/hovercard">#5429</a></li>
</ul>cwfitzgeraldtag:github.com,2008:Repository/148686316/naga-v23.1.02024-12-16T20:17:23Znaga-v23.1.0No content.cwfitzgeraldtag:github.com,2008:Repository/148686316/wgpu-v23.0.12024-11-25T08:01:18Z23.0.1 (2024-11-25)<p>This release includes patches for <code>wgpu</code>, <code>wgpu-core</code> and <code>wgpu-hal</code>. All other crates remain at <a href="https://github.com/gfx-rs/wgpu/releases/tag/v23.0.0">23.0.0</a>.<br>
Below changes were cherry-picked from 24.0.0 development line.</p>
<h3>Bug fixes</h3>
<h4>General</h4>
<ul>
<li>Fix Texture view leaks regression. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/xiaopengli89/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/xiaopengli89">@xiaopengli89</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6576" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6576/hovercard">#6576</a></li>
</ul>
<h4>Metal</h4>
<ul>
<li>Fix surface creation crashing on iOS. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mockersf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mockersf">@mockersf</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6535" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6535/hovercard">#6535</a></li>
</ul>
<h4>Vulkan</h4>
<ul>
<li>Fix surface capabilities being advertised when its query failed. By <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Wumpf/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Wumpf">@Wumpf</a> in <a href="https://github.com/gfx-rs/wgpu/pull/6510" data-hovercard-type="pull_request" data-hovercard-url="/gfx-rs/wgpu/pull/6510/hovercard">#6510</a></li>
</ul>Wumpftag:github.com,2008:Repository/148686316/wgpu-hal-v23.0.12024-11-25T07:56:00Zwgpu-hal-v23.0.1No content.Wumpf