540: Improve and fix examples/texture-arrays r=cwfitzgerald a=im-0
Original examples/texture-arrays produces following output on my machine (Linux, Mesa/RADV 20.2-rc3, Radeon VII):

Quick investigation showed that only shaders with non-uniform indexing are problematic (first commit helped with this). Then, after searching on the web, I figured out that the problem is in missing `nonuniformEXT`. Second commit fixes this.
I am new to graphics programming, and `nonuniformEXT` may work just by accident. So please confirm my finding before merging.
Co-authored-by: Ivan Mironov <mironov.ivan@gmail.com>
545: Remove bake.frag from shadow example r=kvark a=yutannihilation
Now that `fragment_stage` is a `Option`, I guess this is the case when we don't need fragment shader.
Co-authored-by: Hiroaki Yutani <yutani.ini@gmail.com>
* The conditional at the start of resize() already tests for and exits on the zero width and height condition.
The conditional removed here was then getting run on every other call to resize(), which doesn't seem logical, doesn't correspond to the comment, and seemed to be causing at least one issue with rendered viewport going black during resize.
Fixes#532
(probably) Fixes#519
* Defensive coding to prevent various issues when window size goes to zero, e.g. NaN being passed in cgmath::perspective() aspect ratio parameter.
Fixes#531
523: Change buffer binding to not take a slice r=cwfitzgerald,grovesNL a=kvark
This has been a constant source of confusion w.r.t dynamic offsets.
What it looks like it's doing: user provides a slice of buffer visible to the shader. Just like they provide slices to vertex and index buffer bindings.
What it's actually doing: it takes the offset and size separately, modifying the offset later on based on the dynamic offset.
We don't need this confusion. Semantics is different from `BufferSlice` and so we should have a different API here.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
517: Added some explanatory comments to hello-compute example r=kvark a=JonathanWoollett-Light
Simply added some more comments explaing the basic compute example.
Also moved the lines:
```rust
let slice_size = numbers.len() * std::mem::size_of::<u32>();
let size = slice_size as wgpu::BufferAddress;
```
To be just before where they are used.
Co-authored-by: Jonathan Woollett-Light <jonathanwoollettlight@gmai.com>
509: Convert StagingBelt to take a &mut CommandEncoder r=kvark a=cwfitzgerald
This allows `StagingBelt` to be `Send`, very important for async/highly multithreaded applications. Also added a bit more documentation.
Tested on the skybox example.
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
502: Expose get_bind_group_layout r=grovesNL a=kvark
Returning a new object is fine for BGLs specifically and for these cases in particular because we made sure the refcount is bumped (and BGL has a special kind of refcount) in f164fd1f46
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>