Skip to content

Commit

Permalink
Merge branch 'trunk' of https://github.com/gfx-rs/wgpu into pr/shader…
Browse files Browse the repository at this point in the history
…-float32-atomic
  • Loading branch information
AsherJingkongChen committed Nov 1, 2024
2 parents 72a0e50 + 16f012b commit 5d6f6c5
Show file tree
Hide file tree
Showing 18 changed files with 454 additions and 199 deletions.
209 changes: 156 additions & 53 deletions CHANGELOG.md

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,27 @@ keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/"
repository = "https://github.com/gfx-rs/wgpu"
version = "22.0.0"
version = "23.0.0"
authors = ["gfx-rs developers"]

[workspace.dependencies.wgc]
package = "wgpu-core"
path = "./wgpu-core"
version = "22.0.0"
version = "23.0.0"

[workspace.dependencies.wgt]
package = "wgpu-types"
path = "./wgpu-types"
version = "22.0.0"
version = "23.0.0"

[workspace.dependencies.hal]
package = "wgpu-hal"
path = "./wgpu-hal"
version = "22.0.0"
version = "23.0.0"

[workspace.dependencies.naga]
path = "./naga"
version = "22.0.0"
version = "23.0.0"

[workspace.dependencies]
anyhow = "1.0.91"
Expand Down Expand Up @@ -126,11 +126,11 @@ static_assertions = "1.1.0"
strum = { version = "0.25.0", features = ["derive"] }
tracy-client = "0.17"
thiserror = "1.0.65"
wgpu = { version = "22.0.0", path = "./wgpu", default-features = false }
wgpu-core = { version = "22.0.0", path = "./wgpu-core" }
wgpu-macros = { version = "22.0.0", path = "./wgpu-macros" }
wgpu-test = { version = "22.0.0", path = "./tests" }
wgpu-types = { version = "22.0.0", path = "./wgpu-types" }
wgpu = { version = "23.0.0", path = "./wgpu", default-features = false }
wgpu-core = { version = "23.0.0", path = "./wgpu-core" }
wgpu-macros = { version = "23.0.0", path = "./wgpu-macros" }
wgpu-test = { version = "23.0.0", path = "./tests" }
wgpu-types = { version = "23.0.0", path = "./wgpu-types" }
winit = { version = "0.29", features = ["android-native-activity"] }

# Metal dependencies
Expand Down
4 changes: 1 addition & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We do a patch releases as needed in the weeks between major releases. Once a new

Anyone can perform most of these steps, except actually publishing the crates.

Currently only @kvark and @cwfitzgerald can publish all crates. @grovesNL can also publish `wgpu` crates. @jimblandy can publish `naga` crates. @msiglreith can publish `d3d12`.
Currently only @kvark and @cwfitzgerald can publish all crates. @grovesNL can also publish `wgpu` crates. @jimblandy can publish `naga` crates.

## Major Release Process

Expand All @@ -24,7 +24,6 @@ Approx 1 Week Before:

Day of Release:
- Update all crates to be the new version. We bump all versions even if there were no changes.
- `d3d12`
- `naga`
- `naga-cli`
- `wgpu-types`
Expand All @@ -38,7 +37,6 @@ Day of Release:
- Checkout `trunk` with the merged PR.
- Publish! These commands can be pasted directly into your terminal in a single command, and they will publish everything.
```bash
cargo publish -p d3d12
cargo publish -p naga
cargo publish -p naga-cli
cargo publish -p wgpu-types
Expand Down
5 changes: 3 additions & 2 deletions naga-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "naga-cli"
version = "22.0.0"
version = "23.0.0"
authors = ["gfx-rs developers"]
edition = "2021"
description = "Shader translation command line tool"
Expand All @@ -23,9 +23,10 @@ codespan-reporting.workspace = true
env_logger.workspace = true
argh.workspace = true
anyhow.workspace = true
log.workspace = true

[dependencies.naga]
version = "22.0.0"
version = "23.0.0"
path = "../naga"
features = [
"compact",
Expand Down
21 changes: 13 additions & 8 deletions naga-cli/src/bin/naga.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ impl fmt::Display for CliError {
impl std::error::Error for CliError {}

fn run() -> anyhow::Result<()> {
env_logger::init();
env_logger::builder()
.filter_level(log::LevelFilter::Info)
.parse_default_env()
.init();

// Parse commandline arguments
let args: Args = argh::from_env();
Expand Down Expand Up @@ -448,13 +451,15 @@ fn run() -> anyhow::Result<()> {
return bulk_validate(args, &params);
}

let (input_path, input) = if let Some(path) = args.files.first() {
let path = Path::new(path);
(path, fs::read(path)?)
} else if let Some(path) = &args.stdin_file_path {
let mut files = args.files.iter();

let (input_path, input) = if let Some(path) = args.stdin_file_path.as_ref() {
let mut input = vec![];
std::io::stdin().lock().read_to_end(&mut input)?;
(Path::new(path), input)
} else if let Some(path) = files.next() {
let path = Path::new(path);
(path, fs::read(path)?)
} else {
return Err(CliError("Input file path is not specified").into());
};
Expand Down Expand Up @@ -489,12 +494,12 @@ fn run() -> anyhow::Result<()> {
}
}

let output_paths = args.files.get(1..).unwrap_or(&[]);
let output_paths = files;

// Decide which capabilities our output formats can support.
let validation_caps =
output_paths
.iter()
.clone()
.fold(naga::valid::Capabilities::all(), |caps, path| {
use naga::valid::Capabilities as C;
let missing = match Path::new(path).extension().and_then(|ex| ex.to_str()) {
Expand Down Expand Up @@ -564,7 +569,7 @@ fn run() -> anyhow::Result<()> {
//
// If the user asked for output, don't stop: some output formats (".txt",
// ".dot", ".bin") can be generated even without a `ModuleInfo`.
if output_paths.is_empty() {
if output_paths.clone().next().is_none() {
if info.is_some() {
println!("Validation successful");
return Ok(());
Expand Down
2 changes: 1 addition & 1 deletion naga/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "naga"
version = "22.0.0"
version = "23.0.0"
authors = ["gfx-rs developers"]
edition = "2021"
description = "Shader translation infrastructure"
Expand Down
2 changes: 1 addition & 1 deletion naga/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ libfuzzer-sys = "0.4"

[target.'cfg(not(any(target_arch = "wasm32", target_os = "ios")))'.dependencies.naga]
path = ".."
version = "22.0.0"
version = "23.0.0"
features = ["arbitrary", "spv-in", "wgsl-in", "glsl-in"]

[[bin]]
Expand Down
18 changes: 9 additions & 9 deletions naga/src/back/spv/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn get_dimension(type_inner: &crate::TypeInner) -> Dimension {
/// types are simply the direct SPIR-V analog of the Naga IR's. But in some
/// cases, the Naga IR and SPIR-V types need to diverge.
///
/// This enum specifies how [`BlockContext::write_expression_pointer`] should
/// This enum specifies how [`BlockContext::write_access_chain`] should
/// choose a SPIR-V result type for the `OpAccessChain` it generates, based on
/// the type of the given Naga IR [`Expression`] it's generating code for.
///
Expand Down Expand Up @@ -68,7 +68,7 @@ enum AccessTypeAdjustment {

/// The results of emitting code for a left-hand-side expression.
///
/// On success, `write_expression_pointer` returns one of these.
/// On success, `write_access_chain` returns one of these.
enum ExpressionPointer {
/// The pointer to the expression's value is available, as the value of the
/// expression with the given id.
Expand Down Expand Up @@ -407,7 +407,7 @@ impl<'w> BlockContext<'w> {
} => {
// Only binding arrays in the `Handle` address space will take
// this path, since we handled the `Pointer` case above.
let result_id = match self.write_expression_pointer(
let result_id = match self.write_access_chain(
expr_handle,
block,
AccessTypeAdjustment::IntroducePointer(
Expand Down Expand Up @@ -498,7 +498,7 @@ impl<'w> BlockContext<'w> {
} => {
// Only binding arrays in the `Handle` address space will take
// this path, since we handled the `Pointer` case above.
let result_id = match self.write_expression_pointer(
let result_id = match self.write_access_chain(
expr_handle,
block,
AccessTypeAdjustment::IntroducePointer(
Expand Down Expand Up @@ -1751,7 +1751,7 @@ impl<'w> BlockContext<'w> {
///
/// On success, the return value is an [`ExpressionPointer`] value; see the
/// documentation for that type.
fn write_expression_pointer(
fn write_access_chain(
&mut self,
mut expr_handle: Handle<crate::Expression>,
block: &mut Block,
Expand Down Expand Up @@ -1982,7 +1982,7 @@ impl<'w> BlockContext<'w> {
access_type_adjustment: AccessTypeAdjustment,
result_type_id: Word,
) -> Result<Word, Error> {
match self.write_expression_pointer(pointer, block, access_type_adjustment)? {
match self.write_access_chain(pointer, block, access_type_adjustment)? {
ExpressionPointer::Ready { pointer_id } => {
let id = self.gen_id();
let atomic_space =
Expand Down Expand Up @@ -2603,7 +2603,7 @@ impl<'w> BlockContext<'w> {
}
Statement::Store { pointer, value } => {
let value_id = self.cached[value];
match self.write_expression_pointer(
match self.write_access_chain(
pointer,
&mut block,
AccessTypeAdjustment::None,
Expand Down Expand Up @@ -2703,7 +2703,7 @@ impl<'w> BlockContext<'w> {
self.cached[result] = id;
}

let pointer_id = match self.write_expression_pointer(
let pointer_id = match self.write_access_chain(
pointer,
&mut block,
AccessTypeAdjustment::None,
Expand Down Expand Up @@ -2923,7 +2923,7 @@ impl<'w> BlockContext<'w> {
.write_barrier(crate::Barrier::WORK_GROUP, &mut block);
let result_type_id = self.get_expression_type_id(&self.fun_info[result].ty);
// Embed the body of
match self.write_expression_pointer(
match self.write_access_chain(
pointer,
&mut block,
AccessTypeAdjustment::None,
Expand Down
Loading

0 comments on commit 5d6f6c5

Please sign in to comment.