Commit Graph

3410 Commits

Author SHA1 Message Date
CatCode79
8acde0b0e1
minor typo
GSLS -> GLSL
2021-11-21 12:29:57 +01: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
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
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
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
Mariusz Kryński
746c938d19 fix run-wasm-example.sh 2021-11-07 10:20:02 -03:30
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
Dzmitry Malyshau
2755cd08eb
Add clippy non_send_fields_in_send_ty (#2156) 2021-11-05 08:57:09 -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
Mike Welsh
7b3caad779 web: Implement Device::on_uncaptured_error 2021-11-04 22:05:48 -02:30
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
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
Connor Fitzgerald
d2d8affb79
Merge pull request #2137 from kvark/copy-dst
Don't require COPY_DST on surface textures
2021-10-31 00:44:21 -04:00
Dzmitry Malyshau
1b33d996a0 Don't require COPY_DST on surface textures 2021-10-31 00:37:14 -04:00
Connor Fitzgerald
8e5b1f281e
Merge pull request #2136 from dlunch/master 2021-10-30 21:12:14 -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
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
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
Dzmitry Malyshau
9e6af05e94 Bump uniform binding size to 64K 2021-10-26 17:19:14 -04: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
3ec17cf9ed
Fix smooth buffer barrier (#2104) 2021-10-21 22:11:41 -04: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
KangarooCoder
417de103dd
Correct bash env and sed command (#2066)
On MacOS Big Sur Version 11.6 the script fails because 1) it does #!/bin/env bash instead of #!/usr/bin/env bash and 2) the sed's -i option takes a file extension or "" which I have opted for the latter.  With these changes, the script now works as expected.
2021-10-18 03:17:14 +00: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
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
04b8ff2c9e Silence downlevel caps warning on secondary backends 2021-10-15 15:02:49 -04:00