Commit Graph
8897 Commits
Author SHA1 Message Date
Jim Blandy afed25fa5c Clean up render bundle bind group tracking.
The `dynamic_offsets` and `is_dirty` flags only make sense when the
slot is occupied, so they should be inside the `Option`. This makes
`State::bind` into an `ArrayVec<Option<BindState>>`, and cleans up
various other bits.
2022-05-22 08:38:47 -07:00
Jim Blandy d3235484f9 Document some parts of wgpu_core's render bundle code. 2022-05-22 08:38:47 -07:00
Jim Blandy 26a7c8c2a5 Document VertexStepMode. (#2685) 2022-05-22 08:34:33 -07:00
Jinlei Li eb260ba7a6 metal: fix Depth24Plus | Depth24PlusStencil8 capabilities (#2686) 2022-05-22 08:31:15 -07:00
Jim Blandy 84efe2b18b Actually use RenderBundleEncoder::set_bind_group in tests. 2022-05-21 01:51:34 -07:00
Ashley 1ec26784c4 [Gles] Fix clearing depth and stencil at the same time (#2675) 2022-05-19 17:10:27 -04:00
Jim Blandy b53a8bcb17 New function: Global::create_buffer_error. (#2673) 2022-05-19 13:10:47 -04:00
Jinlei Li 8b2e6fe3a2 Roll naga to 571302e (50 revisions) (#2672) 2022-05-18 21:09:22 -07:00
Jinlei Li 0c1233b834 Move TEXTURE_COMPRESSION_ETC2 | ASTC_LDR to web section to match spec (#2671) 2022-05-18 12:38:53 -04:00
Jinlei Li 36f8d83e5c Roll wasm32 target dependencies to latest (#2669) 2022-05-17 12:17:06 -04:00
i509VCB f5c2ff11d0 Adapter and Instance as_hal functions (#2663)
These functions are added to allow lower level access to adapter and instance from backends.
2022-05-17 06:13:58 +00:00
Jinlei Li 26f96c7dfe Add DEPTH32FLOAT_STENCIL8 featue (#2664) 2022-05-17 02:11:05 -04:00
Hasan Ali 571302e3ff [hlsl-out] Fix countOneBits and reverseBits for signed integers 2022-05-17 00:12:18 +02:00
Jim Blandy b51fd851be Report invalid pipelines in render bundles as errors, not panics.
Fixes #2665.
2022-05-16 14:26:36 -07:00
Jim Blandy c608ee0bbe Accept both parking-lot 0.11 and 0.12.*, to avoid windows-rs. (#2660)
In parking_lot 0.12 and parking_lot_core 0.9.0, those crates switched
from the winapi crate to the official Microsoft windows-sys crate.
This is fine, except that windows-sys and its dependencies are even
larger than winapi. Some users may wish to stick with winapi for the
time being; this change allows wgpu to accommodate them.
2022-05-16 01:16:53 -04:00
Jim Blandy 202d81a64a Move set_index_buffer FFI functions back into wgpu. (#2661)
It's very odd to have almost all the render pass and compute pass ffi
functions in `wgpu` except for the `set_index_buffer` functions, which
live in Firefox. I'd like to remove these from Firefox and put them
back next to their companions.

These functions were originally removed from wgpu in #1077, because
wgpu-native has its own incompatible version of IndexFormat (see that
PR for details). However, with wgpu-native#85, that code was removed,
so having these functions in `wgpu` should be no longer be a problem
for wgpu-native.
2022-05-15 15:18:05 -04:00
grovesNL 60ae549fe1 Add error for non-floating-point matrix 2022-05-14 17:00:15 +02:00
Shaye Garg 75b881e636 fix: panic in Storage::get (#2657)
* fix: don't panic on invalid id in Storage::get

* formatting

* removed double matches

* more match removal

* fix formatting

* add fix to Storage::label_for_invalid_id
2022-05-14 14:59:47 +05:30
Jim Blandy 284ed4654e Spell out the type of the result from map_pass_err.
Without these changes, rust-analyzer cannot determine the type of
`cmd_buf`.
2022-05-13 22:18:12 -07:00
Jinlei Li 8e5ac75d45 metal: fix Rgb9e5Ufloat capabilities and sampler_lod_average support (#2656) 2022-05-14 01:06:06 +00:00
teoxoy ab2806e05f [hlsl-out] fix array constructor return type (for FXC) 2022-05-12 22:17:40 -07:00
Kevin Reid c1934dc07f RenderPassDescriptor: make label lifetime match doc, and make names descriptive. (#2654)
Lifetime names like `<'a, 'b>` mean that the reader must look at how
they are used to understand them. By changing them to `'tex` (lifetime
of borrows of the texture views the documentation describes) and `'desc`
(everything else), and mentioning them in the documentation, it's more
obvious which role each one plays.

For consistency, I also changed `begin_render_pass()`,
`RenderPassColorAttachment`, and `RenderPassDepthStencilAttachment` to
use matching lifetime names.

Also, this made it clear that the `Label` had the wrong lifetime --
the docs say that the texture views have a different lifetime from
“everything else”, but the `Label` in fact had the same lifetime as
the texture views, so I changed it to the `'desc` (formerly `'b`)
lifetime. (On review of change history, this mismatch was previously
introduced in commit 632f828eda9af1f6f18c74398b5f40644cf02f03.)
This change is definitely safe because I followed the data flow down
to `BasePass::new` which promptly calls `to_string()` on the label,
thus converting it to owned data.
2022-05-12 22:16:53 -07:00
teoxoy 5f47d6d31f [msl-out] use matrix identity constructor 2022-05-12 22:15:45 -07:00
teoxoy 6dae3ac7e0 [wgsl-in] support partial vector & matrix identity constructors 2022-05-12 22:15:45 -07:00
teoxoy f48174a0b4 [spv-out] use OpCopyObject for matrix identity casts 2022-05-12 22:15:45 -07:00
teoxoy b7ff50619c [spv-out] use OpCopyObject for bool - bool conversion due to OpBitcast not being feasible for booleans 2022-05-12 22:15:45 -07:00
teoxoy afb6504b8b add support for identity matrix constructor 2022-05-12 22:15:45 -07:00
Jinlei Li ddf1903b03 Add SHADER_FLOAT16 feature (#2646)
* Add SHADER_FLOAT16 feature

* vk: check SHADER_FLOAT16 feature
2022-05-12 22:14:19 -07:00
Jim Blandy 144e943737 Two more fixes to WebGPU spec links. 2022-05-12 20:27:54 -07:00
Kevin Reid 07f94d829a Add cross-references to each wgpu type's documentation.
Added:
* WebGPU specification links.
* How to create an instance, if it is not all-public-fields.
* What function or enclosing type this type is used for.

(The latter two are not present for `wgpu-types` items due to the
dependency running the wrong direction for that — I saw existing
`../wgpu/` links, but those do not work on https://docs.rs/wgpu/.)

This commit specifically does not:
* substantially revise existing language, except where necessary to fit
  the new information, or when there was an obvious trivial improvement
  like adding a link to support "how to use this".
* add similar information to the documentation of types not directly
  corresponding to the WebGPU specification
2022-05-12 20:27:54 -07:00
Connor Fitzgerald 95d5d165fb [valid] Fix bitflag assignments (#1915) 2022-05-12 13:10:17 +00:00
Poly 8e62ca0538 Add new integrated GPU to the list: AMD Renoir
Renoir is codename for AMD series of mainstream mobile and desktop APUs based on the Zen 2 CPU and Vega GPU microarchitectures succeeding Picasso.
2022-05-11 20:32:43 -07:00
Poly bfcf5fa513 Make GLES DeviceType unknown by default 2022-05-11 20:32:43 -07:00
Jim Blandy a5e7275b9c Document random bits and pieces. 2022-05-11 20:17:32 -07:00
teoxoy b688584d87 [msl-out] fix pointers to private or workgroup address spaces possibly being read only 2022-05-11 20:10:18 -07:00
teoxoy fea33c682e [wgsl-in] fix incr/decr not matching ValuePointer 2022-05-11 20:01:46 -07:00
Igor Shaposhnik 8db27c49f8 [wgsl] Reserve binding_array 2022-05-11 13:41:24 +02:00
Jim Blandy 9be974aa6b Documentation fixes for Instance::poll_all and Device::poll. 2022-05-10 16:35:56 -07:00
xiaopengli89 654a75b058 Return all_queue_empty for Instance::poll_all 2022-05-10 16:35:56 -07:00
xiaopengli89 3f3af605db Return queue_empty for Device::poll 2022-05-10 16:35:56 -07:00
Hasan Ali 205ea6cc5c Fix hlsl output for writes to scalar/vector storage buffer 2022-05-10 22:46:47 +02:00
teoxoy b3d5e6d807 [msl-out] zero init variables in function address space 2022-05-10 10:44:40 +02:00
teoxoy 239bbbbed4 [spv-out] zero init variables in function and private address spaces 2022-05-10 10:44:40 +02:00
teoxoy ceb92921c2 remove named expression entry for phony assignment 2022-05-10 10:43:25 +02:00
teoxoy 66337af310 add TODOs for handling undefined behavior 2022-05-09 20:48:09 -07:00
teoxoy ecd6d4e4aa [spv-in] translate OpSMod correctly 2022-05-09 20:48:09 -07:00
teoxoy 7109cffb20 [spv-out] use SRem instead of SMod 2022-05-09 20:48:09 -07:00
teoxoy 0d4098d634 [spv-in] translate OpFMod correctly 2022-05-09 20:48:09 -07:00
teoxoy c03d840755 [glsl-in] translate mod fn correctly 2022-05-09 20:48:09 -07:00
teoxoy c584331f39 [hlsl-out] use fmod instead of % 2022-05-09 20:48:09 -07:00