Commit Graph

350 Commits

Author SHA1 Message Date
Jinlei Li
b10f7ed407 Make shadow example runnable on iOS Android devices (#2433) 2022-02-01 18:08:35 -05:00
Jinlei Li
77b2c25684 Fix msaa-line example's unnecessary MSAA data store 2022-01-25 09:09:06 -05:00
João Capucho
dcd07f0391 Update to upstream naga 2022-01-22 18:36:26 -05:00
Dzmitry Malyshau
36220b4da5 Update WGSL example shaders to use assignment ops 2022-01-11 11:45:33 -05:00
Dzmitry Malyshau
01f62baad2 Limits 1D texture mips to 1 2022-01-10 12:22:49 -05:00
Dzmitry Malyshau
043e36c59a Test WebGPU backend with extra features 2022-01-06 12:48:40 -05:00
Wumpf
2fa75aaf05 Do texture init via clear passes when possible (#2307)
* CLEAR_COMMANDS extension is now more of a window into wgpu zero-init
this has mostly implications on the constraints, but also allows a more leaky documentation which makes sense for this non-standard function as there is no other place to look it up

* clear_texture via renderpasses wip

* 3D depth textures are no longer allowed, volumes are always cleared via CPY_DST

* cleanup texture's clear_views

* rename CLEAR_COMMANDS to CLEAR_TEXTURE

* separate clear_texture into reusable & more descriptive parts

* texture clear views are now created ahead of time

* discarded surface fixup goes through new clear_texture method now

* onq ueue texture initialization now goes threw clear_texture
pending inits need to store Stored textures now though, causing more ref count bumping

* texture init on queue_write_texture now also goes through new clear_texture

* transfer functions on commandbuffer use now new texture init route

* merge collect_zero_buffer_copies_for_clear_texture into clear_texture_via_buffer_copies

* clear functions now take TextureInitRange

* Fix clippy lints

* command_encoder_clear_texture no longer takes write lock on texture

* TextureClearMode encodes now is_color

* code cleanup, mostly about `use`

* Handle volume textures in clear_texture_via_render_passes properly

* texture clear no longer requires id::Stored

* init tracking fixes for volumes and init on partial subresource writes

* texture creation enforces COPY_DST only if absolutely necessary

* unrolled functional chain, reduce unsafe scope size

* fix clippy lints

* clear_texture test no longer creates 1D textures

see #2323

* 3D textures are no longer cleared as render target since this isn't supported on Metal

* fix deno building issue, fix formatting

* TextureInner::Surface can now be zero initialized
2021-12-28 17:05:53 -05:00
Wumpf
b0654e17af [example] fix conserative-raster low res target getting zero sized on resize (#2318)
* [example] fix conserative-faster low res target getting zero sized on resize

* [sample] conservative-raster: fix low res target aspect ratio being wrong
2021-12-26 12:02:21 -05:00
Dzmitry Malyshau
ec1d022a75 Error scopes API (#2299) 2021-12-17 04:39:48 +00:00
Dzmitry Malyshau
3960658529 Remove block decorations (#2292) 2021-12-15 12:29:37 -05:00
Dzmitry Malyshau
c1c855bb98 Allow strip index format None if no indexed drawing is done 2021-12-07 18:58:06 -05:00
Neil Blakey-Milner
4f639622d0 Add strip_index_format to linestrip in conservative-raster example (#2199) 2021-11-22 14:01:24 +00:00
dan
cd59c76e3a Add new BindingResource type SamplerArray (#2113)
* implemented SamplerArray

* modified shaders

* fixed doc

* fixed code format
2021-11-22 12:19:46 +00:00
Layl
2ef72b9313 Add multiview support (#2187)
Co-authored-by: Layl Bongers <2385329-layl@users.noreply.gitlab.com>
2021-11-19 10:56:48 -05:00
Boris-Chengbiao Zhou
47fd77619f Don't use duplicate function name in boids shader (#2183)
From the spec: "A declaration must not introduce a name when that
identifier is already in scope with the same end scope as another
instance of that name."

naga doesn't yet check this (gfx-rs/naga#1480) but Chrome/Tint rightly
complains with: error: redefinition of 'main'
2021-11-16 23:25:33 -05:00
Boris-Chengbiao Zhou
3545a4fdd5 Introduce SamplerBindingType enum and fix bug in validation (#2181)
* Introduce SamplerBindingType enum and fix bug in validation

This matches the WebGPU spec more closely and also lets us implement the
validation as it's written in the spec[1]. This fixes a bug which
previously prevented the "shadow" example from running in Firefox.

Previously the validation would check whether the filtering was
appropiate even if it was a comparison sampler. This didn't matter when
running the shadow example natively since the example was setting
`filtering: true` in addition to `comparison: true`. But this failed
when running through a browser since there the used WebIDL has the
proper enum representation and eventually resulted in `filtering: false`
being passed to wgpu-core which would then fail validation.[2]

[1]: https://gpuweb.github.io/gpuweb/#bind-group-creation
[2]: 674b6582ba/dom/webgpu/ipc/WebGPUChild.cpp (L502-L513)

* Fix remaining examples

* Fix deno_webgpu
2021-11-16 23:08:03 -05:00
Boris-Chengbiao Zhou
08b9c46ec4 Validate strip_index_format (#2177)
The spec mandates that stripIndexFormat is set even when drawIndexed is
not used. (https://www.w3.org/TR/webgpu/#primitive-state)
There is some recent discussion about this though:
https://github.com/gpuweb/gpuweb/issues/2199
2021-11-14 19:03:33 -05:00
Dzmitry Malyshau
f25a45f4e2 Evolve depth clamping into clip control (#2171) 2021-11-10 16:55:27 -05:00
Dzmitry Malyshau
47fb0efb2c ETC2 texture format refactor (#2064) 2021-10-13 13:42:44 -04:00
Yuya Kanai
42de30ad13 Fix issue with limits for hello-triangle (#2062)
* Update main.rs

* Add using_resolution to hello-triangle limits

* Fix format for hello-triangle
2021-10-13 13:31:38 +00:00
Zicklag
312828f12f Implement WebGL2 Backend (#1686)
* Implement WebGL Backend

* Add WebGL Fixes by @mrk-its

* Update Limits for WASM and Examples

* Address Review Points
2021-10-07 16:18:09 -04:00
Dzmitry Malyshau
5092fb7ea5 Refactor presentation to be explicit 2021-10-06 17:02:10 -04:00
Dzmitry Malyshau
1ee6036f44 Implement software adapter selection 2021-10-01 17:22:51 -04:00
Dzmitry Malyshau
c8436de1ec Force point size output on Vulkan 2021-09-15 19:15:23 -04:00
Dzmitry Malyshau
300f7d2e8c Expose query resolve offset and respect it in the mipmap example 2021-09-14 09:47:15 -04:00
Luke Street
76bcd9c494 Implement min_{uniform,storage}_buffer_offset_alignment limits (#1923)
* Implement min_{uniform,storage}_buffer_offset_alignment limits

* Add Limits::using_alignment

* Update docs & examples

* Create binding_model::buffer_binding_type_alignment fn
2021-09-08 13:53:02 -04:00
Dzmitry Malyshau
d23288e455 hal/linux: Work around Intel+Nvidia presentation conflict 2021-09-02 14:50:05 -04:00
Christofer Nolander
06316c1bac hal/metal: support Features::NON_FILL_POLYGON_MODE (#1885)
* hal/metal: support Features::NON_FILL_POLYGON_MODE

* Document Metal support for NON_FILL_POLYGON_MODE

* Split Features::NON_FILL_POLYGON_MODE in two

Adds two new features: `LINE_POLYGON_MODE` and `POINT_POLYGON_MODE`.

Allows metal to support `PolygonMode::Line` while not being required to
support `PolygonMode::Point`.

* Formatting

* Rename {LINE,POINT}_POLYGON_MODE to POLYGON_MODE_{LINE,POINT}
2021-08-31 16:20:38 +00:00
Christofer Nolander
39e8921fe8 example-framework: resize surface on scale factor change 2021-08-27 15:10:03 -04:00
Dzmitry Malyshau
4a1ae0d7ec Issue surface texture transitions 2021-08-11 20:58:42 -04:00
Dzmitry Malyshau
dffe1f1793 Return a texture by the surface 2021-08-11 20:58:42 -04:00
Dzmitry Malyshau
f78061bcef Merge swap chain into surface 2021-08-11 20:58:42 -04:00
Connor Fitzgerald
3afab9c5aa Splits non-uniform indexing into two different features (#1785) 2021-08-10 22:43:08 -04:00
Zicklag
9310f264f1 Update Naga With New Storage Classes API (#1766) 2021-08-05 13:50:51 -04:00
Zicklag
70093eca9e Use Bytemuck to Cast Hello Compute Output
This makes the cast of the output data in the hello-compute example
easier to read and it matches the way we cast the input data as well.
2021-08-01 16:23:14 -05:00
Zicklag
07cd75a36b Fix New Clippy Lints From Rust 1.54.0
Fixes a number of new lints introduce in the updated clippy that
CI is now using.
2021-07-29 16:29:46 -05:00
Connor Fitzgerald
ebf049bcee Adjust limits for WARP on CI 2021-07-29 09:24:07 -04:00
Dzmitry Malyshau
552a5f138e Rename texture usage names 2021-07-28 00:17:54 -04:00
Zicklag
671e393fa1 Handle Multi-threaded EGL Context Access
Implements the synchronization necessary to use the GL backend from
multiple threads.
2021-07-27 14:02:39 -05:00
bors[bot]
9ce884c384 Merge #1732
1732: Fix Tests on DX12/GL r=kvark a=cwfitzgerald

**Connections**

Marks #1730 as known failure

Closes #1695

**Description**

This fixes up tests on both DX12 and GL

**Testing**

Tests


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-27 13:10:45 +00:00
Dzmitry Malyshau
69f808c54a hal/dx12: support base vertex/instance 2021-07-27 08:59:41 -04:00
Connor Fitzgerald
eb33efb110 Mark WARP as known failure on water 2021-07-27 02:15:46 -04:00
Dzmitry Malyshau
405cf57955 hal/dx12: compact register allocation, naga update 2021-07-26 02:01:14 -04:00
bors[bot]
dd1be1ff62 Merge #1721
1721: Tweak Water Example to Show Off Water Shader a bit More r=cwfitzgerald a=zicklag

**Connections**
None

**Description**
Tweaks the water shader example terain and camera to show off the cool water shader a little bit more. 😄


https://user-images.githubusercontent.com/25393315/126842645-e353c0eb-57fc-4b8e-9e0d-901f08c7e9f7.mp4



**Testing**
Tested on vulkan and GL on linux.


Co-authored-by: Zicklag <zicklag@katharostech.com>
2021-07-24 20:16:51 +00:00
Zicklag
7fab8e213c Tweak Water Example to Show Off Water Shader More 2021-07-24 15:04:42 -05:00
Dzmitry Malyshau
bb218c1580 Check render bundle encoding for RODS 2021-07-23 11:24:05 -04:00
Dzmitry Malyshau
1a9a855ea9 Rename InputStepMode to VertexStepMode 2021-07-21 17:48:00 -04:00
Connor Fitzgerald
adcd708cf1 Fix example limits 2021-07-13 14:07:39 -04:00
Connor Fitzgerald
90ef8141f9 Fully skip all rpi hello-compute tests due to non-determinism 2021-07-06 21:43:47 -04:00
Connor Fitzgerald
8ded21862e Fix downlevel vertex stage storage buffer check 2021-07-06 21:43:47 -04:00