update to wgpu master to fix M1 shader issues

This commit is contained in:
Anton-4 2022-02-19 14:07:19 +01:00
parent 7548f97221
commit b1245ffd7f
No known key found for this signature in database
GPG key ID: C954D6E0F9C0ABFD
4 changed files with 35 additions and 67 deletions

View file

@ -101,9 +101,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
[[package]] [[package]]
name = "ash" name = "ash"
version = "0.34.0+1.2.203" version = "0.35.1+1.2.203"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0f780da53d0063880d45554306489f09dd8d1bda47688b4a57bc579119356df" checksum = "b7fd04def1c9101b5fb488c131022d2d6f87753ef4b1b11b279e2af404fae6b9"
dependencies = [ dependencies = [
"libloading", "libloading",
] ]
@ -1174,6 +1174,7 @@ checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3"
dependencies = [ dependencies = [
"libc", "libc",
"libloading", "libloading",
"pkg-config",
] ]
[[package]] [[package]]
@ -1296,8 +1297,7 @@ dependencies = [
[[package]] [[package]]
name = "metal" name = "metal"
version = "0.23.1" version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/gfx-rs/metal-rs?rev=44af5cc#44af5cca340617d42d701264f9bf71d1f3e68096"
checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"block", "block",
@ -1367,9 +1367,8 @@ dependencies = [
[[package]] [[package]]
name = "naga" name = "naga"
version = "0.8.5" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/gfx-rs/naga?rev=8e2e39e#8e2e39e4d8fa5bbb657c3b170b4f6607d703e284"
checksum = "3012f2dbcc79e8e0b5825a4836a7106a75dd9b2fe42c528163be0f572538c705"
dependencies = [ dependencies = [
"bit-set", "bit-set",
"bitflags", "bitflags",
@ -2606,8 +2605,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu" name = "wgpu"
version = "0.12.0" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/gfx-rs/wgpu?rev=0545e36#0545e36aa82709cca78c14eb3813f10eea7a9275"
checksum = "b97cd781ff044d6d697b632a2e212032c2e957d1afaa21dbf58069cbb8f78567"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"js-sys", "js-sys",
@ -2626,9 +2624,8 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-core" name = "wgpu-core"
version = "0.12.2" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/gfx-rs/wgpu?rev=0545e36#0545e36aa82709cca78c14eb3813f10eea7a9275"
checksum = "c4688c000eb841ca55f7b35db659b78d6e1cd77d7caf8fb929f4e181f754047d"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -2649,9 +2646,8 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-hal" name = "wgpu-hal"
version = "0.12.4" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/gfx-rs/wgpu?rev=0545e36#0545e36aa82709cca78c14eb3813f10eea7a9275"
checksum = "93b1a9400e8d7f32dd4dd909bb9a391015d70633d639775ddd3f14d1104bc970"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"ash", "ash",
@ -2688,8 +2684,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu-types" name = "wgpu-types"
version = "0.12.0" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/gfx-rs/wgpu?rev=0545e36#0545e36aa82709cca78c14eb3813f10eea7a9275"
checksum = "549533d9e1cdd4b4cda7718d33ff500fc4c34b5467b71d76b547ae0324f3b2a2"
dependencies = [ dependencies = [
"bitflags", "bitflags",
] ]
@ -2697,8 +2692,7 @@ dependencies = [
[[package]] [[package]]
name = "wgpu_glyph" name = "wgpu_glyph"
version = "0.16.0" version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/Anton-4/wgpu_glyph?rev=257d109#257d1098cbafa3c8a0a2465937b06fc730fc6ffb"
checksum = "8134edb15ae465caf308125646c9e98bdef7398cdefc69227ac77a5eb795e7fe"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
"glyph_brush", "glyph_brush",

View file

@ -27,8 +27,8 @@ arrayvec = "0.7.2"
page_size = "0.4.2" page_size = "0.4.2"
# when changing winit version, check if copypasta can be updated simultaneously so they use the same versions for their dependencies. This will save build time. # when changing winit version, check if copypasta can be updated simultaneously so they use the same versions for their dependencies. This will save build time.
winit = "0.26.1" winit = "0.26.1"
wgpu = "0.12.0" wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "0545e36" }
wgpu_glyph = "0.16.0" wgpu_glyph = { git = "https://github.com/Anton-4/wgpu_glyph", rev = "257d109" }
glyph_brush = "0.7.2" glyph_brush = "0.7.2"
log = "0.4.14" log = "0.4.14"
env_logger = "0.9.0" env_logger = "0.9.0"

View file

@ -4,31 +4,35 @@ struct Globals {
ortho: mat4x4<f32>; ortho: mat4x4<f32>;
}; };
[[group(0), binding(0)]] @group(0)
@binding(0)
var<uniform> globals: Globals; var<uniform> globals: Globals;
struct VertexInput { struct VertexInput {
[[location(0)]] position: vec2<f32>; @location(0) position: vec2<f32>;
}; };
struct Quad { struct Quad {
[[location(1)]] position: vec2<f32>; @location(1) position: vec2<f32>;
[[location(2)]] width: f32; @location(2) width: f32;
[[location(3)]] height: f32; @location(3) height: f32;
[[location(4)]] color: vec4<f32>; @location(4) color: vec4<f32>;
[[location(5)]] border_color: vec4<f32>; @location(5) border_color: vec4<f32>;
[[location(6)]] border_width: f32; @location(6) border_width: f32;
}; };
struct VertexOutput { struct VertexOutput {
[[builtin(position)]] position: vec4<f32>; @builtin(position) position: vec4<f32>;
[[location(0)]] color: vec4<f32>; @location(0) color: vec4<f32>;
[[location(1)]] border_color: vec4<f32>; @location(1) border_color: vec4<f32>;
[[location(2)]] border_width: f32; @location(2) border_width: f32;
}; };
[[stage(vertex)]] @stage(vertex)
fn vs_main(input: VertexInput, quad: Quad) -> VertexOutput { fn vs_main(
input: VertexInput,
quad: Quad
) -> VertexOutput {
var transform: mat4x4<f32> = mat4x4<f32>( var transform: mat4x4<f32> = mat4x4<f32>(
vec4<f32>(quad.width, 0.0, 0.0, 0.0), vec4<f32>(quad.width, 0.0, 0.0, 0.0),
@ -48,9 +52,9 @@ fn vs_main(input: VertexInput, quad: Quad) -> VertexOutput {
} }
[[stage(fragment)]] @stage(fragment)
fn fs_main( fn fs_main(
input: VertexOutput input: VertexOutput
) -> [[location(0)]] vec4<f32> { ) -> @location(0) vec4<f32> {
return input.color; return input.color;
} }

View file

@ -1,30 +0,0 @@
struct VertexOutput {
[[location(0)]] color: vec4<f32>;
[[builtin(position)]] position: vec4<f32>;
};
struct Globals {
ortho: mat4x4<f32>; // The ortho transformation keeps everything the same size when the window size is changed.
};
[[group(0), binding(0)]]
var<uniform> u_globals: Globals;
[[stage(vertex)]]
fn vs_main(
[[location(0)]] in_position: vec2<f32>,
[[location(1)]] in_color: vec4<f32>,
) -> VertexOutput {
var out: VertexOutput;
out.position = u_globals.ortho * vec4<f32>(in_position, 0.0, 1.0);
out.color = in_color;
return out;
}
[[stage(fragment)]]
fn fs_main(in: VertexOutput) -> [[location(0)]] vec4<f32> {
return in.color;
}