Commit Graph

3738 Commits

Author SHA1 Message Date
i509VCB
435188cb89 expose some underlying types in Vulkan hal 2022-05-22 08:49:04 -07:00
Jim Blandy
c7872ab8b5 Eliminate wgpu_core::commands::bundle::State::raw_dynamic_offsets.
This vector's contents always ended up identical to the
`RenderBundleEncoder`'s `BasePass`'s `dynamic_offsets` vector, so
we can just take values from there instead of copying them.
2022-05-22 08:38:47 -07:00
Jim Blandy
87d75d9c7b Document command::BasePass. 2022-05-22 08:38:47 -07:00
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
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
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
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
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
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
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
Jim Blandy
72dd9d77db Document GpuFuture. 2022-05-06 18:56:26 -07:00
Jim Blandy
85b4815f83
Rename timeout_us to timeout_ns, to match actual units. (#2645) 2022-05-06 21:32:30 -04:00
Hiroaki Yutani
af259aa12a
Exclude dependencies from documents (#2642) 2022-05-04 17:35:45 -04:00
Jim Blandy
ee3d23d546
Raise wgpu_hal::MAX_COLOR_TARGETS to 8. (#2640) 2022-05-03 04:07:15 -04:00
Aaro Perämaa
51dbe23095
Update push constant docs to reflect the API (#2637) 2022-05-03 05:04:28 +00:00
Emilio Cobos Álvarez
a613a568b6
Update parking_lot. (#2639) 2022-05-03 04:28:17 +00:00
Zen
6fadbdecf2
Update lib.rs (#2634) 2022-05-02 01:17:12 +00:00
Ashley
ebca3298f0
Remove gles compressed texture log::error! (#2630) 2022-04-25 17:38:57 -04:00
Connor Fitzgerald
e54a36ee78
Move texture-array example over to wgsl (#2618) 2022-04-25 18:32:53 +00:00
Connor Fitzgerald
bc850d2a0e
Bind group deduplication (#2623) 2022-04-25 04:19:25 +00:00
Jim Blandy
c226a10329
Specify an exact wasm-bindgen-cli version in publish.yml. (#2624)
The versions of wasm-bindgen-cli run by `.github/workflows/publish.yml` must
exactly match the version of `wasm-bindgen` used by `wgpu`. At the moment,
`wgpu/Cargo.toml` specifies `0.2.76`, and our `Cargo.lock` says `0.2.78`, so
the latter is what `publish.yml` should mention.
2022-04-21 20:57:35 +00:00
Dragoș Tiselice
59d640a107
metal: Don't skip incomplete binding resources. (#2622) 2022-04-21 19:49:33 +00:00
Jinlei Li
8feac35033
Update texture_create_view logic to match spec (#2621) 2022-04-21 12:08:13 -04:00
Jinlei Li
5706263917 Rename dispatch -> dispatch_workgroups 2022-04-20 23:24:21 -07:00
Ashley
ff07716f79
Do a downlevel check for anisotrophy and enable it in the webgl backend (#2616)
* Do a downlevel check for anisotrophy and enable it in the webgl backend

* Run cargo fmt

* Change to sample_parameter_i32
2022-04-20 20:56:16 -04:00
Jinlei Li
0b61a19124 metal: fix some supported limits 2022-04-18 20:40:03 -07:00
Jim Blandy
6d7c092dad Update Naga to 85056524 (2022-4-18). 2022-04-18 20:27:42 -07:00
Jim Blandy
06ee8a6862 Permit non-struct, non-array types as buffers.
Fixes #2583.
2022-04-18 09:50:51 -07:00
Jim Blandy
3d10678a91 Update to Naga 0e2bb019. 2022-04-18 09:09:47 -07:00