Skip to content

Commit caf0552

Browse files
committed
Fix recursion limits with next solver
1 parent 4fe6176 commit caf0552

4 files changed

Lines changed: 22 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Bottom level categories:
8080

8181
- Zero-initialize padding (if any) at the end of a buffer allocation. This was application-visible in rare cases on Vulkan when a shader read beyond the valid range of a vertex buffer. By @andyleiserson in [#9791](https://github.com/gfx-rs/wgpu/pull/9791).
8282
- Fix required immediate slots calculation and remove `naga::valid::FunctionInfo::immediate_slots_used`. By @beicause in [#9725](https://github.com/gfx-rs/wgpu/pull/9725).
83+
- Fix recursion limits with next solver. By @nazar-pc in [#9953](https://github.com/gfx-rs/wgpu/pull/9953)
8384

8485
#### naga
8586

@@ -1476,7 +1477,7 @@ By @wumpf in [#8282](https://github.com/gfx-rs/wgpu/pull/8282), [#8285](https://
14761477
- naga now requires that no type be larger than 1 GB. This limit may be lowered in the future; feedback on an appropriate value for the limit is welcome. By @andyleiserson in [#7950](https://github.com/gfx-rs/wgpu/pull/7950).
14771478
- If the shader source contains control characters, naga now replaces them with U+FFFD ("replacement character") in diagnostic output. By @andyleiserson in [#8049](https://github.com/gfx-rs/wgpu/pull/8049).
14781479
- Add f16 IO polyfill on Vulkan backend to enable SHADER_F16 use without requiring `storageInputOutput16`. By @cryvosh in [#7884](https://github.com/gfx-rs/wgpu/pull/7884).
1479-
- For custom Naga backend authors: `naga::proc::Namer` now accepts reserved keywords using two new dedicated types, `proc::{KeywordSet, CaseInsensitiveKeywordSet}`. By @kpreid in [#8136](https://github.com/gfx-rs/wgpu/pull/8136).
1480+
- For custom Naga backend authors: `naga::proc::Namer` now accepts reserved keywords using two new dedicated types, `proc::{KeywordSet, CaseInsensitiveKeywordSet}`. By @kpreid in [#8136](https://github.com/gfx-rs/wgpu/pull/8136).
14801481
- **BREAKING**: Previously the WGSL storage-texture format `rg11b10float` was incorrectly accepted and generated by naga, but now only accepts the the correct name `rg11b10ufloat` instead. By @ErikWDev in [#8219](https://github.com/gfx-rs/wgpu/pull/8219).
14811482
- The [`source()`](https://doc.rust-lang.org/std/error/trait.Error.html#method.source) method of `ShaderError` no longer reports the error as its own source. By @andyleiserson in [#8258](https://github.com/gfx-rs/wgpu/pull/8258).
14821483
- naga correctly ingests SPIR-V that use descriptor runtime indexing, which in turn is correctly converted into WGSLs binding array. By @hasenbanck in [8256](https://github.com/gfx-rs/wgpu/pull/8256).

wgpu-core/src/global.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ pub struct Global {
4040
pub instance: Instance,
4141
}
4242

43+
#[cfg(send_sync)]
44+
const _: () = {
45+
// SAFETY: Bounds checked below
46+
unsafe impl Send for Global {}
47+
// SAFETY: Bounds checked below
48+
unsafe impl Sync for Global {}
49+
50+
fn _check_bound<T: Send + Sync>(_: &T) {}
51+
fn _validate_fields(global: &Global) {
52+
let Global {
53+
surfaces,
54+
hub,
55+
instance,
56+
} = global;
57+
_check_bound(surfaces);
58+
_check_bound(hub);
59+
_check_bound(instance);
60+
}
61+
};
62+
4363
impl Global {
4464
pub fn new(
4565
name: &str,
@@ -299,9 +319,3 @@ impl Drop for Global {
299319
resource_log!("Global::drop");
300320
}
301321
}
302-
303-
#[cfg(send_sync)]
304-
fn _test_send_sync(global: &Global) {
305-
fn test_internal<T: Send + Sync>(_: T) {}
306-
test_internal(global)
307-
}

wgpu-core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
//!
88
99
#![no_std]
10-
// `-Znext-solver` requires deeper recursion limits (at least for now) to prove Send/Sync
11-
#![recursion_limit = "256"]
1210
// When we have no backends, we end up with a lot of dead or otherwise unreachable code.
1311
#![cfg_attr(
1412
all(

wgpu/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@
216216
//!
217217
218218
#![no_std]
219-
// `-Znext-solver` requires deeper recursion limits (at least for now) to prove Send/Sync
220-
#![recursion_limit = "256"]
221219
#![cfg_attr(docsrs, feature(doc_cfg))]
222220
#![doc(html_logo_url = "https://raw.githubusercontent.com/gfx-rs/wgpu/trunk/logo.png")]
223221
#![warn(

0 commit comments

Comments
 (0)