Skip to content

Commit 04eaa66

Browse files
authored
Merge branch 'trunk' into naga-ray-tracing-pipelines
2 parents c72f643 + ed6b789 commit 04eaa66

File tree

38 files changed

+221
-106
lines changed

38 files changed

+221
-106
lines changed

.github/actions/install-mesa/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ inputs:
44
# Sourced from https://archive.mesa3d.org/. Bumping this requires
55
# updating the mesa build in https://github.com/gfx-rs/ci-build and creating a new release.
66
version:
7-
default: "25.2.6"
7+
default: "25.2.7"
88
# Corresponds to https://github.com/gfx-rs/ci-build/releases
99
ci-binary-build:
10-
default: "build25"
10+
default: "build26"
1111
runs:
1212
using: "composite"
1313
steps:

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,30 @@ One other breaking change worth noting is that in WGSL `@builtin(view_index)` no
106106

107107
By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206).
108108

109+
#### Error Scopes are now thread-local
110+
111+
Device error scopes now operate on a per-thread basis. This allows them to be used easily within multithreaded contexts,
112+
without having the error scope capture errors from other threads.
113+
114+
When the `std` feature is **not** enabled, we have no way to differentiate between threads, so error scopes return to be
115+
global operations.
116+
117+
By @cwfitzgerald in [#8685](https://github.com/gfx-rs/wgpu/pull/8685)
118+
119+
#### Log Levels
120+
121+
We have received complaints about wgpu being way too log spammy at log levels `info`/`warn`/`error`. We have
122+
adjusted our log policy and changed logging such that `info` and above should be silent unless some exceptional
123+
event happens. Our new log policy is as follows:
124+
125+
- Error: if we can’t (for some reason, usually a bug) communicate an error any other way.
126+
- Warning: similar, but there may be one-shot warnings about almost certainly sub-optimal.
127+
- Info: do not use
128+
- Debug: Used for interesting events happening inside wgpu.
129+
- Trace: Used for all events that might be useful to either `wgpu` or application developers.
130+
131+
By @cwfitzgerald in [#8579](https://github.com/gfx-rs/wgpu/pull/8579).
132+
109133
### New Features
110134

111135
- Added support for transient textures on Vulkan and Metal. By @opstic in [#8247](https://github.com/gfx-rs/wgpu/pull/8247)
@@ -117,7 +141,6 @@ By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206
117141
#### General
118142

119143
- Require new enable extensions when using ray queries and position fetch (`wgpu_ray_query`, `wgpu_ray_query_vertex_return`). By @Vecvec in [#8545](https://github.com/gfx-rs/wgpu/pull/8545).
120-
- Lower `max_blas_primitive_count` due to a bug in llvmpipe. By @Vecvec in [#8446](https://github.com/gfx-rs/wgpu/pull/8446).
121144
- Texture now has `from_custom`. By @R-Cramer4 in [#8315](https://github.com/gfx-rs/wgpu/pull/8315).
122145
- Using both the wgpu command encoding APIs and `CommandEncoder::as_hal_mut` on the same encoder will now result in a panic.
123146
- Allow `include_spirv!` and `include_spirv_raw!` macros to be used in constants and statics. By @clarfonthey in [#8250](https://github.com/gfx-rs/wgpu/pull/8250).

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ authors = ["gfx-rs developers"]
6868
naga = { version = "27.0.0", path = "./naga" }
6969
naga-test = { path = "./naga-test" }
7070
wgpu = { version = "27.0.0", path = "./wgpu", default-features = false, features = [
71+
"std",
7172
"serde",
7273
"wgsl",
7374
"vulkan",

benches/benches/wgpu-benchmark/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#[cfg_attr(target_arch = "wasm32", no_main)]
2-
#[cfg(not(target_arch = "wasm32"))]
1+
#![cfg_attr(target_arch = "wasm32", no_main)]
2+
#![cfg(not(target_arch = "wasm32"))]
33
use pollster::block_on;
44
use wgpu_benchmark::Benchmark;
55

examples/features/src/framework.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,11 @@ fn init_logger() {
6060
let query_level: Option<log::LevelFilter> = parse_url_query_string(&query_string, "RUST_LOG")
6161
.and_then(|x| x.parse().ok());
6262

63-
// We keep wgpu at Error level, as it's very noisy.
6463
let base_level = query_level.unwrap_or(log::LevelFilter::Info);
65-
let wgpu_level = query_level.unwrap_or(log::LevelFilter::Error);
6664

6765
// On web, we use fern, as console_log doesn't have filtering on a per-module level.
6866
fern::Dispatch::new()
6967
.level(base_level)
70-
.level_for("wgpu_core", wgpu_level)
71-
.level_for("wgpu_hal", wgpu_level)
72-
.level_for("naga", wgpu_level)
7368
.chain(fern::Output::call(console_log::log))
7469
.apply()
7570
.unwrap();
@@ -79,10 +74,6 @@ fn init_logger() {
7974
// of these default filters.
8075
env_logger::builder()
8176
.filter_level(log::LevelFilter::Info)
82-
// We keep wgpu at Error level, as it's very noisy.
83-
.filter_module("wgpu_core", log::LevelFilter::Info)
84-
.filter_module("wgpu_hal", log::LevelFilter::Error)
85-
.filter_module("naga", log::LevelFilter::Error)
8677
.parse_default_env()
8778
.init();
8879
}

naga/src/back/hlsl/writer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
441441
_ => false,
442442
})
443443
{
444-
log::info!(
444+
log::debug!(
445445
"Skipping function {:?} (name {:?}) because global {:?} is inaccessible",
446446
handle,
447447
function.name,
@@ -945,7 +945,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
945945

946946
if let Some(ref binding) = global.binding {
947947
if let Err(err) = self.options.resolve_resource_binding(binding) {
948-
log::info!(
948+
log::debug!(
949949
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
950950
handle,
951951
global.name,
@@ -1190,7 +1190,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
11901190
{
11911191
Ok(bindings) => bindings,
11921192
Err(err) => {
1193-
log::info!(
1193+
log::debug!(
11941194
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
11951195
handle,
11961196
global.name,

naga/src/back/spv/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2684,7 +2684,7 @@ impl Writer {
26842684
// because the entry point and its callees didn't use them,
26852685
// then we must skip it.
26862686
if !ep_info.dominates_global_use(info) {
2687-
log::info!("Skip function {:?}", ir_function.name);
2687+
log::debug!("Skip function {:?}", ir_function.name);
26882688
continue;
26892689
}
26902690

naga/src/front/glsl/builtins.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ impl MacroCall {
16691669
num_args += 1;
16701670

16711671
if shadow {
1672-
log::warn!("Assuming LOD {:?} is zero", args[2],);
1672+
log::debug!("Assuming LOD {:?} is zero", args[2],);
16731673

16741674
SampleLevel::Zero
16751675
} else {
@@ -1681,7 +1681,7 @@ impl MacroCall {
16811681
num_args += 2;
16821682

16831683
if shadow {
1684-
log::warn!(
1684+
log::debug!(
16851685
"Assuming gradients {:?} and {:?} are not greater than 1",
16861686
args[2],
16871687
args[3],

naga/src/front/spv/mod.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,15 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
799799
dec.specialization_constant_id = Some(self.next()?);
800800
}
801801
other => {
802-
log::warn!("Unknown decoration {other:?}");
802+
let level = match other {
803+
// Block decorations show up everywhere and we don't
804+
// really care about them, so to prevent log spam
805+
// we demote them to debug level.
806+
spirv::Decoration::Block => log::Level::Debug,
807+
_ => log::Level::Warn,
808+
};
809+
810+
log::log!(level, "Unknown decoration {other:?}");
803811
for _ in base_words + 1..inst.wc {
804812
let _var = self.next()?;
805813
}
@@ -4747,7 +4755,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
47474755
let generator = self.next()?;
47484756
let _bound = self.next()?;
47494757
let _schema = self.next()?;
4750-
log::info!("Generated by {generator} version {version_raw:x}");
4758+
log::debug!("Generated by {generator} version {version_raw:x}");
47514759
crate::Module::default()
47524760
};
47534761

@@ -4817,7 +4825,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
48174825
}
48184826

48194827
if !self.upgrade_atomics.is_empty() {
4820-
log::info!("Upgrading atomic pointers...");
4828+
log::debug!("Upgrading atomic pointers...");
48214829
module.upgrade_atomics(&self.upgrade_atomics)?;
48224830
}
48234831

@@ -4827,7 +4835,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
48274835
self.process_entry_point(&mut module, ep, fun_id)?;
48284836
}
48294837

4830-
log::info!("Patching...");
4838+
log::debug!("Patching...");
48314839
{
48324840
let mut nodes = petgraph::algo::toposort(&self.function_call_graph, None)
48334841
.map_err(|cycle| Error::FunctionCallCycle(cycle.node_id()))?;
@@ -4867,11 +4875,11 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
48674875
}
48684876

48694877
if !self.future_decor.is_empty() {
4870-
log::warn!("Unused item decorations: {:?}", self.future_decor);
4878+
log::debug!("Unused item decorations: {:?}", self.future_decor);
48714879
self.future_decor.clear();
48724880
}
48734881
if !self.future_member_decor.is_empty() {
4874-
log::warn!("Unused member decorations: {:?}", self.future_member_decor);
4882+
log::debug!("Unused member decorations: {:?}", self.future_member_decor);
48754883
self.future_member_decor.clear();
48764884
}
48774885

0 commit comments

Comments
 (0)