Commit Graph
1200 Commits
Author SHA1 Message Date
Dzmitry Malyshau 403ff6faf8 hal/gles: Update glow and fill up the missing methods 2021-06-30 02:29:29 -04:00
Dzmitry Malyshau bf61908824 hal/gles: primitive state and framebuffer operations 2021-06-30 02:29:29 -04:00
Dzmitry Malyshau 952173efde Enable Gles backend, add checks for downlevel flags 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau cf10138c64 hal/egl: add coherence preference, hook up EGL_KHR_debug message callbacks 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau 8fd6b36e6c hal/egl: add coherence preference, hook up EGL_KHR_debug message callbacks 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau c7356e124e hal/gles: storage texture bindings 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau 673ec60396 hal/gles: resource binding 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau 91df157462 Refactor downlevel support a bit, implement blending for hal/gles 2021-06-30 02:29:28 -04:00
Dzmitry Malyshau 13b0a61dc8 hal/gles: stencil and vertex state 2021-06-30 02:29:27 -04:00
Dzmitry Malyshau 205327d3aa hal/gles: barriers 2021-06-30 02:29:27 -04:00
Dzmitry Malyshau 51dd90b1ab hal/gles: render passes 2021-06-30 02:29:27 -04:00
Dzmitry Malyshau 24ff58c6c1 hal/gles: present, texture format caps 2021-06-30 02:29:27 -04:00
Dzmitry Malyshau 91f9806831 hal/gles: fences and queries 2021-06-30 02:29:27 -04:00
Dzmitry Malyshau d3d2ed5a9e hal/gles: pipeline creation 2021-06-30 02:29:27 -04:00
Dzmitry Malyshau d29c450ec3 hal/gles: bind group creation 2021-06-30 02:29:26 -04:00
Dzmitry Malyshau 85e59c3d7f hal/gles: texture copies 2021-06-30 02:29:26 -04:00
Dzmitry Malyshau b1fe86589a hal/gles: queue module 2021-06-30 02:29:26 -04:00
Dzmitry Malyshau 4d42bef7f8 hal/gles: encoding copies and draws 2021-06-30 02:29:26 -04:00
Dzmitry Malyshau 31da0f2278 hal/gles: command module 2021-06-30 02:29:26 -04:00
Dzmitry Malyshau 31e6ed82cb hal/gles: creation of buffers, textures, view, and samplers 2021-06-30 02:29:26 -04:00
Dzmitry Malyshau 5083f56149 Add more downlevel flags, implement device opening on Gles 2021-06-30 02:29:26 -04:00
Dzmitry Malyshau 804b17bb29 hal/gl: version parsing 2021-06-30 02:29:25 -04:00
Dzmitry Malyshau d88bc440e6 hal/gles: describe format, adapter info 2021-06-30 02:29:25 -04:00
Dzmitry Malyshau 41bc9d0625 hal/gl: start the backend, port the Instance 2021-06-30 02:29:25 -04:00
Andreas Reich 9aa251c675 fix conservative rasterization for vulkan 2021-06-28 21:08:06 +02:00
Alex S 2828100143 Reduce feature flag surface for descriptor arrays.
DYNAMIC_INDEXING is checked by default, since WGPU doesn't allow
for any kind of specialization constants and constant indexing is
nigh useless.

STORAGE_RESOURCE_BINDING_ARRAY is enabled iff the device supports:
- both or neither of uniform and buffer arrays with dynamic indexing;
- both or neither of sampled and storage images with dynamic indexing.

NONUNIFORM_INDEXING is enabled iff for ALL types of descriptor arrays
*that are supported for dynamic indexing*, nonuniform indexing is
also allowed.

These flags have a limitation in that some platforms
(eg.
https://vulkan.gpuinfo.org/displayreport.php?id=11692#features_core_12)
may support a strange subset of those features (example device
supporting non-uniform indexing for textures and storage buffers,
but NOT for storage textures or uniform buffers). In that case feature
will be reported as missing, even though it is partially present.

In the author's opinion, this flag set is convenient for the
users to query; however, due to aforementioned limitations, it would be
desirable to obtain statistics about "edge-case" platforms and what
percentage of reports they comprise.
2021-06-28 14:44:00 +03:00
bors[bot]andAndreas Reich 8332493d3d Merge #1559
1559: Query support fixes r=kvark a=Wumpf

**Connections**
Fixes #1374 for master
If PR is accepted,I already have a fix for 0.9 which came out as a sideproduct: https://github.com/Wumpf/wgpu/tree/v0.9-fix-buffer-init-on-query-resolve

**Description**
Fixes:
* (affects master, v0.8, v0.9) query resolve operation not marking buffers as initialized
* (affects master) Broken query stride handling for Vulkan
* (affects master) Vulkan not advertising query support

**Testing**
* added new test
* mipmap sample


Co-authored-by: Andreas Reich <r_andreas2@web.de>
2021-06-27 14:27:27 +00:00
Andreas Reich b44b5eded9 Fix query stride handling
Fixes #1374
2021-06-27 11:20:38 +02:00
Dzmitry Malyshau 5ca1fe58e9 Update naga to 57b3256020 2021-06-27 01:44:49 -04:00
Andreas Reich 11b5e10c38 Fix Vulkan not advertising TIMESTAMP_QUERY & PIPELINE_STATISTICS_QUERY 2021-06-26 14:34:44 +02:00
Connor Fitzgerald b060bf1afe Assorted touchups 2021-06-23 20:23:19 -04:00
Dzmitry Malyshau b8f430551b hal/mtl: fix supportsFamily call 2021-06-22 22:13:36 -04:00
Dzmitry Malyshau 36939477c5 Test wgpu-rs more on CI 2021-06-22 17:23:32 -04:00
bors[bot]andAlex S 96dbd06a1f Merge #1525
1525: Add Naga bypass to allow feeding raw SPIR-V shader data to the backend. r=kvark a=ElectronicRU

**Connections**
Fixes #1520 .

**Description**
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.

**Testing**
`texture_arrays` example is runnable now, which uncovers an additional bug in Vulkan backend - binding arrays are instead treated like sole bindings, and indices shift, too. Lots of errors from validation layer ensue.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 16:13:53 +00:00
Alex S 7cd7b18560 Code review:
- Remove Cow from wgpu-hal API surface. You graze on in our hearts.
- Rename feature flag to SPIRV_SHADER_PASSTHROUGH in anticipation
  of crate feature `spirv` to reduce confusion.
- Add some more documentation about behaviour and intended avenues of
  use to the feature.
2021-06-20 15:22:04 +03:00
bors[bot]andAlex S 6cacfca10b Merge #1527
1527: Fix wgpu-hal incorrectly ignoring arrays of bindings. r=kvark a=ElectronicRU

**Connections**
Fixes #1526.

**Description**
Even though binding sizes could potentially be derived from resource array lengths and binding indices, current implementation
flat out ignored that. Metal did a more sensible (?) thing and bound only the first resource in each array, Vulkan did a less
sensible thing and bound as many resources as there are bindings, obtaining them from unwrapped arrays.
(IE on Vulkan, if you bound two arrays, [view1, view2] and [view3, view4], it would actually bind [view1, <invalid>] and [view2, <invalid>]).

This aims to fix the issue.

**Testing**
After #1525 is merged, `cargo run --example texture-arrays` would be working as intended for Vulkan. Unfortunately, I can think of no easy way to test this on Metal - the shader support isn't there yet.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-20 05:08:12 +00:00
Alex S a82062595a Code review:
Remove .size field from BindGroupEntry, since this information
can be obtained from the layout.
2021-06-20 06:53:03 +03:00
Alex S 8bfa949261 Code review:
- rename ShaderInput variants
- rename feature flag
- hard error on Metal backend trying to compile SPIR-V
- fix test failing because of feature flag bits changing
2021-06-20 06:22:59 +03:00
Alex S b0ba01dba6 ...And add the feature flag to Vulkan, which previously worked by accident. 2021-06-20 05:12:19 +03:00
Alex S 7e6d6a33ed Fix (?) texture array binding for Metal.
Potentially needs more testing - Metal's binding model is quite
different from Vulkan and WGPU, but as far as I understand from the
documentation, arrays of textures occupy a contiguous range of binding
slots, so unwrapping and binding one-by-one should be fine.

Someone should actually go and test this on a Mac, maybe.
2021-06-19 23:35:48 +03:00
Alex S dd4c681a2f Fix HAL binding for Vulkan. 2021-06-19 23:35:18 +03:00
Alex S 6d2e6e5a56 Add Naga bypass to allow feeding raw SPIR-V shader data to the backend.
While Naga checking is undoubtedly very useful, it currently lags behind
what is possible in SPIR-V and even what is promised by WGPU (ie binding
arrays). This adds an unsafe method to wgpu::Device to allow feeding
raw SPIR-V data into the backend, and adds a feature flag to request a
backend supporting this operation.
2021-06-19 23:32:44 +03:00
Gordon-F 2873ac32d9 Remove MPL 2.0 header in files 2021-06-19 21:06:08 +03:00
bors[bot]andAlex S a8be371acf Merge #1521
1521: Better compile error for not using resolver=2. r=kvark a=ElectronicRU

**Connections**
Usability fix proposed in #1517 with some re-wording to make the intent clearer.

**Description**
Provide a useful compile error in case a downstream project is using old Cargo resolver, instead of the deluge of obscure errors they get r/n if not on MacOS.

**Limitations**
On MacOS, vulkan feature is totally valid, so we cannot detect resolver=1 on Mac.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-19 15:08:13 +00:00
Alex S 1dea443340 Better compile error for not using resolver=2. 2021-06-19 17:36:50 +03:00
Alex S 70168ee0f5 Query optimal tiling features for Vulkan.
Images are always created with vk::ImageTiling::OPTIMAL,
so it doesn't make much sense querying linear tiling features.
2021-06-19 17:25:39 +03:00
Alex S 1b96f1a27e Add TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES to supported for Vulkan and Metal.
Adapter callbacks are already there, so this is likely an oversight.
2021-06-19 17:25:39 +03:00
bors[bot]andAlex S 1d2efb43bc Merge #1511
1511: Added storage texture array support. r=kvark a=ElectronicRU

**Description**
Arrays of storage images (*f*image*n*D in GLSL parlance) should now be supported.
I also took the liberty to refactor texture format checking a bit,
and tighten up sampled texture support detection for Metal as well.

**Testing**
Not completely sure what's the proper testing approach here, open to suggestions.


Co-authored-by: Alex S <alex0player@gmail.com>
2021-06-18 21:38:54 +00:00
Connor Fitzgerald f49c50442f Update naga to gfx-26 2021-06-18 13:15:28 -04:00
Alex S 52fab481e6 Added storage texture array support.
I also took the liberty to refactor texture format checking a bit,
and tighten up sampled texture support detection for Metal as well.
2021-06-18 19:20:37 +03:00