Commit Graph
204 Commits
Author SHA1 Message Date
Connor Fitzgerald 1d216c590e Use only 1 and 4 samples for msaa-line example 2020-12-21 15:34:19 -05:00
Dzmitry Malyshau f3d6d242d7 Update wgpu with Naga fixes and OpenGL backend 2020-12-17 13:03:27 -05:00
Emanuele Dalla Longa bdd6edecd2 Require labels to match gfx-rs/wgpu#1088
Change-Id: I1acc45a3023dfc78b6694bd4a28a0131f07b7ba7
2020-12-16 00:15:05 +01:00
Connor Fitzgerald a4202a4ff0 Add create_texture_with_data helper 2020-12-12 01:50:49 -05:00
Dzmitry Malyshau f213d1db8f Update wgpu with Naga changes, replace hello-triangle shaders with WGSL 2020-12-07 09:45:24 -05:00
Connor Fitzgerald 7dbe4274fb Integrate ETC and ASTC textures in skybox example 2020-12-06 16:51:57 -05:00
Dzmitry Malyshau 7b06c4a3f7 Introduce ShaderModuleDescriptor 2020-12-05 18:53:37 -05:00
kejor 423c2489b8 API and examples update for index_format 2020-12-04 20:29:42 -05:00
Dzmitry Malyshau 9c529b94f5 Adopt the updated bind group entry API 2020-11-30 22:31:31 -05:00
Diggory Blake bed49ac654 Print chosen adapter when running examples 2020-11-30 18:33:51 +00:00
Devin Hill 337612a49f make TextureViewArray take a slice of refs; fix texture-arrays example to match. 2020-11-24 21:09:00 -05:00
Dzmitry Malyshau 2dc59ba2d9 Port to the updated wgpu error model 2020-11-23 17:59:21 -05:00
Joshua Groves 4fafceb30a Fix typo 2020-11-21 00:07:57 -03:30
Joshua Groves 8d5ef65dcb Temporarily use BackendBit::PRIMARY in examples
`BackendBit::all()` allows GL/surfman to be used on macOS which appears
to prevent rendering with Metal (e.g. hello-triangle displays an empty
window).

surfman will be removed in later versions of gfx, which will allow us
to switch back to `BackendBit::all()` in the examples.
2020-11-20 23:33:10 -03:30
Dzmitry Malyshau 9c638a2707 Update wgpu, work around surface validation 2020-11-18 10:05:20 -05:00
infinitesnow 2c2f778dba Fixed size in "boids" example 2020-11-17 21:26:35 +01:00
Timo de Kort ee220edce0 Remove implicit conversion hello-triangle shader.vert 2020-11-15 23:13:53 +01:00
Stygeon ef56676cfc Removed unusued Uniform struct in texture-arrays example. 2020-11-12 02:26:58 +01:00
Dzmitry Malyshau d004ddc038 Match inputs/outputs in msaa-line shader 2020-11-09 09:27:51 -05:00
Zsolt Bölöny 16427aed19 Rename TextureUsage::OUTPUT_ATTACHMENT to RENDER_ATTACHMENT 2020-11-09 10:35:55 +01:00
Dzmitry Malyshau b6cabe16a2 Enable GL backend 2020-11-04 23:02:01 -05:00
Dzmitry Malyshau 503b61dc6c Update wgpu with another bind group fix, updated power preference 2020-10-13 16:57:52 -04:00
Paris DOUADY c4d7ce146f Fix mipmap example which was y-flipped 2020-10-12 16:51:24 +02:00
Dzmitry Malyshau 30fb46a999 Really fix the environment to WGPU_BACKEND this time 2020-10-11 23:43:39 -04:00
Dzmitry Malyshau d8fe188305 Support WGPU_BACKEND environment in the examples 2020-10-11 23:17:38 -04:00
Joshua Groves 0fb8a436e5 Reorder framework window creation for web 2020-09-16 01:04:49 -02:30
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