Commit Graph
8897 Commits
Author SHA1 Message Date
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
João Capucho eda078d736 [glsl-in] Allow more operations as access bases (#1521) 2021-11-10 12:16:19 -05:00
João Capucho d168f15d81 [glsl-in] Allow constructors from non-scalar to scalar (#1520) 2021-11-10 12:15:43 -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
João Capucho c3c4ab7548 [glsl-in] Add test for matrix from matrix constructor 2021-11-09 15:15:11 +00:00
João Capucho 7234d19d00 [glsl-in] Implement matrix to matrix constructor 2021-11-09 15:15:11 +00:00
João Capucho e26bff1b8d [glsl-in] Split constructor calls into two functions
Improves code readability and removes nesting
2021-11-09 15:15:11 +00:00
Markus Siglreithmaier 6fc0587b2d hal/vk: add physical device features for extensions (#2167) 2021-11-09 09:59:41 -05:00
João Capucho 8a1dbcb050 [spv-in] Always use get_expr_handle for expressions in image expressions (#1516)
* [spv-in] Use `get_expr_handle` in `parse_image_write`

* [spv-in] Use BlockContext directly instead of its fields

* [spv-in] Use `get_expr_handle` for depth ref
2021-11-09 09:52:29 -05:00
João Capucho 8e2c4fbef5 [glsl-in] Don't panic on UB integer operations (#1518) 2021-11-09 09:35:59 -05:00
Mariusz Kryński 9a5dec2cf0 gles backend: unbind PIXEL_UNPACK_BUFFER (#2162) 2021-11-09 09:32:40 -05:00
Dzmitry Malyshau 8bc3aa824b Refactor namer scheme, fix trailing digits (#1510) 2021-11-09 09:24:41 -05:00
Jonathan Behrens 098e4af52f [spv-out] Fix word order for constants 2021-11-07 14:51:40 +00: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
Dzmitry Malyshau 28c45321e5 hlsl: respect array stride in storage buffers (#1507) 2021-11-03 22:44:46 -04:00
Shohei Jinno d9b166816b [glsl-in] Add helper to reduce repetition. (#1505)
```
Ok(self.constants.fetch_or_append(
    Constant {
        name: None,
        specialization: None,
        inner,
    },
    span,
))
```

was called repetitively, so I added
`ConstantSolver::register_constant(&mut self, ConstantInner, Span)`
that returns Handle<Constant>.
2021-11-02 18:05:59 -07: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
Jim Blandy c1b378842e Make tests properly exercise Some("") global names. (#1503)
The GLSL empty-global-name.frag test doesn't suffice because the GLSL front end
doesn't produce the same IR as the SPIR-V included in the bug report. As far as
I know, only a genuine SPIR-V input test can produce a global whose name is
`Some("")`.

Include the SPIR-V assembly source.
2021-11-01 14:07:11 -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 323999fcb9 Fix span includes into function validation (#1500) 2021-10-31 23:58:58 -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
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
Igor Shaposhnik 9d2b357214 [glsl\wgsl out] Remove unnecessary clones (#1492)
* [glsl-out] Remove unnecessary clones

* [wgsl-out] Remove unnecessary clones
2021-10-28 13:54:32 -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
Igor Shaposhnik d1cfdd15a0 Add test for last falltrough switch case 2021-10-27 11:12:35 +01:00
João Capucho 0458f0a404 [valid] Check that the last switch case isn't falltrough (#1485) 2021-10-26 21:33:49 -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
Igor Shaposhnik 00bbbed90a Handle empty variable names in namer (#1484)
* Handle empty variable names in namer

* Add glsl-in test with empty global name
2021-10-26 17:46:27 -04:00
Dzmitry Malyshau 9e6af05e94 Bump uniform binding size to 64K 2021-10-26 17:19:14 -04:00
João Capucho 63dbd38edc Make default a switch case (#1477)
* Make default a switch case

Previously the default case of a switch statement was encoded as a block
in the statement but the wgsl spec defines it in such a way that the
default case ordering matters.

* [spv-out] Support for the new switch IR

* [dot-out] Use different labels for default cases
2021-10-26 13:31:54 -04:00
Jim Blandy 5cf11ab734 Make use of AddSpan and MapErrWithSpan conditional.
This avoids warnings in default-feature builds, like `cargo test -p naga`.
2021-10-25 19:35:59 +01:00
João Capucho 8c071ef122 [wgsl-in] Always flush expressions in function call (#1478) 2021-10-25 11:17:55 -07:00
João Capucho f8d3c4bc8e [wgsl-in] Add support for function call statements (#1476)
* [wgsl-in] Add support for function call statements

* Apply comments
2021-10-25 12:15:58 -04:00
Alex Es ec001c3ead Use span information in analyzer errors (proof of concept) (#1470)
* Proof-of-concept for adding spans to validation errors.

Still missing: actually printing the damn stuff.

* Emit errors from analyzer in the CLI.

TODO: tests, I guess!

* Simplification refactoring: avoid avoiding allocations so vehemently.

* Mask helper traits with `as _`.

* Fix block iterator throwing up when span feature is disabled.

* Nest use statements.

* Add basic docs.

* Axe AddSpanResult.
2021-10-24 22:47:03 -04:00
Dzmitry Malyshau fd5085277a Switch the constant in bevy-pbr to avoid display incosistencies 2021-10-23 23:39:49 -04:00