Commit Graph

1225 Commits

Author SHA1 Message Date
Dzmitry Malyshau
480ab26ded hal/vk: require storage buffer class as the device extension, not instance 2021-11-29 12:09:48 -05:00
João Capucho
90b2949fb3 hal/vulkan: Enable depth clip if available (#2218)
This wasn't being done even if the VK_EXT_depth_clip_enable was present
causing validation errors when requesting DEPTH_CLIP_CONTROL in the
device.

Strangely this was being done for raw calls to `wgpu_hal::Adapter::open`
because it calls `physical_device_features` and then
`from_extensions_and_requested_features`.
2021-11-29 11:31:43 -05:00
Dzmitry Malyshau
b32dcbb041 hal/gles: force unbind samplers (#2226) 2021-11-29 10:08:11 -05:00
Dzmitry Malyshau
62b036b55b hal/gles: fix setting filtering on integer textures (#2222) 2021-11-28 23:04:43 -05:00
Dzmitry Malyshau
5f6c067815 hal/vulkan: use multiple semaphores in a relay (#2212) 2021-11-25 15:44:33 -05:00
Xiaopeng Li
f4d51451fa Unique HalManagedMetalLayerDelegate class (#2209)
* Unique HalManagedMetalLayerDelegate class

* Remove once-cell dependency
2021-11-25 11:23:26 -05:00
Mariusz Kryński
dde73ed236 use native webgl2 buffers for MAP_READ usage (#2201)
* use native gl buffers for map_read

* Buffer refactor

* lint
2021-11-23 17:16:26 -05:00
Dzmitry Malyshau
5864b776a4 Refactor command buffer states to ensure proper cleanup on errors (#2208) 2021-11-23 15:57:13 -05:00
Dzmitry Malyshau
2b38439f65 Add INDIRECT_FIRST_INSTANCE feature (#2206) 2021-11-23 10:01:07 -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
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
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
Mariusz Kryński
cf2fb0b665 do not query work group params on gles < 3.1 (#2166)
* do not query work group params on gles < 3.1

* address reviewer comment
2021-11-10 08:21:27 -05:00
Markus Siglreithmaier
6fc0587b2d hal/vk: add physical device features for extensions (#2167) 2021-11-09 09:59:41 -05:00
Mariusz Kryński
9a5dec2cf0 gles backend: unbind PIXEL_UNPACK_BUFFER (#2162) 2021-11-09 09:32:40 -05:00
Dzmitry Malyshau
2755cd08eb Add clippy non_send_fields_in_send_ty (#2156) 2021-11-05 08:57:09 -04:00
Dzmitry Malyshau
ca7ca749cd Update naga to 323999f, report pretty errors in shader validation (#2141) 2021-11-01 16:57:33 -04:00
Jasper St. Pierre
8a76920349 queue: Another attempt at cube map rendering (#2143)
The last one was wrong, because I misread
a confusing line in the GL ES spec.
2021-11-01 14:06:10 -04:00
Dzmitry Malyshau
07b02e694d Update naga to 9d2b357 (#2140) 2021-10-31 23:29:49 -04:00
Jasper St. Pierre
191a8efae6 gles: Fix rendering to cubemap faces (#2139) 2021-11-01 03:00:01 +00: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
Inseok Lee
8ce9ae9b25 Fix invalid Rgba16Float format on gles 2021-10-30 17:31:55 +09:00
Inseok Lee
5f1b3e56bc Unset existing vertex attributes on gles set_render_pipeline (#2131) 2021-10-29 23:46:04 -04:00
xiaopengli89
cd9498d447 Add texture_from_raw method for metal/dx12 device 2021-10-28 09:14:15 -04:00
Mariusz Kryński
8568188558 WebGL backend: memory-only staging buffers (#2112)
* webgl2 buffers

* use bitflags::intersects, linting

* address reviewer comments: s/RawBuffer/BufferInner/

* bugfixes

* cargo fmt

* cargo clippy

* cargo fmt again
2021-10-27 01:16:31 +00:00
Riccardo Zaglia
d46c39af1d FIx raw Vulkan API 2021-10-22 21:53:20 -04:00
Dzmitry Malyshau
29282a3981 hal/egl: don't assume EGL-1.5 if upcast works (#2105) 2021-10-22 09:45:51 -04:00
Nicklas Warming Jacobsen
ea0c974bed webgl2: recreate surface texture in fn configure (#2067)
Currently the configure function reuses the surface texture if it
already exist, and will call Glow::Context::tex_storage_2d to
reconfigure the texture. However doing so on an already configured
texture will cause the browser warning:
WebGL warning: texStorage(Multisample)?: Specified texture is immutable.
and will NOT apply the new configuration such as new dimensions.

Co-authored-by: Nicklas Warming Jacobsen <nwj@skybox.gg>
2021-10-22 12:58:24 +00:00
Dzmitry Malyshau
721875798f hal/gles: allow presenting with Android emulator (#2097) 2021-10-21 22:00:18 -04:00
Inseok Lee
82cf1972af GLES 3.0 fix (#2078) 2021-10-21 16:07:07 +00:00
Dzmitry Malyshau
003b83f6ac hal/mtl: disable fragment r/w buffers in fragment shaders on macOS 10.11 (#2102) 2021-10-21 11:53:57 -04:00
Xiaopeng Li
a59a627f12 Fix memory leak on macOS (#2092)
* Fix memory RenderCommandEncoder, BlitCommandEncoder, label leak on macOS

* Don't wrap autoreleasepool when blit command encoder is already active

* Revert wrap set_label, instead focus on gfx-rs/metal-rs#218
2021-10-20 08:52:00 -04:00
Dzmitry Malyshau
f8ecebb43d hal/gles: properly check for buffer allocation 2021-10-16 10:45:35 -04:00
Dzmitry Malyshau
d9df69ec29 hal/egl: request ALPHA_SIZE for srgb, move shaders into a folder 2021-10-15 15:02:49 -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
5441556988 Release wgpu-hal-0.11.2 2021-10-12 12:22:49 -04:00
Dzmitry Malyshau
c5244c9ffc hal/dx12: fix cube array views 2021-10-12 12:22:49 -04:00
Dzmitry Malyshau
2c9a7dfc2a hal/gl: fix vertex buffers with non-zero first instance 2021-10-12 10:00:34 -04:00
Dzmitry Malyshau
60bb2aaa6b hal/gles: work around the clear shader bug 2021-10-09 16:33:45 -04:00
Dzmitry Malyshau
d48bc62826 hal/vk: check for NV optimus 2021-10-09 16:33:45 -04:00
Dzmitry Malyshau
44f488efed gles: fix querying storage limits 2021-10-09 16:33:45 -04:00
Connor Fitzgerald
7320ca33c8 [gles] Fix indirect compute 2021-10-09 15:15:35 -04:00
Dzmitry Malyshau
016b319b38 Manifests update for 0.11 2021-10-07 19:15:49 -04:00
Dzmitry Malyshau
85fbbbbbf3 Cargo lock update, limits fix (#2033) 2021-10-07 16:57:33 -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