Commit Graph
178 Commits
Author SHA1 Message Date
Dzmitry Malyshau 568072fb18 Use implicit bind group layout in the mipmap example 2020-09-10 23:59:52 -04:00
Dzmitry Malyshau a9e9f8cabc Update wgpu with the polygon modes support, use in the cube example 2020-09-10 22:02:05 -04:00
qthree 0be45b5d67 Add hello-windows example 2020-09-10 06:55:42 +07:00
Rukai 085e50c798 Replace unsafe impl Pod with safe derive 2020-09-08 23:39:12 +10:00
bors[bot]andIvan Mironov 2c47406c4c Merge #540
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):

![texture-arrays-non-uniform-bug](https://user-images.githubusercontent.com/18099621/91645079-8c00af00-ea5b-11ea-854a-ef5ab5a63ce2.png)

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>
2020-09-02 20:38:32 +00:00
Hiroaki Yutani 47c83600d2 Remove bake.frag 2020-09-01 00:22:19 +09:00
Ivan Mironov f19eef64d4 Add nonuniformEXT qualifier in examples/texture-arrays
This fixes corruption of output on some AMD GPUs.
2020-08-30 00:30:06 +05:00
Ivan Mironov 77166bba00 Use wgpu::include_spirv!() for all shaders in examples/texture-arrays
`wgpu::include_spirv!()` writes file name into log. This is useful to
understand which fragment shader is used (choice depends on device
features).
2020-08-29 22:41:14 +05:00
Dzmitry Malyshau 19553fe697 Update wgpu with DepthComparison component and better shader validation 2020-08-28 17:37:33 -04:00
crispweed 1935cfa28a Removed erroneous zero size check related conditional in water example resize() (#534)
* 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
2020-08-25 13:25:50 -04:00
Andreas Reich cb2072ed6a Added debug marker/groups for ComputePass & CommandEncoder 2020-08-22 21:37:01 +02:00
bors[bot]andDzmitry Malyshau 854b3f1c5d Merge #523
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>
2020-08-22 01:57:56 +00:00
Dzmitry Malyshau 44c6910934 Change buffer binding to not take a slice.
Also switch the shadow example to use dynamic offsets.
Add the relevant feature to our example table.
2020-08-21 09:49:33 -04:00
Jonathan Woollett-Light 82245e5f77 Added some explanatory comments to hello-compute example 2020-08-19 18:16:10 +01:00
Connor Fitzgerald dfac39efc1 Convert StagingBelt to take a &mut CommandEncoder 2020-08-16 23:10:14 -04:00
Dzmitry Malyshau 1e695f2803 Update wgpu with pipeline labels 2020-08-13 13:04:23 -04:00
Dzmitry Malyshau ed9a2ca6df Update for the wgpu grand refactor 2020-08-13 00:26:40 -04:00
Marvin Löbel e9cf243663 Udderly remove cows from the following APIs:
- BufferDescriptor
- CommandEncoderDescriptor
- RenderBundleDescriptor
- TextureDescriptor
- TextureViewDescriptor
- PipelineLayoutDescriptor
- SamplerDescriptor
- BindGroupDescriptor
- ProgrammableStageDescriptor
- RenderPassDescriptor
- RenderPipelineDescriptor
- BindGroupLayoutDescriptor
- VertexStateDescriptor
- VertexBufferDescriptor
- RenderBundleEncoderDescriptor
- ComputePipelineDescriptor

Also change anisotropy_clamp to use NonZeroU8
2020-08-12 10:21:38 +02:00
Dzmitry Malyshau 924e4b38e4 Update wgpu for optional layouts 2020-08-10 16:42:52 -04:00
Kunal Mohan e110672a53 Replace u32 with NonZeroU32 in TextureView 2020-08-05 22:54:41 +05:30
Dzmitry Malyshau 9b5cbd98ad Update wgpu with the error model changes 2020-08-04 17:09:21 -04:00
Connor Fitzgerald 6e2f51018f Use BCn textures if possible in skybox example 2020-07-30 20:55:40 -04:00
Kunal Mohan 9e365da89d Replace NonZeroU32 with u32 in TextureViewDescriptor 2020-07-30 23:01:49 +05:30
OptimisticPeach 2512c30e57 Combine create_buffer and create_buffer_with_dataCombines both by creating a new buffer descriptor which can deal with both of copying and allocating. 2020-07-29 21:35:21 -04:00
bors[bot]andConnor Fitzgerald 1fb9344bf1 Merge #484
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>
2020-07-29 16:59:20 +00:00
Connor Fitzgerald ccfe3ed285 Enable features in CI to prevent compiler errors 2020-07-29 12:58:08 -04:00
Dzmitry Malyshau 514e7699ff Update wgpu with view descriptor changes 2020-07-28 23:35:59 -04:00
Connor Fitzgerald 7871d100c8 Convert to tracing for logging and add fmt logger 2020-07-26 00:44:39 -04:00
Dzmitry Malyshau 01905ece10 Remove screenshots from README 2020-07-24 23:37:10 -04:00
bors[bot]andConnor Fitzgerald c75b0ee535 Merge #479
479: Split framework limit situation into requested/required r=kvark a=cwfitzgerald

Requiring individual examples be responsible for panicing if their features aren't supported is a bit bug-prone, so this encodes requirements in the framework and enforces it in the framework.

Additionally made the verbs consistent.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-07-24 21:39:46 +00:00
Connor Fitzgerald 7e17789987 Split framework limit situation into requested/required, enforcing correctness in the framework 2020-07-24 17:37:04 -04:00
Marvin Löbel 166fdc1052 Fix missing cows in some places 2020-07-24 17:24:30 +02:00
Dzmitry Malyshau b76e560432 Update wgpu, use defaults for rasterizer states, use depth-clamping 2020-07-23 22:35:13 -04:00
Marvin Löbel eb9299d247 Update wgpu-rs for the Cow changes in wgpu 2020-07-23 00:48:13 +02:00
Rukai be388200dc Update to latest wgpu 2020-07-21 01:51:55 +10:00
Zsolt Bölöny 10538f8a9f Move logger init earlier in the example framework 2020-07-19 22:41:27 +02:00
Connor Fitzgerald 17a53cf003 Remove Lifetimes from Push Constants 2020-07-17 14:52:33 -04:00
Connor Fitzgerald a67047297c Implement PUSH_CONSTANTS feature 2020-07-13 15:43:46 -04:00
Gabriel Majeri e01e93a619 Use common types from wgpu-types 2020-07-13 20:12:27 +03:00
Gabriel Majeri 009d062482 Unwrap errors from transfer API 2020-07-13 14:13:23 +03:00
m4b 68754e6ca9 recreate swapchain on framework.rs examples on resize, ref #352 2020-07-10 21:30:39 -07:00
Gabriel Majeri eb91482d0b Update to new wgpu-core render pipeline API 2020-07-07 21:02:11 +03:00
Gabriel Majeri a801f64789 Improve hello-triangle docs 2020-06-27 21:25:22 +03:00
Connor Fitzgerald 5529b60da4 Convert Extensions + Capabilities into Features 2020-06-26 01:27:57 -04:00
b67d3f43e7 Merge #408
408: Staging belt r=kyren a=kvark

Implementing the belt itself isn't too hard, but integrating it with the example framework and winit's event loop is somewhat challenging. Perhaps, there needs to be a `LocalSpawner` parameter to `render()` like I did [in vange-rs](https://github.com/kvark/vange-rs/blob/e7bc944ef5a5a47d04cedd1c4d299295a1693fd3/bin/boilerplate.rs#L26)?

Edit: code is all ready and shiny... but it does NOT work. Buffers don't come back from mapping for some reason.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Co-authored-by: kyren <kerriganw@gmail.com>
2020-06-25 17:44:04 +00:00
kyren e6ec327689 A different attempt at the example framework 2020-06-25 13:13:13 -04:00
kyren f05496fa59 Get event loop + futures working on native, untested on web 2020-06-25 13:13:13 -04:00
bors[bot]andBrian fb0f231045 Merge #400
400: Added test for "capture" example r=kvark a=bfrazho

I've added a test to validate the capture example. I was planning on using the existing "screenshot.png" that was in there for the assertion for the test, but apparently was slightly different from the one that I was generating. I ended up replacing the screenshot.png with what the test was generating.

I'm a little concerned that they were different from the start, but maybe the png generating library made some small changes over time. I did check to make sure that it generated the same png on Windows and Linux on the same computer.

Let me know if there is anything that you would like me to change!

Co-authored-by: Brian <brian@linux-ccip.lan>
2020-06-24 14:46:52 +00:00
Dzmitry Malyshau aef72d7fd7 Refactor examples API, improve belt documentation and logic 2020-06-23 23:51:47 -04:00
Dzmitry Malyshau 4aa7abdff8 Staging belt, use LocalSpawner for the framework 2020-06-23 23:15:47 -04:00