This means that usage of a `StagingBelt` only requires passing along
the current `CommandEncoder` instead of both the encoder and the device.
It also makes the API reflect the fact that a `StagingBelt` cannot be
reused with a fresh device.
As far as I know, the only reason this was not done previously was that
`Device` was not clonable, and so doing this would have required an
`Arc<Device>` or other specific mechanism.
The plumbing to get it out of `wgpu_core` is awkward but I didn’t see
a clearly better option. I think it would make sense to have something
like `Global::get_label<T>(id: Id<T>) -> String` but that looks like a
lot more work.
* Add documentation that every `allocate()` or `write_buffer()`
operation must have a size that is a multiple of 4.
* Add assertions for those properties (this gives more helpful panics
than leaving it to validation).
* Add a randomized test to exercise usage of StagingBelt.
I was concerned that `StagingBelt` might have an alignment math bug;
having written this test, I am much less concerned. There was previously
no test for `StagingBelt` at all, if you don’t count examples/skybox.
* Removed unnecessary dependency in `wgpu` on `hashbrown`.
* Removed unused dependencies in `naga-test`.
* Moved some dependencies in `wgpu-test` to `[dev-dependencies]`
(see comment for why this is worth doing).
Candidates were discovered by `cargo clippy -- -Wunused-crate-dependencies`.
This command reports whether each dependency is unused in each *crate*,
so it has false positives when a dependency is used by only some crates
in a package, but it is still useful as a short-list.
* Features and draw commands added
* Tried to implement the pipeline creation (completely untested)
* Fixed clippy issues
* Fixed something I think
* A little bit of work on the mesh shader example (currently doesn't work on dx12)
* Reached a new kind of error state
* Fixed an alignment issue
* DirectX 12 mesh shaders working :party:
* Removed stupid change and updated changelog
* Fixed typo
* Added backends option to example framework
* Removed silly no write fragment shader from tests to see if anything breaks
* Tried to make mesh shader tests run elsewhere too
* Removed printlns and checked that dx12 mesh shader tests run
* Documented very strange issue
* I'm so lost
* Fixed stupid typos
* Fixed all issues
* Removed unnecessary example stuff, updated tests
* Updated typos.toml
* Updated limits
* Apply suggestion from @cwfitzgerald
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Apply suggestion from @cwfitzgerald
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Removed supported backends, made example & tests always pass the filename to shader compilers
* Removed excessive bools in test params
* Added new tests to the list
* I'm a sinner for this one (unused import)
* Replaced random stuff with test params hashing
* Updated typos.toml
* Updated -Fo typo thing
* Actually fixed typo issue this time
* Update CHANGELOG.md
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Update tests/tests/wgpu-gpu/mesh_shader/mod.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update wgpu-hal/src/dx12/mod.rs
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
* Addressed comments
* Lmao
---------
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
TransferError now has separate variants for texture copy formats that
are only forbidden in combination with specific aspects
(CopyFrom/ToForbiddenTextureFormatAspect), and texture copy formats that
are always forbidden, irrespective of the aspect
(CopyFrom/ToForbiddenTextureFormat).
This produces a less confusing error message by not mentioning the
aspect it is not relevant.
P010 is a 4:2:0 chroma subsampled planar format, similar to NV12. Each
component uses 16 bits of storage, of which only the high 10 bits are
used. On DX12 this maps to DXGI_FORMAT_P010, and on Vulkan this maps to
G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16.
The existing "nv12" gpu test module has been renamed to
"planar_texture", and a new test P010_TEXTURE_CREATION_SAMPLING has
been added similar to the existing NV12_TEXTURE_CREATION_SAMPLING. The
remaining tests in this module have been converted to validation tests,
and now test both NV12 and P010 formats.
These tests cover the external texture binding resource. They ensure
the WGSL functions `textureDimensions()`, `textureLoad()`, and
`textureSampleBaseClampToEdge()` work as expected for both
`TextureView`s and `ExternalTexture`s bound to external texture
resource bindings.
For external textures, they ensure multiplanar YUV formats work as
expected including handling color space transformation. And that the
provided sample and load transforms correctly handle cropping,
flipping, and rotation.
These existing tests cover `Queue::copy_external_image_to_texture()`
which, despite the similar name, is unrelated to the external texture
binding resource.
The following patch is going to add some tests for the latter, so we
are taking this opportunity to rename the former to help avoid
confusion.
This adds several fields to `ExternalTextureDescriptor`, specifying
how to handle color space conversion for an external texture. These
fields consist of transfer functions for the source and destination
color spaces, and a matrix for converting between gamuts. This allows
`ImageSample` and `ImageLoad` operations on external textures to
return values in a desired destination color space rather than the
source color space of the underlying planes.
These fields are plumbed through to the `ExternalTextureParams`
uniform buffer from which they are exposed to the shader. Following
conversion from YUV to RGB after sampling/loading from the external
texture planes, the shader uses them to gamma decode to linear RGB in
the source color space, convert from source to destination gamut, then
finally gamma encode to non-linear RGB in the destination color space.