Skip to content

Commit

Permalink
use custom ser/de impl for TextureFormat (#2908)
Browse files Browse the repository at this point in the history
Co-authored-by: Alphyr <[email protected]>
  • Loading branch information
crowlKats and a1phyr authored Sep 29, 2022
1 parent c927e81 commit 26f2239
Show file tree
Hide file tree
Showing 8 changed files with 841 additions and 87 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion player/tests/data/clear-buffer-texture.ron
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
mip_level_count: 1,
sample_count: 1,
dimension: r#2d,
format: rgba8unorm,
format: "rgba8unorm",
usage: 27,
)),
// First fill the texture to ensure it wasn't just zero initialized or "happened" to be zero.
Expand Down
6 changes: 3 additions & 3 deletions player/tests/data/quad.ron
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
mip_level_count: 1,
sample_count: 1,
dimension: r#2d,
format: rgba8unorm,
format: "rgba8unorm",
usage: 27,
)),
CreateTextureView(
Expand Down Expand Up @@ -67,7 +67,7 @@
),
targets: [
Some((
format: rgba8unorm,
format: "rgba8unorm",
)),
],
)),
Expand Down Expand Up @@ -129,4 +129,4 @@
),
]),
],
)
)
8 changes: 4 additions & 4 deletions player/tests/data/zero-init-texture-binding.ron
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
mip_level_count: 1,
sample_count: 1,
dimension: r#2d,
format: rgba8unorm,
format: "rgba8unorm",
usage: 5, // SAMPLED + COPY_SRC
)),
CreateTextureView(
Expand All @@ -52,7 +52,7 @@
mip_level_count: 1,
sample_count: 1,
dimension: r#2d,
format: rgba8unorm,
format: "rgba8unorm",
usage: 9, // STORAGE + COPY_SRC
)),
CreateTextureView(
Expand Down Expand Up @@ -89,7 +89,7 @@
visibility: 4, // COMPUTE
ty: StorageTexture (
access: r#write-only,
format: rgba8unorm,
format: "rgba8unorm",
view_dimension: r#2d,
),
count: None,
Expand Down Expand Up @@ -194,4 +194,4 @@
),
]),
],
)
)
4 changes: 2 additions & 2 deletions player/tests/data/zero-init-texture-copytobuffer.ron
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
mip_level_count: 1,
sample_count: 1,
dimension: r#2d,
format: rgba8unorm,
format: "rgba8unorm",
usage: 1, // COPY_SRC
)),
CreateBuffer(
Expand Down Expand Up @@ -53,4 +53,4 @@
),
]),
],
)
)
4 changes: 2 additions & 2 deletions player/tests/data/zero-init-texture-rendertarget.ron
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
mip_level_count: 1,
sample_count: 1,
dimension: r#2d,
format: rgba8unorm,
format: "rgba8unorm",
usage: 17, // RENDER_ATTACHMENT + COPY_SRC
)),
CreateTextureView(
Expand Down Expand Up @@ -82,4 +82,4 @@
),
]),
],
)
)
3 changes: 3 additions & 0 deletions wgpu-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ replay = ["serde", "bitflags_serde_shim"]
bitflags = "1.0"
serde = { version = "1.0", features = ["serde_derive"], optional = true }
bitflags_serde_shim = { version = "0.2", optional = true }

[dev-dependencies]
serde_json = "1.0.85"
Loading

0 comments on commit 26f2239

Please sign in to comment.