Commit Graph

1402 Commits

Author SHA1 Message Date
Connor Fitzgerald
73f42352f3
Dx11 Backend (#2443) 2022-03-12 17:14:18 +00:00
Connor Fitzgerald
129c32ffc3 Prevent 3D compressed textures 2022-02-28 21:38:52 -08:00
Connor Fitzgerald
b61939650c Add DownlevelFlag to prevent copies between Depth32 Textures 2022-02-28 21:38:52 -08:00
Connor Fitzgerald
df50028e49 Fix up some downlevel capabilities 2022-02-24 23:52:41 -05:00
Connor Fitzgerald
80da80b497 Move limit comparison logic into wgpu-types for easy reuse 2022-02-24 23:52:41 -05:00
Connor Fitzgerald
b87e50feae Rename get_downlevel_properties to get_downlevel_capabilities 2022-02-24 23:52:41 -05:00
Connor Fitzgerald
1e403e12a3 Always check texture features if we're running on a downlevel platform 2022-02-24 23:52:41 -05:00
Jinlei Li
1bd85a835a Roll naga from 8e2e39e to a45b9a6 (27 revisions) 2022-02-22 15:45:05 -05:00
Jinlei Li
7f3c6f7019 vulkan: correctly set INDEPENDENT_BLEND,make runable on Android 8.x 2022-02-22 15:45:05 -05:00
Jinlei Li
01628a1fad vulkan: HDR ASTC formats support 2022-02-20 00:00:06 -05:00
Jinlei Li
fa35c0a0f4 Re-allow vk backend on Apple platforms via vulkan-portability feature 2022-02-18 20:26:53 -05:00
Dzmitry Malyshau
0545e36aa8 Validated render usages for 3D textures 2022-02-15 18:49:04 -05:00
Nicolas Silva
210014ed89 Fix mistake in Access doc comment. 2022-02-15 09:59:42 -05:00
Jinlei Li
1c17d15507
Metal backend ASTC HDR formats support (#2477) 2022-02-15 09:43:16 -05:00
Alexander Guryanov
d586d6dce9 added id32 feature 2022-02-14 14:42:23 -05:00
Dzmitry Malyshau
6931e57180
Don't recycle indices that reach EOL (#2462) 2022-02-07 19:23:40 -05:00
Xiaopeng Li
8c351970ce
Support to create surface from visual on Windows (#2434)
* Support to create surface from visual on Windows, add mpo(Multiple Plane Overlay) feature to AdapterInfo

* Expose create_surface_from_visual method

* Fix code style

* Make code more concise

* Revert mpo from AdapterInfo
2022-02-07 14:57:57 -05:00
Dzmitry Malyshau
6b4f1b843f
msl: support unsized array not in structures (#2459) 2022-02-06 05:33:20 +00:00
Samuel Hurel
3e0305d27d
Allow non struct buffers in wgsl (#2451)
* Bump naga

* Update examples
2022-02-05 09:53:04 -05:00
Connor Fitzgerald
63dfd98d68
Improve some error messages (#2446)
* Fix render target mismatch error message

* Reword bind group layout mismatch error
2022-02-01 18:51:48 -05:00
Jim Blandy
36ce638381 IdentityManager: from_index method is unneeded.
The `min_index` parameter has no useful effect. Because the range 0..n is pushed
on the free list, index values less than `min_index` do get allocated.

Document `IdentityManager` and `TypedId`.
2022-01-28 01:03:15 -05:00
Alexander Guryanov
b19000367c feature: emscripten 2022-01-27 14:14:29 -05:00
João Capucho
dcd07f0391 Update to upstream naga 2022-01-22 18:36:26 -05:00
Dzmitry Malyshau
f3891fed33
hal/dx12: improve RowPitch computation (#2409) 2022-01-20 19:59:25 -05:00
Aaron O'Mullan
cdd480a89c
lint: deno_webgpu & wgpu-core (#2403) 2022-01-18 09:34:10 -05:00
Aaron O'Mullan
5877117529
chore: bump naga to a1840be (#2401)
* chore: bump naga to a1840be

So tip no longer indirectly pins indexmap, etc...

* feedback

* TODO push_constant_binding
2022-01-17 19:17:31 -05:00
Ibiyemi Abiodun
0183e7d1e8
add AddressMode::ClampToZero (#2364)
* add AddressMode::ClampToZero

* add feature checks

* oops

* rustfmt

* fix dx12

* change to use SamplerBorderColor

* fix metal

* update to use new config

* update dx12 + docs

* address nits

* cargo fmt

* fix dx12
2022-01-15 05:16:35 +00:00
Dzmitry Malyshau
16edd91976 Support writeTexture for surface textures 2022-01-12 13:31:03 -05:00
Dzmitry Malyshau
1bab287eae Update naga to c0b7ac7 2022-01-11 11:45:33 -05:00
Dzmitry Malyshau
dbec075cdc Texture format MSAA capabilities 2022-01-11 09:32:25 -05:00
Dzmitry Malyshau
01f62baad2 Limits 1D texture mips to 1 2022-01-10 12:22:49 -05:00
Dzmitry Malyshau
eda3d4fa34 Update naga to 09d35f3 2022-01-05 23:33:43 -05:00
Alex S
43f09fdb21 Don't create array layer trackers for 3D textures. 2022-01-03 14:09:20 -05:00
Dzmitry Malyshau
55cbbdea62 metal: fix surface texture clear view 2021-12-31 11:41:00 -05:00
Dzmitry Malyshau
a1251dc36a Improve detection and validation of cubemap views 2021-12-30 11:34:40 -05:00
Connor Fitzgerald
276de0e2d6 Fix trac(y/ing) compile issue 2021-12-30 10:46:07 -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
Dzmitry Malyshau
39b7a8a202 Update naga to 8df5421 2021-12-25 00:03:15 -05:00
Dzmitry Malyshau
c00e471274 Release 0.12 2021-12-18 12:36:41 -05:00
Dzmitry Malyshau
1e593a6bd3
Trace push/pop debug group on command encoder (#2294) 2021-12-15 17:48:48 +00:00
Dzmitry Malyshau
3960658529
Remove block decorations (#2292) 2021-12-15 12:29:37 -05:00
Dzmitry Malyshau
0e5892fa04
Update naga with Metal bounds checks (#2276) 2021-12-15 04:59:06 +00:00
aloucks
70f7c375e0
Add feature gated 16-bit normalized texture support (#2282)
* Add feature gated 16-bit normalized texture support

Fixes #1934

* Query format properties only once

* Prevent supports_format from erroneously reporting false if the format wasn't queried

* Assert that 16bit norm formats also support  on vulkan

* Add storage to TextureFormatInfo for 16-bit norm formats now that we check for support
2021-12-13 12:31:16 -05:00
Dzmitry Malyshau
a8caa367ee Add limits for compute storage and max invocations 2021-12-08 21:43:41 -05:00
Dzmitry Malyshau
c1c855bb98 Allow strip index format None if no indexed drawing is done 2021-12-07 18:58:06 -05:00
Dzmitry Malyshau
e867a7434c Let GLES/Angle path compile on macOS 2021-12-05 17:09:36 -05:00
Dzmitry Malyshau
ab28009d80 Angle support on Windows
Also remove the macros module in favor of generic functions.
2021-12-05 17:09:36 -05:00
Dzmitry Malyshau
9bbea3d348 Update naga to c69f676 2021-12-04 12:46:49 -05:00
Dzmitry Malyshau
cdf948b920 Fix and re-enable player tests 2021-12-03 17:11:26 -05:00
UpsettingBoy
d8c3b9489f Added command_encoder_copy_texture_to_texture texture format validation
+ Corrected small typo
2021-12-03 12:49:17 -05:00
Dzmitry Malyshau
ed020ceb78 Fix order of late bindings in BG creation 2021-12-02 12:43:44 -05:00
Dzmitry Malyshau
6372aad845 Rename fill_buffer back to clear_buffer 2021-12-02 12:33:59 -05:00
Dzmitry Malyshau
ef08738330 Insert texture barrier after initializing a texture 2021-12-02 12:33:26 -05:00
Igor Shaposhnik
c6d1491bb1 Update raw-window-handle to 0.4 2021-12-01 15:59:05 -05:00
Samuel Hurel
f622c83a19 Allows for depth texture copies 2021-11-29 12:56:07 -05:00
Leo Kettmeir
cda893fe73
feat(deno_webgpu): fill buffer (#2221)
* fill buffer

* fix

* fmt
2021-11-28 21:22:15 -05:00
Dzmitry Malyshau
5864b776a4
Refactor command buffer states to ensure proper cleanup on errors (#2208) 2021-11-23 15:57:13 -05:00
James Beilby
ed7f8a84a3
Remove very slow debug assertion in hubs (#2193) (#2203) 2021-11-22 13:58:53 +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
Dzmitry Malyshau
ddac6a369b
Validate min_binding_size at draw time (#2195) 2021-11-20 16:15:54 -05: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
Dzmitry Malyshau
fca82ddd7e
Populate sampling pairs for validation (#2188) 2021-11-18 19:06:24 -05:00
Xiaopeng Li
39f3f08b55
Add Device::as_hal and always assume texture from hal is initialized (#2180)
* Add Device::as_hal, create_texture_from_hal_initialized

* Add Safety doc

* Always assume that the texture from hal is initialized
2021-11-18 17:34:01 -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
Dzmitry Malyshau
1ff70329f1
Refactor texture view non-referenced resources (#2184) 2021-11-15 15:58:47 -05:00
Jerónimo Sánchez
052cb3da39
Renaming CommandEncoder::clearBuffer to CommandEncoder::fillBuffer (#2174)
* Renamed clear_buffer to fill_buffer (keeping up with spec)
* fill_buffer does not require CLEAR_BUFFER feature

* Changed ClearBuffer to FillBuffer for `trace` feature

* Renamed clearBuffer for web backend
2021-11-14 19:16:10 -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
27aae2a2a2
Update naga to eda078d (#2172) 2021-11-10 16:06:32 -05:00
Dzmitry Malyshau
7e00abf651
Manually implement Error for ShaderError (#2160) 2021-11-06 17:17:08 -04:00
Dzmitry Malyshau
693bc58bdd
Validate device descriptor before opening (#2159) 2021-11-06 17:09:52 -04:00
Timo Kösters
dbf65234a3
fix typo (#2153) 2021-11-05 02:47:16 +00:00
Alphyr
99830957e8
Update ron (#2154) 2021-11-04 22:41:21 -04:00
Jerónimo Sánchez
c824c8fa53
Added shader workgroup size validation (#2142) 2021-11-02 17:19:15 -04:00
Dzmitry Malyshau
ca7ca749cd
Update naga to 323999f, report pretty errors in shader validation (#2141) 2021-11-01 16:57:33 -04:00
Dzmitry Malyshau
07b02e694d
Update naga to 9d2b357 (#2140) 2021-10-31 23:29:49 -04:00
Jerónimo Sánchez
939d54f88d
Compute max workgroup size limits (#2133)
* Creation of max compute workgroup size limits
* Implemented for Vulkan and Dx12

* Follow up of gfx-rs/wgpu#1808

* Check if current dispatch operation is under the limit

* Typos and some forgotten fixes

* Port to GLES

* Port to Metal with default limits

* Change Vulkan max_workroup_size_per_dims to pick the min of the reported dimensions

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-10-31 22:32:10 -04:00
Dzmitry Malyshau
1b33d996a0 Don't require COPY_DST on surface textures 2021-10-31 00:37:14 -04:00
Wumpf
988716943f
Zero init textures (#1688)
* Added tests for texture zero init
sadly, they are typically passing even if texture zero init isn't doing its job
However, they form nice isolated examples for testing out texture initialization
It could be possible to dirty texture memory prior to ensure zero init did the job

* texture init tracker

* tracking texture init requirements for bind group, transfer and rendertarget

* texture clears for texture init
* queue submit
* write_texture

* Enforce presence of either render target or copy_dst flag

* clear render targets also with using buffer copies
enforce COPY_DST usage now on all textures

* adjust ImageSubresourceRange.layer_range calculation for 3D textures

init_tracker has now a `discard` function to get single data points back to uninitialized

use new standardized partition_point function

* track init state for discarded textures from renderpasses

missing:
* init on the fly if discarded is found within command buffer
* handle discarding only stencil or only depth

* added tests for zero init after discard

* tracking discarded surfaces now in separate struct, piping all inits through utility function
allows to resolve discard/init_action interactions

* Move various memory init code to separate mod
CommandBufferTextureMemoryActions is now fully encapsulated

* implemented discard init fixups for everything but renderpass

* render passes also cause now discard fixups

* fixup_discarded_surfaces takes now an iterator instead of Drain

* Add memory init test for discarding depth targets

* handle divergently discarded depth/stencil target

* comment & clippy fixes

* fix collect_zero_buffer_copies_for_clear_texture yielding block breaking copies

* [pr feedback] minor cleanup in zero_init_texture_after_discard, `use` hygenie

* [pr feedback] fix bug in ImageSubresourceRange range utils

* [pr feedback] fix texture tracker check, bundle transition_texture on init, cleanups

* Implemented drop for InitTrackerDrain

* remove incorrect comment about extents in add_pass_texture_init_actions

* Fix unit test & clippy issues in init_tracker
2021-10-28 09:15:53 -04:00
Dzmitry Malyshau
3ec17cf9ed
Fix smooth buffer barrier (#2104) 2021-10-21 22:11:41 -04:00
Wumpf
4af1c31edc
init_tracker has now a discard function to get single data points back to uninitialized (#2081)
* init_tracker has now a `discard` function to get single data points back to uninitialized

use new standardized partition_point function

* allow unused InitTracker.discard function for time being
2021-10-16 18:09:04 +00:00
Dzmitry Malyshau
04b8ff2c9e Silence downlevel caps warning on secondary backends 2021-10-15 15:02:49 -04:00
Dzmitry Malyshau
41c595cfcf
Hold BGL alive by BG (#2075) 2021-10-15 11:40:49 -04:00
Dzmitry Malyshau
ec8413dfcb
Build fixes after a bad merge (#2071) 2021-10-14 19:24:30 -04:00
Dzmitry Malyshau
47fb0efb2c
ETC2 texture format refactor (#2064) 2021-10-13 13:42:44 -04:00
Wumpf
a28c52873f
Move clear_texture impl from wgpu-hal to wgpu-core (#2046)
* new test for clearing textures of all formats

* clear_texture is now always implemented in wgpu-core instead of wgpu-hal

* add 1D/array/volume texture to clear_texture test

* set mip_level_count to 1 for D1 textures in clear_texture test

* fix warning & clippy lints

* Fix web build

* [pr feedback] fix potentially skipped resource transition, fix wrong mip size for texture clear

* collect_zero_buffer_copies_for_clear_texture aligns rows now properly
2021-10-13 13:42:13 -04:00
Dzmitry Malyshau
016b319b38 Manifests update for 0.11 2021-10-07 19:15:49 -04: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
Connor Fitzgerald
6df5f95b67 Update naga to 2e7d629 2021-10-07 16:09:13 -04:00
Dzmitry Malyshau
dfa4948033 Update naga to 0e3fbc8 2021-10-07 08:32:01 -04:00
Dzmitry Malyshau
5092fb7ea5 Refactor presentation to be explicit 2021-10-06 17:02:10 -04:00
Connor Fitzgerald
c3d906856f Add spans to provide more information profile gaps 2021-10-03 22:54:15 -04:00
Dzmitry Malyshau
1ee6036f44 Implement software adapter selection 2021-10-01 17:22:51 -04:00
Dzmitry Malyshau
97d6db4d18 Allow if/panic in wgpu-hal 2021-10-01 16:22:51 -04:00
memoryruins
13a0baaca5 Update mentions of gfx-hal to wgpu-hal 2021-10-01 13:50:19 -04:00
Connor Fitzgerald
b679342d9e Support descriptor arrays shorter than binding length 2021-09-30 14:11:51 -04:00
João Capucho
9bc5908492
Add method to create shader modules without runtime checks (#1978)
* Add method to create shader modules without runtime checks

* Use opaque struct to represent shader bound checks
2021-09-27 19:51:44 +00:00
Dzmitry Malyshau
a7aa72ba1c Check for color target count in bundle creation 2021-09-27 11:11:10 -04:00
Devin Brite
dbfdbf4e32
Move validation from Device::create_texture_from_hal() to Device::create_texture() (#2001)
* Move validation from `Device::create_texture_from_hal()` to `Device::create_texture()`

---

Users encountered a segfault upon creating a texture when mip_level_count was set to 0 with (at least) Vulkan.
This is due to wgpu's validation taking place after the API's texture is created.

This change moves wgpu's validation to before the API's texture is created, introducing a friendly error instead of a segfault.

* Make `Device::create_texture_from_hal()` infallible

* run cargo fmt
2021-09-27 13:26:36 +00:00
Dzmitry Malyshau
089294fc51 Skip mismatched epochs in the remove_abandoned check 2021-09-25 15:40:21 -04:00
Dzmitry Malyshau
180e3e3576 Fix write_texture for array textures 2021-09-23 10:49:15 -04:00
Dzmitry Malyshau
08ff76f150 Align buffer usage end to 4 2021-09-20 15:22:18 -04:00
Dzmitry Malyshau
be6898f166 Make "Unexpected varying type" a bit less annoying 2021-09-20 12:07:01 -04:00
Dzmitry Malyshau
c8436de1ec Force point size output on Vulkan 2021-09-15 19:15:23 -04:00
Connor Fitzgerald
7766ed194b
Improve CI testing code 2021-09-14 13:34:07 -04:00
Dzmitry Malyshau
95f4122b22 Store a reference to the device in texture views 2021-09-12 10:20:16 -04:00
João Capucho
bf29ceaf10 Update naga to latest 2021-09-11 11:44:27 -04:00
Dzmitry Malyshau
37288a657f Avoid AtomicU64 for it not being portable 2021-09-10 10:34:07 -04:00
Dzmitry Malyshau
ca6fd97c62 Codecoverage CI fix 2021-09-09 12:44:24 -04:00
Dzmitry Malyshau
83abe2a06d Still close the encoder on error 2021-09-09 09:43:38 -04:00
Dzmitry Malyshau
180dc27144 Work around Adreno's OpName bug 2021-09-08 22:24:27 -04:00
Connor Fitzgerald
809909137c
Merge pull request #1919 from kvark/spv
vulkan: compile shader modules at pipeline creation time
2021-09-08 17:25:50 -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
e00bfac6cf vulkan: compile shader modules at pipeline creation time 2021-09-07 20:06:16 -04:00
Dzmitry Malyshau
076031c1ba
hal: switch texture copies to expect physical sizes (#1908) 2021-09-07 13:13:11 +00:00
Wumpf
df2a686c29
Reintroduce clear_texture Metal/Vulkan/DX12 (#1905)
* enable CLEAR_COMMANDS feature for all adapters

* replaced fill_buffer with clear_buffer (minus variable value)

* Improve clear buffer/texture test
and remove unused clear-buffer.ron test

* renamed clear_image to clear_texture

* skeleton for new wgpu-hal clear_texture

* clear_texture implementation for vulkan

* clear_texture now restricts usage

* clear_texture implementation for dx12

* Implemented clear_texture for Metal backend

* Clean up GLES clear_buffer and leave note on how to implement clear_texture in the future

* fix linux compilation & formatting issues

* comment & namespace fixes

* Extent3d has now a simple mipmap calculating function

Fix incorrect use of texture.size in clear_texture for metal/dx12
Fix incorrect mip/layer ranges in clear_texture for metal/dx12
2021-09-06 21:14:40 -04:00
Connor Fitzgerald
938c069608
Properly implement timestamp periods (#1907) 2021-09-04 22:24:15 -04:00
Luca Casonato
d5ba0b439d
WIP: add cts_runner and deno_webgpu crate (#1859)
* WIP: add cts_runner and deno_webgpu crate

* add test

* remove Cargo.lock

* review comment

* simplify

* fix bugs

* improve cts_runner to work with crowlKats/webgpu-examples

* fix

* remove build.rs

cts_runner binaries are now not portable anymore.

Also startup will now print a bunch of cargo:rerun-if-changed=. This
will be fixed in deno_core.

* remove d.ts

* add original deno license file
2021-09-03 13:23:35 -04:00
Dzmitry Malyshau
663f64c571 Fix read-write buffer barrier 2021-09-02 16:39:55 -04:00
Dzmitry Malyshau
53d262c8ee More validation of the surface texture lifetime 2021-09-01 16:19:32 -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
Riccardo Zaglia
0a2be6099c Add Texture::as_hal() 2021-08-31 10:30:23 -04:00
Dzmitry Malyshau
42194168e0 Fix implicit storage texture access 2021-08-26 11:36:05 -04:00
Dzmitry Malyshau
590ef1d8cf
Switch naga to latest on git (#1858) 2021-08-24 18:20:44 -04:00
Dzmitry Malyshau
43d44c89e1 Bump the vertex buffer sizes by 1 2021-08-24 13:39:57 -04:00
Dzmitry Malyshau
c05b064bc8
Check for query resolve alignment (#1853) 2021-08-23 12:32:18 -04:00
Dávid Kocsis
f34f88538b fixed mip level count check for storage textures 2021-08-23 17:49:20 +02:00
Dzmitry Malyshau
f3c9f412f6
Validate against cube storage textures (#1846) 2021-08-23 02:17:28 -04:00
Wumpf
9e1384dbb0
Memory init tracker refactor (#1839)
* split out init_tracker module
with explicit buffer init tracking types

* Added shortcut methods for checked init action handling
Fixed a few unchecked sites in the process

* fix clippy warnings
2021-08-22 22:46:13 -04:00
Andreas Reich
7f395b39af fix buffer collapse in initialize_buffer_memory
due to previous changes there was  only a no-op buffer collapse
The ranges it tried collapsing on were already guranteed to be merged by the init-trackers drain method. However, accross several init actions there can be opportunity for reducing fill_buffer calls.
2021-08-22 22:26:55 -04:00
adamnemecek
efd52e02af use self 2021-08-20 19:36:06 -07:00
Dzmitry Malyshau
62f26367cd Fix the check for depth+stencil aspect of views 2021-08-20 12:11:57 -04:00
Dávid Kocsis
b0d43f9cca add mapping for more storage formats 2021-08-19 16:03:26 +02:00
Dzmitry Malyshau
9da5c1d3a0
Release v0.10 (#1820)
* Release v0.10

* hal/gles: update glow handles logic
2021-08-18 19:06:21 +00:00
Connor Fitzgerald
80ec65e892
Merge pull request #1814 from kocsis1david/write-texture-data-offset
write_texture data offset
2021-08-18 02:29:15 -04:00
Connor Fitzgerald
c493b63b33 Fix zero sized buffer creation 2021-08-18 01:06:23 -04:00
Dzmitry Malyshau
9b85882ff8 [dx12] implement num_workgroups 2021-08-18 00:14:44 -04:00
Dávid Kocsis
41da55db08 write_texture data offset 2021-08-17 22:16:34 +02:00
Imbris
6ba30cbc0b Run tests in the CI for all workspace members 2021-08-17 13:57:29 -04:00
Dzmitry Malyshau
4dc5546a17 Naga update to 69b70f8 2021-08-16 01:35:19 -04:00
Dzmitry Malyshau
1e7d86b655 Update Naga to 69b70f8 2021-08-13 02:09:43 -04:00
Dzmitry Malyshau
450defb743 Fix panic in surface cleanup 2021-08-13 02:09:43 -04:00
Dzmitry Malyshau
f2a18ee57c Update naga to 1907a92 2021-08-12 23:58:19 -04:00
Connor Fitzgerald
4dc0e265ac
Merge pull request #1764 from kvark/submitted-work
Implement onSubmittedWorkDone
2021-08-12 00:06:45 -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
a60d2f6f3b
Merge pull request #1774 from ElArtista/gles_storage_limits 2021-08-10 13:09:49 -04:00
Agorgianitis Loukas
8796089636 Gather downlevel flags and require them all at once 2021-08-07 11:17:43 +03:00
Agorgianitis Loukas
5bc42843cf Add downlevel flag for storage buffers in vertex shaders 2021-08-06 21:22:16 +03:00
Joshua Yanovski
bff04c1502
Fix dynamic offset handling for render bundles
I found this while testing a "bundlemark" version of bunnymark.
2021-08-06 10:38:35 -07:00
Zicklag
9310f264f1
Update Naga With New Storage Classes API (#1766) 2021-08-05 13:50:51 -04:00
Lonsdaleiter
64ffdd52ad
Added is_surface_supported (#1763) 2021-08-04 14:27:08 +00:00
Dzmitry Malyshau
80cf1ffff9 Implement onSubmittedWorkDone 2021-08-04 01:03:26 -04:00
Mikko Lehtonen
5d9c276c82
Include naga diagnostic in the parse error (#1760)
Wraps the Naga's `ParseError` with `NagaParseError` type, that uses the
Naga's full error formatting for its `Display` impl, including shader
source.
2021-08-03 17:27:34 -04:00
Mikko Lehtonen
78e4cd5dbc Remove AsDisplay trait in error formatting 2021-08-03 11:51:52 -04:00
Mikko Lehtonen
019dca3cfa Error formatting impls closer to errors
This is achieved by making a ErrorFormatter helper that is passed to
fmt_pretty, making the impls a lot simpler.
2021-08-03 11:51:52 -04:00
Mikko Lehtonen
e4cdddc639 Move error formatting to wgpu-core 2021-08-03 11:51:52 -04: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
Zicklag
fd460fa1e4 Use Bitshift Style for All Bitflag Consts
This makes existing bitflags easier to read and makes it eaiser to add
new flags later.
2021-07-28 11:28:54 -05:00
Dzmitry Malyshau
552a5f138e Rename texture usage names 2021-07-28 00:17:54 -04:00
Dzmitry Malyshau
69f808c54a hal/dx12: support base vertex/instance 2021-07-27 08:59:41 -04:00
Dzmitry Malyshau
405cf57955 hal/dx12: compact register allocation, naga update 2021-07-26 02:01:14 -04:00
bors[bot]
3eb3eed8cf
Merge #1609
1609: [Vulkan] Initialize wgpu objects from raw handles r=kvark a=zarik5

**Connections**
This PR is a successor of https://github.com/gfx-rs/gfx/pull/3762

**Description**
The `handle_is_external` flag mechanism was not enough to ensure safety, when for example the Instance is wrapped in `Arc<>` and a library cannot keep track of all its clones. This is the case with the bevy render rewrite. The solution was to let wgpu be in charge of destroying the handles, but it also has to keep a reference to a "drop guard" which is always dropped after the handle is destroyed. For the OpenXR integration, this drop guard will be `xr::Instance`.

For now this is just a proof of concept. Only instance creation is handled, and there is even type error in `wgc::Instance::from_hal()`.

I have a few concerns:
* Is it ok to expose `hal::Instance` from the wgpu crate? Or should the user pass all the parameters so `hal::Instance` can be constructed internally? This second options is more disruptive, since the wgpu-types crate would need to import all platform-specific crates to define the structure/enum to hold the raw handles.
* Without counting the call to create the `hal::Instance`, there are 4 indirection calls to save the raw instance. Can this be optimized in any way?

Do you think it is possible to merge wgpu-hal into wgpu-core? This could help with reducing the distance from the surface level API to the platform specific APIs even more.

**Testing**
Vulkan/Android (Oculus Quest) using [this sample](https://github.com/zarik5/openxrs/blob/wgpu-test/openxr/examples/vulkan.rs).


Co-authored-by: Riccardo Zaglia <riccardo.zaglia5@gmail.com>
2021-07-26 05:03:13 +00:00
Riccardo Zaglia
2657849977 [Vulkan] Initialize wgpu objects from raw handles 2021-07-25 21:51:40 +02:00
Dzmitry Malyshau
52734bf87a Fix tracing feature for RODS 2021-07-23 11:33:22 -04:00
Dzmitry Malyshau
34b68121c6 Check bundle RODS against pass RODS 2021-07-23 11:24:05 -04:00
Dzmitry Malyshau
bb218c1580 Check render bundle encoding for RODS 2021-07-23 11:24:05 -04:00
Dzmitry Malyshau
8dc4942431 Update naga to bbfa9a0, tweak DX12 debug output 2021-07-23 10:48:32 -04:00
Dzmitry Malyshau
2c45796d9c Update Naga to cc91c77 2021-07-23 02:19:42 -04:00
bors[bot]
5ef620ace8
Merge #1704
1704: Fix buffer memory initialization to use the tracker consistently r=kvark a=kvark

**Connections**
Depends on https://github.com/gfx-rs/naga/pull/1125

**Description**
Contains a number of dx12 fixes in addition to the buffer initialization fix.
The problem there was - we used the "pending writes" command buffer to initialize buffers, but also used the device's resource tracker and its state to figure out the transitions *after* a command buffer is merged its states.

**Testing**
Ran the examples on Vulkan.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-23 04:48:42 +00:00
munrocket
f909a8e631 update naga revision 2021-07-22 20:52:26 +04:00
Dzmitry Malyshau
09c9ab5e75 Fix buffer memory initialization to use the tracker consistently 2021-07-22 01:19:53 -04:00
Connor Fitzgerald
683d03a8e4 Add Rgb9e5Ufloat 2021-07-21 23:54:46 -04:00
Dzmitry Malyshau
1a9a855ea9 Rename InputStepMode to VertexStepMode 2021-07-21 17:48:00 -04:00
Dzmitry Malyshau
be13fe3048 hal/dx12: fix the binding model 2021-07-20 10:07:40 -04:00
Dzmitry Malyshau
35145615bf Update naga, use binding map in DX12 2021-07-18 12:03:14 -04:00
initial-algebra
0db00e9657 Implement Feature::SHADER_PRIMITIVE_INDEX on Vulkan 2021-07-17 15:31:35 -03:00
Dzmitry Malyshau
5419947095 hal/vk: relay semaphore 2021-07-16 17:55:03 -04:00
Dzmitry Malyshau
509b683e6b hal: renderdoc integration 2021-07-14 16:17:39 -04:00
Boris-Chengbiao Zhou
783c85e264 hal: Fix copy-paste error in texture copy dimensions 2021-07-14 19:52:57 +02:00
Dzmitry Malyshau
8cd17aafe3 Switch read-only storage textures to be exclusive and behind a feature 2021-07-14 01:04:37 -04:00
bors[bot]
0f784bb3c0
Merge #1602
1602: New DX12 backend (unfinished) r=kvark a=kvark

**Connections**
Continuation of #1471

**Description**
Mostly fresh implementation on DX12 backend for wgpu-hal
Core changes:
  - texture usage is filtered before passing to `create_texture_view`, so that wgpu-hal can assume every bit is important.
  - all the copies involving textures are limited to one array layer at a time
  - remove render pass boundary usages

**Testing**
Examples (not running yet)


Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-13 22:26:44 +00:00
Dzmitry Malyshau
bbb046077e Check for blendable flag in filtering 2021-07-13 13:13:40 -04:00
Dzmitry Malyshau
0df804e9c2 hal/dx12: bunch of validation fixes 2021-07-13 02:54:37 -04:00
Dzmitry Malyshau
0a609e74c0 hal/dx12: compute pipelines, update naga 2021-07-13 01:04:06 -04:00
Dzmitry Malyshau
00859b9e0c Stop using render pass boundary usages for resource transitions 2021-07-13 01:02:42 -04:00
Dzmitry Malyshau
81f31f5555 hal: change blend color argument 2021-07-13 01:01:30 -04:00
Dzmitry Malyshau
35ee65707f hal: make copy to work on one array layer at a time 2021-07-13 01:01:26 -04:00
Dzmitry Malyshau
c7519432ee Filter texture usages on view creation 2021-07-13 01:01:21 -04:00
Dzmitry Malyshau
c01f6a557e hal/dx12: enable the backend in wgpu-core 2021-07-13 01:01:19 -04:00
bors[bot]
5c2e40c6ed
Merge #1636
1636: Rename StoreOp::Clear to StoreOp::Discard r=kvark a=Wumpf

(recent change in spec)

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-07-12 16:47:19 +00:00
Andreas Reich
f5a4cbc0e1 Rename StoreOp::Load to StoreOp::Discard
(recent change in spec)
2021-07-12 18:06:15 +02:00
bors[bot]
4781d9da7b
Merge #1607
1607: Fix Downlevel Vertex Stage Storage Buffer Check r=kvark a=cwfitzgerald

**Connections**

Fixes a bug in #1599. Also follows up on #1583 marking all of hello-compute as a failure.

**Testing**

Tests now pass on rpi4.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-07 14:01:37 +00:00
Connor Fitzgerald
8ded21862e Fix downlevel vertex stage storage buffer check 2021-07-06 21:43:47 -04:00
Benoît du Garreau
e7269e72f3 Upgrade arrayvec to 0.7 2021-07-06 00:45:24 +02:00
bors[bot]
118cf2cdba
Merge #1599
1599: Fix Limits for lava/llvmpipe and re-enable and re-work CI r=kvark,groves,wumpf a=cwfitzgerald

**Connections**

No longer fixes #1551.

**Description**

This PR has a couple things going on at once.

- Fixes limits for llvmpipe, lavapipe, and rpi4.
- Added a downlevel limit to express that RPI4 does not allow storage buffers in vertex shaders on GL.
- Added a `Limits::downlevel_default()` that takes minimum limits from GLES and adds some more documentation on how to choose limits.
- Moved all examples to the new downlevel limits
- Reworks CI to re-enable software testing and unify instructions.

**Testing**

It is

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-04 19:23:23 +00:00
Connor Fitzgerald
130ddcf561 Unify CI and testing 2021-07-04 15:22:51 -04:00
Dzmitry Malyshau
b704a0542f Fix memory leak in acquiring encoders 2021-07-03 22:25:59 -04:00
Connor Fitzgerald
26f3c03150 Add downlevel limit for vertex shader access to SSBO 2021-07-03 22:15:16 -04:00
Dzmitry Malyshau
d2a4af35af Generation of memory reports for Hubs 2021-07-03 01:51:04 -04:00
bors[bot]
7ab950e465
Merge #1592
1592: Detailed limits check and error r=cwfitzgerald a=kvark

**Connections**
Related to #1590

**Description**
The old comparison "A < B" was simply wrong, because it would do every field in order and could bail out mid-way without reaching for all limits.

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-03 01:12:43 +00:00
Dzmitry Malyshau
23b587246a Detailed limits check and error 2021-07-02 20:17:12 -04:00
Clayton Walker
25c452cbdd Add metal layer back in 2021-07-02 15:51:11 -06:00
Dzmitry Malyshau
ba8fcb937d Update naga to 0b9af95 2021-07-02 01:58:19 -04:00
Connor Fitzgerald
53e2c95dc8 Fix wgpu-info display by moving masks to associated functions 2021-07-02 01:15:19 -04:00
Dzmitry Malyshau
8db6f99a3e Suspect new resources for destruction only after the current submission is tracked 2021-07-01 02:02:16 -04:00
Dzmitry Malyshau
f9f19faed6 Rewire the path of destruction for swapchain texture views 2021-07-01 01:39:12 -04:00
Dzmitry Malyshau
ba006cfaa7 Rename ColorWrite, TextureUsage, and BufferUsage 2021-06-30 14:57:38 -04:00
Dzmitry Malyshau
568ac3fa24 Switch all bitflag names to plural 2021-06-30 14:43:36 -04:00
Dzmitry Malyshau
6f13eebb7b hal/gles: compressed ETC2 texture support 2021-06-30 12:06:59 -04:00
Dzmitry Malyshau
4be8864b38 hal/gles: totally rework the vertex data binding 2021-06-30 02:31:13 -04:00
Dzmitry Malyshau
582c128520 Pick up naga's GLSL continuing and Y-flip fixes 2021-06-30 02:29:30 -04:00
Dzmitry Malyshau
e4aee90341 hal/gles: object labels, view dimensions, and buffer clears 2021-06-30 02:29:29 -04:00
Dzmitry Malyshau
403ff6faf8 hal/gles: Update glow and fill up the missing methods 2021-06-30 02:29:29 -04:00
Dzmitry Malyshau
952173efde Enable Gles backend, add checks for downlevel flags 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau
91df157462 Refactor downlevel support a bit, implement blending for hal/gles 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau
51dd90b1ab hal/gles: render passes 2021-06-30 02:29:27 -04:00
Dzmitry Malyshau
d29c450ec3 hal/gles: bind group creation 2021-06-30 02:29:26 -04:00
Alex S
2828100143 Reduce feature flag surface for descriptor arrays.
DYNAMIC_INDEXING is checked by default, since WGPU doesn't allow
for any kind of specialization constants and constant indexing is
nigh useless.

STORAGE_RESOURCE_BINDING_ARRAY is enabled iff the device supports:
- both or neither of uniform and buffer arrays with dynamic indexing;
- both or neither of sampled and storage images with dynamic indexing.

NONUNIFORM_INDEXING is enabled iff for ALL types of descriptor arrays
*that are supported for dynamic indexing*, nonuniform indexing is
also allowed.

These flags have a limitation in that some platforms
(eg.
https://vulkan.gpuinfo.org/displayreport.php?id=11692#features_core_12)
may support a strange subset of those features (example device
supporting non-uniform indexing for textures and storage buffers,
but NOT for storage textures or uniform buffers). In that case feature
will be reported as missing, even though it is partially present.

In the author's opinion, this flag set is convenient for the
users to query; however, due to aforementioned limitations, it would be
desirable to obtain statistics about "edge-case" platforms and what
percentage of reports they comprise.
2021-06-28 14:44:00 +03:00
bors[bot]
4ca6ab302d
Merge #1562
1562: Fix check for QUERY_SET_MAX_QUERIES was using >= instead of > r=cwfitzgerald a=HalfVoxel

Fixes #1560

Co-authored-by: Aron Granberg <aron.granberg@gmail.com>
2021-06-27 21:10:32 +00:00
Aron Granberg
6416bc5b68 Fix check for QUERY_SET_MAX_QUERIES was using >= instead of > 2021-06-27 17:08:49 +02:00
bors[bot]
8332493d3d
Merge #1559
1559: Query support fixes r=kvark a=Wumpf

**Connections**
Fixes #1374 for master
If PR is accepted,I already have a fix for 0.9 which came out as a sideproduct: https://github.com/Wumpf/wgpu/tree/v0.9-fix-buffer-init-on-query-resolve

**Description**
Fixes:
* (affects master, v0.8, v0.9) query resolve operation not marking buffers as initialized
* (affects master) Broken query stride handling for Vulkan
* (affects master) Vulkan not advertising query support

**Testing**
* added new test
* mipmap sample


Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-06-27 14:27:27 +00:00
Andreas Reich
b44b5eded9 Fix query stride handling
Fixes #1374
2021-06-27 11:20:38 +02:00
Dzmitry Malyshau
5ca1fe58e9 Update naga to 57b3256020 2021-06-27 01:44:49 -04:00
Dzmitry Malyshau
cfed43face Update submission indices on all stateless resources 2021-06-24 01:40:18 -04:00
Connor Fitzgerald
b060bf1afe Assorted touchups 2021-06-23 20:23:19 -04:00
Connor Fitzgerald
3356f5f993 PR comments 2021-06-23 19:10:11 -04:00
Connor Fitzgerald
22b8e2851f Remove loom 2021-06-23 19:10:11 -04:00
Dzmitry Malyshau
c2f879b4f7 Don't merge stateless trackers from bind groups 2021-06-23 15:28:40 -04:00
Dzmitry Malyshau
4c03d286c6 Remove SPIRV entirely from wgpu-core 2021-06-22 12:35:22 -04:00
Dzmitry Malyshau
da38b8b077 Make spirv an optional feature 2021-06-21 12:09:12 -04:00
bors[bot]
96dbd06a1f
Merge #1525
1525: Add Naga bypass to allow feeding raw SPIR-V shader data to the backend. r=kvark a=ElectronicRU

**Connections**
Fixes #1520 .

**Description**
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.

**Testing**
`texture_arrays` example is runnable now, which uncovers an additional bug in Vulkan backend - binding arrays are instead treated like sole bindings, and indices shift, too. Lots of errors from validation layer ensue.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 16:13:53 +00:00
Alex S
7cd7b18560 Code review:
- Remove Cow from wgpu-hal API surface. You graze on in our hearts.
- Rename feature flag to SPIRV_SHADER_PASSTHROUGH in anticipation
  of crate feature `spirv` to reduce confusion.
- Add some more documentation about behaviour and intended avenues of
  use to the feature.
2021-06-20 15:22:04 +03:00
bors[bot]
cfda54f108
Merge #1528
1528: Support TEXTURE_SPECIFIC_FORMAT_CAPABILITIES for rendertargets. r=kvark a=ElectronicRU

**Description**
With TEXTURE_SPECIFIC_FORMAT_FEATURES enabled, one would assume that render pipeline creation would use extended features
for color/depth-stencil render targets. However, it does not. This aims to fix that discrepancy.

Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 06:14:42 +00:00
Alex S
8bfa949261 Code review:
- rename ShaderInput variants
- rename feature flag
- hard error on Metal backend trying to compile SPIR-V
- fix test failing because of feature flag bits changing
2021-06-20 06:22:59 +03:00
Alex S
066bd7e647 Support TEXTURE_SPECIFIC_FORMAT_CAPABILITIES for rendertargets. 2021-06-20 05:57:55 +03:00
Alex S
6d2e6e5a56 Add Naga bypass to allow feeding raw SPIR-V shader data to the backend.
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.
2021-06-19 23:32:44 +03:00
Gordon-F
2873ac32d9 Remove MPL 2.0 header in files 2021-06-19 21:06:08 +03:00
bors[bot]
1d2efb43bc
Merge #1511
1511: Added storage texture array support. r=kvark a=ElectronicRU

**Description**
Arrays of storage images (*f*image*n*D in GLSL parlance) should now be supported.
I also took the liberty to refactor texture format checking a bit,
and tighten up sampled texture support detection for Metal as well.

**Testing**
Not completely sure what's the proper testing approach here, open to suggestions.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-18 21:38:54 +00:00
Connor Fitzgerald
74d2becb18 Relicense to MIT/Apache 2021-06-18 13:40:31 -04:00
Connor Fitzgerald
f49c50442f Update naga to gfx-26 2021-06-18 13:15:28 -04:00
bors[bot]
49f677b1fd
Merge #1513
1513: Fix failing test compilation on windows - DX12 and DX11 not there. r=kvark a=ElectronicRU

**Description**
Due to some things in macros being left on cfg(windows) and some changed to cfg(dx12/dx11), the tests didn't even compile, much less run.

**Testing**
Ideally, some CI for Windows should be set up.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-18 16:44:18 +00:00
Alex S
9f6f4da4ba blindsided by clippy 2021-06-18 19:31:12 +03:00
Alex S
8d13d97663 Fix failing test compilation on windows - DX12 and DX11 not there. 2021-06-18 19:29:09 +03:00
Alex S
52fab481e6 Added storage texture array support.
I also took the liberty to refactor texture format checking a bit,
and tighten up sampled texture support detection for Metal as well.
2021-06-18 19:20:37 +03:00
Dzmitry Malyshau
9c8d4dbfa6 Hot patch for temp_suspected tracking 2021-06-18 10:59:47 -04:00
Dzmitry Malyshau
80ab18404e Change the order to suspect temporary resources earlier 2021-06-18 02:49:46 -04:00
Dzmitry Malyshau
7410b700d6 fix swapchain recycling, copies, device destruction, RODS 2021-06-16 23:18:50 -04:00
Dzmitry Malyshau
c53addac8a hal/vk: draws and dispatches. Refactor query set descriptor 2021-06-16 14:17:37 -04:00
Dzmitry Malyshau
6f655e0b14 hal/vk: barriers and copies 2021-06-15 15:58:12 -04:00
Dzmitry Malyshau
668fedd1c0 hal: rename aux to util 2021-06-15 01:33:19 -04:00
Dzmitry Malyshau
00de15990e hal/vk: pipeline creation 2021-06-15 01:24:25 -04:00
Dzmitry Malyshau
9d85602349 hal: re-architect command encoding and pooling 2021-06-14 13:30:28 -04:00
Dzmitry Malyshau
d8979cad4a hal/vk: command pools, clippy warnings 2021-06-14 10:26:40 -04:00
Dzmitry Malyshau
c2bb2d5dfc Experimental command pool API 2021-06-14 01:58:09 -04:00
Dzmitry Malyshau
4eae5a38d0 hal/vk: hook up gpu-descriptor 2021-06-12 01:04:15 -04:00
Dzmitry Malyshau
61e2e242cd hal/vk: textures and samplers 2021-06-11 19:14:41 -04:00
Dzmitry Malyshau
b4380e4576 hal/vk: buffer and texture creation 2021-06-11 15:53:07 -04:00
Dzmitry Malyshau
9ae5e36ad8 hal/vk: format mapping 2021-06-11 14:27:00 -04:00
Dzmitry Malyshau
dc340421c4 hal/vk: instance and adapter 2021-06-11 02:09:29 -04:00
Dzmitry Malyshau
faf8f7e890 Simple API for coherent mapping 2021-06-10 16:05:44 -04:00
Dzmitry Malyshau
d88aa99997 Fix rows-per-image treatment, clippy warnings 2021-06-10 15:43:21 -04:00
Dzmitry Malyshau
006f8abbba build and clippy fixes, command buffer cleanup 2021-06-10 12:44:29 -04:00
Dzmitry Malyshau
782c72d32c hal/mtl: queue 2021-06-10 10:54:06 -04:00
Dzmitry Malyshau
3109b1b63d hal/mtl: most of the command encoding 2021-06-10 02:31:31 -04:00
Dzmitry Malyshau
bdaf57dbed hal/mtl: pipelines and fences 2021-06-09 23:38:48 -04:00
Dzmitry Malyshau
9f904700ee hal/mtl: creation of bind groups 2021-06-09 17:06:43 -04:00
Dzmitry Malyshau
6d229847be hal: redesign the bind group descriptor 2021-06-08 17:12:28 -04:00
Dzmitry Malyshau
a0b51ce35c hal: remove the cows 2021-06-08 15:18:06 -04:00
Dzmitry Malyshau
a421c1c8b6 Instance plumbing 2021-06-08 11:46:53 -04:00
Dzmitry Malyshau
ff2a3e84fc update synchronization, fix last errors in wgc 2021-06-08 02:03:44 -04:00
Dzmitry Malyshau
0a82c232ba hal: port the rest of wgpu-core 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
c61ee1262b hal: transfer operations 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
6d51fab864 hal:: Fill the command buffer calls 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
738ae2b227 Surface API 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
bae3c694bd Documentation update 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
0ea4cac04b Rework shader and pipeline creation 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
569cd0cdd6 WIP new wgpu-hal 2021-06-08 00:46:08 -04:00
bors[bot]
a92b8549a8
Merge #1474
1474: Add clear buffer/image to wgpu-rs api r=kvark a=Wumpf

Follow up to  #1335

Started using this in Blub fluid sim a little bit on volume textures, works nicely 432fb75a68, more to come

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-06-06 00:07:03 +00:00
Andreas Reich
99e691932d add clear buffer/image to wgpu-rs api 2021-06-05 11:49:13 +02:00
Dzmitry Malyshau
cfc6792c82 Validate pipeline state formats 2021-06-03 10:30:35 -04:00
Dzmitry Malyshau
beb88b0a88 Skip the cube compatibility on a downlevel flag 2021-06-01 08:29:44 -04:00
bors[bot]
9cd01635d7
Merge #1417
1417: Split the tracker into stateful/stateless to reduce the overhead r=cwfitzgerald a=kvark

**Connections**
Implements https://github.com/gfx-rs/wgpu/issues/1413#issuecomment-851604344
Reduces the overhead for resource tracking in the Animometer benchmark by up to 50%.

**Description**
We used to use the full tracker set on the usage scopes associated with compute/render passes. A resource tracker has 2 responsibilities: ensuring the resource is held alive, and validating and recording the state transitions. This PR exploits the fact that the latter responsibility is only applicable for buffers and textures. So doing all the lifetime tracking for a pass is a waste: we can instead just attach the lifetimes to the parent command buffer, straight.

In the Animometer benchmark, there is one large buffer, and thousands of bind groups pointing to different offsets into it. The old code would fill up the pass tracker with those bind groups, and then merge it into the command buffer tracker. The new code would just fill up the command buffer tracker instead. Since there is only one buffer, the pass tracking becomes much lighter.

**Testing**
Untested. It would be nice to have some benchmarks here, possibly after #1397 ?

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-06-01 06:45:05 +00:00
bors[bot]
c332c7fffe
Merge #1403
1403: Trace render passes before they are ran r=cwfitzgerald a=kvark

**Connections**
Follow-up to #1245 

**Description**
We want the API traces to reproduce issues. Previously, we moved all the resource creation to happen after the trace is written.
This PR follow-up by also recording the render pass commands even in the case where one of them triggers a validation error.

Another big part of the PR now is handling the command buffers that failed for some reason. The submission is skipping them now instead of erroring the whole thing.

**Testing**
Tested manually on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-06-01 06:31:28 +00:00
Dzmitry Malyshau
7b7e72b1c2 Split the tracker into stateful/stateless to reduce the overhead 2021-05-31 14:18:44 -04:00
Wumpf
f62d0d5edc
Native Extension: Expose fill buffer & clear image (#1335)
* Add command buffer fill buffer method

* Added test for buffer fill

* Added image clear + test

* image/buffer clear methods are now pure clear to zero

* fix cargo clippy & int type issues

* clear buffer alignment is now given by COPY_BUFFER_ALIGNMENT

* joined buffer/image clear player tests

* ImageSubresourceRange is now used in TextureViewDescriptor
2021-05-30 11:03:33 -04:00
Dzmitry Malyshau
e9d2f402f1 Improve handling of erroring command buffers on submission 2021-05-20 15:35:14 -04:00
Dzmitry Malyshau
314ed4cce5 Trace render passes before they are ran 2021-05-20 11:43:39 -04:00
Dzmitry Malyshau
ab78f3cf16 Check render target aspects 2021-05-19 00:42:20 -04:00
Dzmitry Malyshau
19dfcd93ca Make player automatically start/stop the capture 2021-05-18 17:42:49 -04:00
Connor Fitzgerald
be5adfa584 Fix segfault caused by improper drop order 2021-05-18 01:47:24 -04:00
bors[bot]
13f2ca571c
Merge #1391
1391: Simplify features r=cwfitzgerald a=kvark

**Connections**
Fixes #1390
Makes vertex writable storage optional (native-only for now)
Fixes the follow-up to #891 

**Description**
Refactors the code so that adding new features and maintaining current ones is much easier.
Refactors the way missing features are checked and reported, DRY way.

**Testing**
Not really tested

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-05-17 19:03:59 +00:00
Dzmitry Malyshau
51c7963195 Use the same MissingFeatures error everywhere 2021-05-17 14:20:17 -04:00
Dzmitry Malyshau
163b11db42 Validate the writable storage feature 2021-05-17 14:19:49 -04:00
Dzmitry Malyshau
a06d277d40 Simplify feature selection 2021-05-17 14:11:48 -04:00
Dzmitry Malyshau
f0a145d0fa Add VERTEX_WRITABLE_STORAGE feature, refactor the sample border 2021-05-17 14:09:02 -04:00
bors[bot]
53eab747a3
Merge #1381
1381: Update naga to gfx-25 r=kvark a=kvark

**Connections**
Fixes #1362
Picks up https://github.com/gfx-rs/gfx/pull/3752 and https://github.com/gfx-rs/gfx/pull/3758

**Description**
Updates gfx and Naga. Hooks up the new validation capabilities.

**Testing**
Self-testing.

Note: this PR doesn't currently work because Metal's backend is now required use a sizes buffer when dynamically sized arrays are present. One of the internal tests here uses them.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-05-14 03:57:13 +00:00
Dzmitry Malyshau
e00251d3e3 Update naga to gfx-25 2021-05-13 23:56:26 -04:00
Dzmitry Malyshau
58b83f3ff6 Add extern-C on wgpu_render_pass_execute_bundles 2021-05-11 15:00:49 -04:00
Dzmitry Malyshau
f861e83df1 Fix wgpu_render_bundle_draw_indexed_indirect 2021-05-11 15:00:49 -04:00
Jonathan Behrens
c64618abb8 Include shader label in log message if validation fails 2021-05-08 14:07:56 -04:00
Luca Casonato
751aa714f4 fix: zeroable buffer_get_mapped_range size
According to spec, size can be Some(0).
2021-05-06 22:03:43 -04:00
Dzmitry Malyshau
3bd0e8b050 Validate storage class 2021-05-06 13:25:34 -04:00
Dzmitry Malyshau
de5907d938 Explicitly list output spirv capabilities 2021-05-06 13:25:21 -04:00
Dzmitry Malyshau
e5ddb94be0 Version bump to 0.8 2021-04-29 11:57:22 -04:00
Dzmitry Malyshau
ffd47fbc0e Remove Vulkan Portability support 2021-04-29 11:42:26 -04:00
Dzmitry Malyshau
6ff618aafb Big refactor of the profiling usage 2021-04-29 02:06:58 -04:00
Chandler Newman
904ec7a5ee Add uniform and storage buffer arrays 2021-04-29 00:38:04 -04:00
Dzmitry Malyshau
087bd07f55 Add shader compile markers 2021-04-27 12:23:28 -04:00
Dzmitry Malyshau
6c7f2b917f Update profiling to 1.0 2021-04-26 11:59:15 -04:00
Dzmitry Malyshau
03c4e0969e Update naga to gfx-23 2021-04-26 11:10:22 -04:00
Dzmitry Malyshau
525efda7b2 Hard error on SPIRV parsing failure when VALIDATION is requested 2021-04-22 17:18:16 -04:00
Dzmitry Malyshau
bc4c5c8f03 Change error type for the backend shader 2021-04-21 17:06:58 -04:00
Dzmitry Malyshau
8505a39f6a Make implicit ids actually errors to start with 2021-04-20 17:32:40 -04:00
Dzmitry Malyshau
cc2e547d48 Update gfx to the new image view API 2021-04-20 10:16:30 -04:00
Dzmitry Malyshau
cac643507b Validate min/max blending factors 2021-04-20 09:37:07 -04:00
Dzmitry Malyshau
de86f2a72f Mark unused implicit BGL ids as vacant 2021-04-19 23:35:33 -04:00
Dzmitry Malyshau
27f51ca252 Update naga to gfx-22, add interpolation sampling validation 2021-04-19 13:33:36 -04:00
Dzmitry Malyshau
280ba30c6c Don't compare booleans 2021-04-18 10:25:54 -04:00
Dzmitry Malyshau
92886b4995 Validate filtering samplers at BG creation 2021-04-18 10:25:54 -04:00
Dzmitry Malyshau
6d7ef8b8fd Validate filtered sampling 2021-04-18 10:25:54 -04:00
bors[bot]
a749f09bbf
Merge #1325
1325: Relax and imporve vertex attribute validation r=cwfitzgerald a=kvark

**Connections**
None

**Description**
Improves our validation of vertex attributes in the following ways:
  1. Relaxes the size matching, so that we allow the shaders to default some of the values we don't provide
  2. Require interpolation to match
  3. Make the error messages more detailed:

>     In Device::create_render_pipeline
    error in stage VERTEX
    error matching the stage input at 1 (Uint32x2 interpolated as None) against the previous stage outputs
    input type is not compatible with the provided Float32x2

**Testing**
Tested on wgpu-rs examples.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-04-18 07:37:54 +00:00
Dzmitry Malyshau
c744582052 Update blending API names 2021-04-15 11:25:04 -04:00
Dzmitry Malyshau
c0478c707d Address clippy issues on copying things 2021-04-14 15:23:20 -04:00
adamnemecek
6d3a514c43
updated gfx (#1327)
* updated gfx

* use long rev
2021-04-14 14:37:13 -04:00
Dzmitry Malyshau
78652e93f4 Make input stage errors more detailed 2021-04-13 23:01:02 -04:00
Dzmitry Malyshau
b7a0410e09 Relax vertex attribute matching, also check interpolation 2021-04-13 22:19:44 -04:00
Ashley
ff75948848
Allow non-storage textures to be able to be queried in validation (#1324)
* Improve the WrongUsage error and allow textures to use query

* Run cargo fmt

* Further improve the error

* Add more QUERY flags
2021-04-13 10:12:17 -04:00
Aaron Housh
c820cc8e73
Add Map Alignment type (#1322)
* Add Map Alignment type

* Fix clippy warnings

* Make buffer_map_async compare range start to MAP_ALIGNMENT
2021-04-12 13:28:46 -04:00
Dzmitry Malyshau
1ba95585ba Update naga to gfx-21 2021-04-11 01:07:46 -04:00
Dzmitry Malyshau
191f33871b Don't panic on change_extend errors 2021-04-08 12:03:46 -04:00
Dzmitry Malyshau
02442bcb5e Update gfx with the cmd buf freeing fix 2021-04-06 10:28:51 -04:00
Franz
7a37f07ea0 Updated gpu-alloc to rev 2cd1ad6 2021-04-06 11:16:49 +02:00
Dzmitry Malyshau
4d324bc38d Move depth clamping to primitive state 2021-04-05 16:01:23 -04:00
Dzmitry Malyshau
2e9d9d8267 Update gfx with fixed Metal cross feature 2021-04-05 00:48:17 -04:00
Dzmitry Malyshau
1dddfa6234 Don't flip SPIR-V coordinate space on input 2021-04-04 18:38:56 -04:00
Dzmitry Malyshau
0bd8526239 Update naga to gfx-20 2021-04-04 11:25:10 -04:00
adamnemecek
d91ad13482 framecapture 2021-04-01 12:51:50 -07:00
Connor Fitzgerald
3073a454ff Update to flag-based downlevel bools 2021-04-01 11:48:09 -04:00
Connor Fitzgerald
fca72f54f9 Validate compute shader's presence 2021-03-31 01:08:53 -04:00
Connor Fitzgerald
4db9a4522e Add downlevel infrastructure 2021-03-31 01:08:48 -04:00
Dzmitry Malyshau
49c59ec063 Update gfx to the MSL entry point fix 2021-03-30 21:25:40 -04:00
Gordon-F
7fc70bf349 Force-enable EXPERIMENTAL_TRANSLATION flag when running without cross feature 2021-03-31 02:01:43 +03:00
Gordon-F
124d5e3a7c Update naga to gfx-19 2021-03-31 02:00:48 +03:00
Igor Shaposhnik
6097421647 Update to latest gpu-alloc 2021-03-29 09:33:40 +00:00
Gordon-F
c1f8203f3c Update naga to gfx-18 2021-03-25 16:59:16 +03:00
Joshua Groves
9885bdf320 Rename level_count to mip_level_count
This follows the naming in the specification, located at
https://gpuweb.github.io/gpuweb/#texture-view-creation
2021-03-24 09:14:30 -02:30
Dzmitry Malyshau
f953266bbe Align create_swap_chain function signature 2021-03-23 10:39:13 -04:00
Joshua Groves
a5693ab2a3 Rename color/depth attachments to match spec
- Rename `ColorAttachmentDescriptor` to `RenderPassColorAttachment`
- Rename `DepthStencilAttachmentDescriptor` to `RenderPassDepthStencilAttachment`
- Rename `attachment` fields on both attachments to `view`
2021-03-23 09:31:59 -02:30
bors[bot]
fb0288a377
Merge #1279
1279: Fix some typos r=kvark a=grovesNL

**Description**
Fix a few small typos in doc comments

**Testing**
None

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2021-03-23 06:44:11 +00:00
Joshua Groves
306eaf3969 Fix some typos 2021-03-23 01:01:32 -02:30
Joshua Groves
9058f3ba62 Rename copy views and layout to match spec 2021-03-23 00:48:42 -02:30
Andreas Reich
720c73fa9c Review feedback / fix validate_linear_texture_data 2021-03-21 09:01:31 +01:00
Andreas Reich
50043875e5 rows_per_image & rows_per_image are now optional
Fixes #988
2021-03-20 12:33:28 +01:00
Gordon-F
d20c0199d7 Properly return native shader module errors to users 2021-03-19 21:09:54 +03:00
Dzmitry Malyshau
c52dad9d47 Update naga to gfx-17 2021-03-19 13:43:11 -04:00
Dzmitry Malyshau
9673635125 Add sample count to framebuffer key 2021-03-17 12:13:11 -04:00
Dzmitry Malyshau
b97f5a5b24 Update naga to gfx-16 2021-03-17 09:07:08 -04:00
Connor Fitzgerald
cf6f9c3ca8 Move from tracing to log + profiling 2021-03-17 01:22:30 -04:00
bors[bot]
5d993efc85
Merge #1267
1267: Update naga to gfx-15 r=kvark a=kvark

**Connections**
Fixes #1228 (huge DX12 leak in command allocation)
Includes https://github.com/gfx-rs/gfx/pull/3676, https://github.com/gfx-rs/gfx/pull/3679, https://github.com/gfx-rs/gfx/pull/3680, https://github.com/gfx-rs/gfx/pull/3681, and the relevant Naga stuff.

**Description**
Updates Naga and gfx.

**Testing**
Tested on wgpu-rs examplse

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-16 17:07:20 +00:00
Luca Casonato
82932d1f59
chore: validate offset + size in get_mapped_range (#1266)
* chore: validate offset + size in get_mapped_range

This commit introduces out of bounds & offset validation for
buffer_get_mapped_range, like described in the WebGPU spec. See
https://gpuweb.github.io/gpuweb/#dom-gpubuffer-getmappedrange.

Closes #818

* review comments

* fmt

* fix test

* fix tests

* update error message

* review comment

* use wgt::BufferAddress

* clippy
2021-03-16 13:00:44 -04:00
Dzmitry Malyshau
3b1b11f441 Update naga to gfx-15 2021-03-16 12:52:32 -04:00
Wumpf
717c2d73e7
Add CONSERVATIVE_RASTERIZATION native feature (#1263)
* Add CONSERVATIVE_RASTERIZATION native feature

* update gfx to cd3042d8c02d9dc7fc74ac8c292099c9789f6d43

* error for polygon mode not fill +conservative raster
2021-03-14 20:43:02 -04:00
Dzmitry Malyshau
280c066e65 Update to naga-14 2021-03-14 00:27:57 -05:00
Dzmitry Malyshau
231bba03a1 Lint all the things 2021-03-12 12:39:04 -05:00
Dzmitry Malyshau
80fe0d8fdd Fix Vulkan Portability check 2021-03-10 00:23:09 -05:00
Anthony Cowley
f01feacc2e
Update gfx and naga to gfx-13 tag (#1248)
* wgpu-core: update gfx-hal usage related to sparse resources

* wgpu-core: support naga gfx-13

* Update gfx and naga dependencies to gfx-13 tag

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-03-10 00:04:16 -05:00
Dzmitry Malyshau
4f7cd45ea7 Don't panic on pipeline creation errors 2021-03-09 22:24:57 -05:00
bors[bot]
37dbe5e32e
Merge #1247
1247: Add license to the memory init tracker r=kvark a=kvark

**Connections**
Gecko's code lints complain...

**Description**
Add a license header like all the other files

**Testing**
should work!

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-03-04 15:43:42 +00:00
Dzmitry Malyshau
11af3d1286 Add license to the memory init tracker 2021-03-04 10:42:18 -05:00
Dzmitry Malyshau
10245cece9 Early tracing of swapchain-related things, clean up the hub API 2021-03-03 19:59:29 -05:00
Dzmitry Malyshau
fb1b98ebb1 Early tracing of the other device things 2021-03-03 17:24:09 -05:00
Dzmitry Malyshau
20bcb44c85 Early tracing of buffer, texture, and view creation 2021-03-03 16:54:38 -05:00
Dzmitry Malyshau
7c1db12cdc Refactor implicit BGLs to support early tracing 2021-03-03 16:48:23 -05:00
Dzmitry Malyshau
f7e1304c38 Expose CA surface creation 2021-03-03 15:43:55 -05:00
Dzmitry Malyshau
199e7e5f3b Trace pipeline creation before it actually happens 2021-03-03 15:18:48 -05:00
bors[bot]
c3e95273ff
Merge #1243
1243: Force-drop the token before calling fire_map_callbacks r=kvark a=kvark

**Connections**
Related to WebGPU update in Gecko

**Description**
Since the token was alive, technically, we saw an assertion firing up about concurrent access to the token root.

**Testing**
Tested in Gecko

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-03-02 19:12:58 +00:00
Dzmitry Malyshau
d20ab66741 Force-drop the token before calling fire_map_callbacks 2021-03-01 16:34:07 -05:00
Dzmitry Malyshau
62ca24580d Add limits for textures sizes and vertex imputs 2021-03-01 12:10:40 -05:00
Dzmitry Malyshau
103e7763a3 Rename depth to depth_or_array_layers 2021-03-01 11:08:17 -05:00
Imbris
2c153f5d50 Fix issue with multiple queued mappings where the last one is not cancelled 2021-02-28 00:56:17 -05:00
Imbris
c82a3a77d2 Avoid panic when requesting to unmap a buffer that is pending mapping 2021-02-27 17:38:53 -05:00
bors[bot]
c3a18c3d8b
Merge #1235
1235: Update VertexFormat variants r=grovesNL a=kvark

**Connections**
Matches https://github.com/gpuweb/gpuweb/pull/1322 and https://github.com/gpuweb/gpuweb/pull/1469

**Description**
Just updates us to recent upstream API.
Also breaks lots of user code!

**Testing**
Not functional


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-27 16:05:04 +00:00
bors[bot]
29058e03b0
Merge #1237
1237: Move `#[error]` attributes after the corresponding `#[derive]` r=kvark a=Aaron1011

**Connections**
See https://github.com/rust-lang/rust/issues/79202

**Description**
Fixes Nightly future-incompat warnings

**Testing**
There are no behavior changes intended.

Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2021-02-26 01:09:41 +00:00
Aaron Hill
12b086d92d
Move #[error] attributes after the corresponding #[derive]
This fixes Nightly warnings

See https://github.com/rust-lang/rust/issues/79202
2021-02-25 15:40:11 -05:00
Dzmitry Malyshau
cf165f9a3e Update VertexFormat variants 2021-02-25 15:25:56 -05:00
Aaron Hill
8b4bec5d9a
Update gfx to 0a201d1c406b5119ec11068293a40e50ec0be4c8
Fixes #246

Pulls in https://github.com/gfx-rs/gfx/pull/3653,
which fixes a segfault when using wgpu from a non-main thread.
2021-02-25 15:25:40 -05:00
Andreas Reich
dfe686bbc6 Added TextureFormatFeatures::filterable
Can overwrite TextureSampleType::Float.filterable
2021-02-23 23:59:17 +01:00
Dzmitry Malyshau
91f5329b33 Update gfx and naga to gfx-12 2021-02-21 11:25:45 -05:00
Dzmitry Malyshau
ff31911760 Update the blend API to upstream 2021-02-19 12:07:47 -05:00
Dzmitry Malyshau
fdd50e10fd Update naga to gfx-11 2021-02-16 09:46:22 -05:00
Dzmitry Malyshau
9bf47dd772 Validate texture bindings 2021-02-15 20:14:23 -05:00
bors[bot]
6442b947cb
Merge #1210
1210: Reset the bindings on the push constant change r=wumpf a=kvark

**Connections**
Fixes #1207
(unconfirmed!)

**Description**
I was able to replay the trace in #1207 without validation errors, so I looked deeper into what might have gone wrong.
The code isolated in #1194 looks great. However, the calling code's handling of push constants might have changed a bit.
And I see that the trace uses push constants, so here is what happened, I think:
  - layout A was set, expecting bind group layouts X and Z
  - bind groups X and Y where bound
  - layout B was set, expecting bind group layout X and Y. We see that Y group can now be bound, so we do this. The old logic in this case wasn't considering the push constants in any way, it would only consider them if bind group layouts didn't change, erroneously.
  - layout B has different push constant ranges...

So it's a one-line fix now, which I'm hoping is correct.

**Testing**
Not tested
@Wumpf would you be able to check this?

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-02-12 21:10:26 +00:00
Jakob Hellermann
b89cb21ce3 fix rustdoc warnings 2021-02-12 13:56:51 +01:00
Dzmitry Malyshau
692e82d521 Reset the bindings on the push constant change 2021-02-11 14:47:35 -05:00
Zsolt Bölöny
47a45bcaad Convert PrimitiveState::cull_mode to Option<Face> 2021-02-10 11:59:38 +01:00
Dzmitry Malyshau
42d3f1f087 Update naga to gfx-10, add push constants validation 2021-02-09 10:06:55 -05:00
bors[bot]
dc18ac72e4
Merge #1190
1190: Fix crash on zero init of buffer with no more ref count r=kvark a=Wumpf

**Description**
Previously, if a buffer would no longer have any reference, the zero init step crashed when trying to unwrap its ref_count.

**Testing**
Tested successfully on 54a0f4ff13 where this problem would pop up

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-02-06 22:15:44 +00:00
Dzmitry Malyshau
d0dcb105f5 Don't check the index format for non-indexed calls 2021-02-06 10:58:46 -05:00
Andreas Reich
3486fde638 Fix crash on zero init of buffer with no more ref count
Previously, if a buffer would no longer have any reference, the zero init step crashed when trying to unwrap its ref_count.
2021-02-06 11:11:10 +01:00
Dzmitry Malyshau
e357e3083a Fix command allocator race condition with maintenance 2021-02-05 00:57:18 -05:00
Dzmitry Malyshau
262d0c6dfc Isolate binding compatibility logic into a separate module 2021-02-04 01:16:40 -05:00
Andreas Reich
9dd88cb338 validate for strip_index_format being used with non-strip topology 2021-02-01 21:46:24 +01:00
bors[bot]
7c7501cab7
Merge #1182
1182: Update all versions r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/gfx/pull/3620 and a bunch of other fixes in gfx-rs and naga.

**Description**
Updates the dependencies ("gfx-9" naga train) as well as self version to 0.7, to match the v0.7 branch.

**Testing**
Should just work :)

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-02-01 05:37:39 +00:00
Dzmitry Malyshau
8ed543f26a Update all versions 2021-02-01 00:35:40 -05:00
Andreas Reich
822424e519 Fix buffer init in bundle.rs with mem::size_of::<wgt::DrawIndirectArgs> 2021-01-31 22:01:52 +01:00
Andreas Reich
4f5acba5fb Fixed too eager lock usage, fixed O(N²) buffer range collapse 2021-01-31 21:56:31 +01:00
Andreas Reich
a8460b438c MemoryInitTracker drain is now O(N) 2021-01-31 21:56:31 +01:00
Andreas Reich
018ad05f56 memory init tracker check (previous is_initialized) clamps range now
and is O(log n)!
2021-01-31 21:56:31 +01:00
Andreas Reich
31d292b169 added clear helper method to memory_init_tracker, renamed drain 2021-01-31 21:56:31 +01:00
Andreas Reich
da86b3f401 Cleanup, better use of some rust std lib functions 2021-01-31 21:56:31 +01:00
Andreas Reich
216dcf949b MemoryInitTracker has now a custom impl that doesn't depend on range-alloc 2021-01-31 21:56:31 +01:00
Andreas Reich
32b4e32ac6 MemoryInitTracker tests and interface adjustments 2021-01-31 21:56:31 +01:00
Andreas Reich
492027fe6e command buffer buffer memory init tracking is only filled if necessary now 2021-01-31 21:56:22 +01:00
Andreas Reich
22fb9ab1eb buffer zero init on queue_submit emits correct barriers now
refactored this zero init into separate method
2021-01-31 21:55:49 +01:00
Andreas Reich
5d2afa52c1 Fix zero init for buffers mapped at cration that are not mappable 2021-01-31 21:55:49 +01:00
Andreas Reich
1efdc2b229 Queue_submit zeros out uninitialized buffer regions now
again but with fine grained scheme now
2021-01-31 21:55:49 +01:00
Andreas Reich
9595b39bb3 Fine grained tracking of buffer init requirements 2021-01-31 21:55:49 +01:00
Andreas Reich
5133b0da94 Introduced separate MemoryInitTracker 2021-01-31 21:55:49 +01:00
Andreas Reich
076aecd150 buffer map permeates zero init now in any case 2021-01-31 21:55:49 +01:00
Andreas Reich
a51b4f9232 buffer zero initialization prior to use in submit 2021-01-31 21:55:49 +01:00
Andreas Reich
875cfb5961 buffers are now zero initialized for mappings
queue_write_buffer marks as initialized
2021-01-31 21:55:49 +01:00
Andreas Reich
6b51328b2e Add public structs for indirect command buffers
and fix missing IndirectBufferOverrun error for IndirectDispatch
2021-01-31 21:32:33 +01:00
Dzmitry Malyshau
14eb99da87 Add DepthBiasState, rename StencilStateFace 2021-01-29 00:07:46 -05:00
Dzmitry Malyshau
4764ff21e9 Update gfx with the new iterator API 2021-01-28 12:40:24 -05:00
Dzmitry Malyshau
0346b43982 Update the render pipeline API 2021-01-27 15:09:13 -05:00
Dzmitry Malyshau
c233a70afc Handle zero-sized bindings as an error 2021-01-25 22:33:44 -05:00
Dzmitry Malyshau
6a684e5cdf Don't build shader interface without the validation flag 2021-01-25 14:15:27 -05:00
Jonathan Behrens
a97ec9df91
Add SHADER_FLOAT64 feature (#1154)
* Add SHADER_FLOAT64 feature

* Also enable SHADER_FLOAT64 hal feature when creating the device

* Update wgpu-core/src/instance.rs

Co-authored-by: monocodus[bot] <49363530+monocodus[bot]@users.noreply.github.com>

* Add warning about 64-bit float performance

* Add (currently unsupported) VERTEX_ATTRIBUTE_64BIT feature

Co-authored-by: monocodus[bot] <49363530+monocodus[bot]@users.noreply.github.com>
2021-01-24 21:59:09 -05:00
Dzmitry Malyshau
6538ac5d26 Remove temporary allocation for gpu-descriptor 2021-01-24 12:24:37 -05:00
Dzmitry Malyshau
952ccbcf85 Update naga to gfx-7 2021-01-23 22:17:09 -05:00
Matt Keeter
38b184428d Bump gfx to latest master 2021-01-22 08:58:51 -05:00
Dzmitry Malyshau
05bb482e49 Fix replaying issues with dropped texture views 2021-01-19 22:03:55 -05:00
Dzmitry Malyshau
5fccabf3b8 Update gpu-alloc and remove the associated locking 2021-01-19 20:59:50 -05:00
Dzmitry Malyshau
618bd9e53a Handle read-only storage + sampled combination 2021-01-19 09:54:41 -05:00
Dzmitry Malyshau
7f8c776a85 Update gfx to unborrowed APIs 2021-01-19 00:33:45 -05:00
Vengarioth | Andreas Fischer
6adaef6512 fix the size checks in transfer buffer to image commands 2021-01-18 18:46:37 +01:00
bors[bot]
4f2d0bb8c8
Merge #1151
1151: Update gfx and naga to gfx-6 tag r=cwfitzgerald a=kvark

**Connections**
Fixes #1149 
Regression from https://github.com/gfx-rs/gfx/pull/3573

**Description**
The physical devices held references to `RawInstance` in Vulkan backend, and we weren't cleaning them up.
Note: an alternative fix could be in `gfx-backend-vulkan` - to move the `Entry` into `RawInstance`, thus delaying the shutdown. I didn't go this way because that would be less explicit.

**Testing**
Tested on wgpu-rs examples

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2021-01-16 06:39:44 +00:00
Dzmitry Malyshau
87c8cb8fde Update gfx and naga to gfx-6 tag, fix the hub clears 2021-01-16 01:38:57 -05:00
Connor Fitzgerald
a22037ced0 Add pipeline statistics and timeline queries 2021-01-16 00:48:54 -05:00
Dzmitry Malyshau
6c05470db0 Minor dependencies bumps 2021-01-15 01:11:28 -05:00
Dzmitry Malyshau
a4f897b5d7 Include the extent into the framebuffer map key 2021-01-15 00:53:51 -05:00
Dzmitry Malyshau
012569845d Update render pass and framebuffers logic to the latest gfx-hal 2021-01-15 00:53:28 -05:00
dasetwas
c01e2d10ce Remove comment introduced in https://github.com/gfx-rs/wgpu/pull/1144 2021-01-13 23:28:44 +01:00
Mikko Lehtonen
6c56613045 Merge PassErrorScope::Draw* and Dispatch* variants 2021-01-12 22:23:17 +02:00
Mikko Lehtonen
0d60bd80c5 Include pipeline id in some pass error scopes 2021-01-12 17:58:44 +02:00
Dzmitry Malyshau
389a848dea Support trailing render passes after the swapchain rendering 2021-01-11 21:40:41 -05:00
bors[bot]
09ba19b265
Merge #1144
1144: Fix and simplify attachment dimension mismatch check r=kvark a=DasEtwas

This also improves error messages with detailed dimension and attachment type name info which developers can hopefully recognize.

**Connections**
None

**Description**
Before this commit, depth/stencil attachments are not considered when evaluating the renderpasses' dimension, which will result in a "NoAttachment" error with a confusing display message.

**Testing**
Tested by running an application making use of color-only and depth/stencil-only attachment renderpasses.

Tested by running boids, hello-triangle and shadow examples.


Co-authored-by: DasEtwas <18222134+DasEtwas@users.noreply.github.com>
2021-01-11 23:05:10 +00:00
DasEtwas
93f68add27 Decrease error variant code verbosity, apply reviews 2021-01-11 23:46:26 +01:00