Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Bottom level categories:

#### 'wgpu::Instance::enumerate_adapters` is now `async` & available on WebGPU

Making `enumerate_adapters` async allows custom backends to use it along with elimnating some native/non-native distinctions
Making `enumerate_adapters` async allows custom backends to use it along with eliminating some native/non-native distinctions

This is a breaking change

Expand All @@ -54,6 +54,12 @@ This is a breaking change

By @R-Cramer4 in [#8230](https://github.com/gfx-rs/wgpu/pull/8230)

### Changes

#### naga

- The SPIR-V frontend implements OpSpecConstantOp. By @hasenbanck in [8308](https://github.com/gfx-rs/wgpu/pull/8308).

## v27.0.2 (2025-10-03)

### Bug Fixes
Expand Down
17 changes: 15 additions & 2 deletions naga/src/front/spv/error.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use alloc::borrow::Cow;
use alloc::{
format,
string::{String, ToString},
};

use codespan_reporting::diagnostic::Diagnostic;
use codespan_reporting::files::SimpleFile;
use codespan_reporting::term;
Expand All @@ -14,6 +14,8 @@ use crate::{
front::atomic_upgrade,
};

use crate::proc::ConstantEvaluatorError;

#[derive(Clone, Debug, thiserror::Error)]
pub enum Error {
#[error("invalid header")]
Expand All @@ -26,6 +28,12 @@ pub enum Error {
UnknownCapability(spirv::Word),
#[error("unsupported instruction {1:?} at {0:?}")]
UnsupportedInstruction(ModuleState, spirv::Op),
#[error("unsupported opcode in specialization constant operation {0:?}")]
UnsupportedSpecConstantOp(spirv::Op),
#[error("invalid opcode in specialization constant operation {0:?}")]
InvalidSpecConstantOp(spirv::Op),
#[error("{0}")]
SemanticError(Cow<'static, str>),
#[error("unsupported capability {0:?}")]
UnsupportedCapability(spirv::Capability),
#[error("unsupported extension {0}")]
Expand Down Expand Up @@ -151,11 +159,16 @@ pub enum Error {
NonBindingArrayOfImageOrSamplers,
#[error("naga only supports specialization constant IDs up to 65535 but was given {0}")]
SpecIdTooHigh(u32),

#[error("atomic upgrade error: {0}")]
AtomicUpgradeError(atomic_upgrade::Error),
}

impl From<ConstantEvaluatorError> for Error {
fn from(err: ConstantEvaluatorError) -> Self {
Error::SemanticError(err.to_string().into())
}
}

impl Error {
pub fn emit_to_writer(&self, writer: &mut impl ErrorWrite, source: &str) {
self.emit_to_writer_with_path(writer, source, "glsl");
Expand Down
Loading