860: Update naga and fix type widths r=mechanical a=kvark
**Connections**
Related to https://github.com/gfx-rs/naga/pull/98
**Description**
Naga's "width" has type `Bytes`, so we should treat it as such.
**Testing**
How did it use to work? Oh right, it didn't.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
493: Use BCn textures if possible in skybox example r=kvark a=cwfitzgerald
This converts the skybox to using compressed textures if available. I have designed the code to be extensible to other compressed formats as they are added.
Additionally I added srgb to the texture types, as we were using a srgb framebuffer without properly converting into linear on the texture reads.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
855: Fix multi-layer copies r=kvark a=cwfitzgerald
**Description**
When copying multiple layers at the same time, we ignored
**Testing**
Tested on the skybox example with BC1 textures doing all layer copies.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
492: Replace NonZeroU32 with u32 in TextureViewDescriptor r=kvark a=kunalmohan
Includes https://github.com/gfx-rs/wgpu/pull/854
(rustfmt seems to have introduced a number of other changes. I can revert them if they are undesired)
r?@kvark
Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
854: Replace NonZeroU32 with u32 in TextureViewDescriptor r=kvark a=kunalmohan
**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_
**Description**
_Describe what problem this is solving, and how it's solved._
**Testing**
_Explain how this change is tested._
Not yet tested
<!--
Non-trivial functional changes would need to be tested through:
- [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
- [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.
Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->
r?@kvark
Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
853: Implement TEXTURE_COMPRESSION_BC extension r=kvark a=cwfitzgerald
**Connections**
Closes#852.
**Description**
Adds support for BCn textures as specified in the upstream issue. This also shores up the validation and copy logic to work well with the block oriented nature of compressed textures. ETC2 and ASTC should fall out of this easily.
**Testing**
No wgpu-rs changes were needed, however I tested it with the following changes in wgpu-rs: 96c05ef4bf.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
482: Add label parameter to `create_buffer_with_data` r=kvark a=OptimisticPeach
Improves QOL by allowing you to attach a label to a buffer when created with predetermined data:
```
let uniform_buf = device.create_buffer_with_data(
bytemuck::cast_slice(my_data),
wgpu::BufferUsage::UNIFORM,
Some(Cow::Borrowed("My Uniforms")),
);
```
Co-authored-by: OptimisticPeach <patrikbuhring@yahoo.com>
845: Finish error model refactor r=kvark a=GabrielMajeri
**Connections**
I think this is the last part of #638. I've reviewed all the remaining `unwrap`s and `assert`s in the code, and these should be the last ones left which ought to return errors (the remaining ones seem to uphold internal invariants).
**Description**
Implements error handling for various conditions, which are then returned to the caller. Including, but not limited to:
- running out of memory when creating a command pool
- running out of memory when creating a frame buffer for a render pass
- invalid dimensions when creating a texture
**Testing**
Tested with core and player.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
844: Add mip level count and array layer count validation to texture_create_view r=kvark a=kunalmohan
**Connections**
_Link to the issues addressed by this PR, or dependent PRs in other repositories_
**Description**
_Describe what problem this is solving, and how it's solved._
Catches the error when `mip_level_count = 0` and `base_mip_level > texture.mip_level_count` (same with `array_layer_count`)
**Testing**
_Explain how this change is tested._
Haven't been tested yet
<!--
Non-trivial functional changes would need to be tested through:
- [wgpu-rs](https://github.com/gfx-rs/wgpu-rs) - test the examples.
- [wgpu-native](https://github.com/gfx-rs/wgpu-native/) - check the generated C header for sanity.
Ideally, a PR needs to link to the draft PRs in these projects with relevant modifications.
See https://github.com/gfx-rs/wgpu/pull/666 for an example.
If you can add a unit/integration test here in `wgpu`, that would be best.
-->
Co-authored-by: Kunal Mohan <kunalmohan99@gmail.com>
484: Enable features in CI to prevent compiler errors r=kvark a=cwfitzgerald
Simple change, this also builds features in CI.
I added trace and replay features to wasm, even though wasm doesn't support tracing as is, because people may enable them to get serde support for wgpu-types stuff.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
846: Make level and layer count for texture view optional r=cwfitzgerald a=kvark
**Connections**
implements https://github.com/gpuweb/gpuweb/pull/945
**Description**
`NonZeroU32` is more idiomatic here
**Testing**
untested, but should work
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
* [glsl-new] Add initial handling of stmts and exprs
* [glsl-new] use &'static str for NotImplemented msg
* [glsl-new] Don't lazy create function context
841: Safe error handling for queue module r=kvark a=GabrielMajeri
**Connections**
Part of #638
**Description**
Adds error types for the `queue.rs` module. The out-of-memory conditions are reported upwards, other internal `gfx-hal` errors are unwrapped.
**Testing**
Tested with core and player.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
835: Convert all logging to tracing and add fmt logger r=kvark a=cwfitzgerald
**Connections**
#289 ish.
**Description**
This converts us fully to tracing, allowing traces to show up in logs.
https://github.com/gfx-rs/wgpu-rs/pull/476 should be considered at the same time as this PR.
**Testing**
Ran examples in wgpu-rs.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
481: Remove screenshots from README r=grovesNL a=kvark
Screenshots cover a ton of space, and now we have a dedicated hosted gallery for them.
I'm open to the idea of having *some* smaller screenshots here. It's just difficult to draw the line. Maybe README should show a few screenshots of examples only, and the gallery would not have them?
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>