Commit Graph

402 Commits

Author SHA1 Message Date
Dzmitry Malyshau
2158cdd43b hal/dx12: pass null to mapping rects 2021-07-23 12:19:59 -04:00
bors[bot]
35896df3b7
Merge #1716
1716: Update winit to 0.25 r=kvark a=Gordon-F

**Connections**


**Description**
Update winit to 0.25

**Testing**
Examples


Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-07-23 15:05:45 +00:00
Dzmitry Malyshau
8dc4942431 Update naga to bbfa9a0, tweak DX12 debug output 2021-07-23 10:48:32 -04:00
Gordon-F
f0b1d5a673 Update winit to 0.25 2021-07-23 14:30:38 +03:00
Dzmitry Malyshau
2c45796d9c Update Naga to cc91c77 2021-07-23 02:19:42 -04:00
bors[bot]
1f7d60d065
Merge #1713
1713: hal/dx12: rewrite view creation, use arrays more aggressively r=kvark a=kvark

**Connections**

**Description**
D3D12 has this thing where you can't create a 2D view with non-zero base array index.
So we have special logic now to fall back to 2D array views in these cases.

**Testing**
Tested on the Shadow example.


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-23 06:07:18 +00:00
Dzmitry Malyshau
726cf4f614 hal/dx12: rewrite view creation, use arrays more aggressively 2021-07-23 00:07:23 -04:00
munrocket
f909a8e631 update naga revision 2021-07-22 20:52:26 +04:00
Connor Fitzgerald
683d03a8e4 Add Rgb9e5Ufloat 2021-07-21 23:54:46 -04:00
Dzmitry Malyshau
1a9a855ea9 Rename InputStepMode to VertexStepMode 2021-07-21 17:48:00 -04:00
Dzmitry Malyshau
8a971fcf2e hal/vk: use actual view usage for imageless framebuffers 2021-07-21 12:14:20 -04:00
Dzmitry Malyshau
e9a2a1e438 hal/dx12: reset command pool 2021-07-20 10:39:40 -04:00
Dzmitry Malyshau
be13fe3048 hal/dx12: fix the binding model 2021-07-20 10:07:40 -04:00
Dzmitry Malyshau
35145615bf Update naga, use binding map in DX12 2021-07-18 12:03:14 -04:00
initial-algebra
0db00e9657 Implement Feature::SHADER_PRIMITIVE_INDEX on Vulkan 2021-07-17 15:31:35 -03:00
Dzmitry Malyshau
5419947095 hal/vk: relay semaphore 2021-07-16 17:55:03 -04:00
Connor Fitzgerald
0f84c7cf6e Use EGL_KHR_gl_colorspace for srgb if available 2021-07-16 01:03:18 -04:00
xiaopengli89
6e63964e51 fix: readWriteTextureSupport is support on macOS 10.13+ / iOS 11.0 2021-07-15 14:40:05 +08:00
Dzmitry Malyshau
b98cba9bfd hal/dx12: reset scissor and viewport 2021-07-15 02:10:28 -04:00
Dzmitry Malyshau
e2bd9c935c hal/dx12: flip the root signature upside down 2021-07-15 01:37:49 -04:00
Dzmitry Malyshau
22fff526ab dx12/hal: invalidate root elements on signature change 2021-07-14 23:13:08 -04:00
Dzmitry Malyshau
d85e8c6011 Clippy fixes 2021-07-14 16:17:39 -04:00
Dzmitry Malyshau
509b683e6b hal: renderdoc integration 2021-07-14 16:17:39 -04:00
Boris-Chengbiao Zhou
1ecb48db80 hal/vulkan: Respect swapchain's minImageCount 2021-07-14 19:20:17 +02:00
Dzmitry Malyshau
8cd17aafe3 Switch read-only storage textures to be exclusive and behind a feature 2021-07-14 01:04:37 -04:00
Zicklag
2896a6e5f3 Fix Vulkan Backend Texture Format Mapping
Fixes the Bgra8UnormSrgb texture format.

Resolves #1646.
2021-07-13 20:21:47 -05:00
bors[bot]
0f784bb3c0
Merge #1602
1602: New DX12 backend (unfinished) r=kvark a=kvark

**Connections**
Continuation of #1471

**Description**
Mostly fresh implementation on DX12 backend for wgpu-hal
Core changes:
  - texture usage is filtered before passing to `create_texture_view`, so that wgpu-hal can assume every bit is important.
  - all the copies involving textures are limited to one array layer at a time
  - remove render pass boundary usages

**Testing**
Examples (not running yet)


Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-13 22:26:44 +00:00
Zicklag
f0c7e990f7 Disable Intel Fastclear in GL Backend
This works around a Mesa bug on Intel cards:

- https://gitlab.freedesktop.org/mesa/mesa/-/issues/2565
- https://github.com/gfx-rs/wgpu/issues/1627#issuecomment-877854185
2021-07-13 11:21:06 -05:00
Dzmitry Malyshau
0df804e9c2 hal/dx12: bunch of validation fixes 2021-07-13 02:54:37 -04:00
Dzmitry Malyshau
7fb0315700 hal/dx12: build fixes for the new arrayvec 2021-07-13 01:11:47 -04:00
Dzmitry Malyshau
450e5dc08b hal/dx12: queue operations 2021-07-13 01:04:08 -04:00
Dzmitry Malyshau
8163dc7b47 hal/dx12: pipeline creation 2021-07-13 01:04:07 -04:00
Dzmitry Malyshau
0a609e74c0 hal/dx12: compute pipelines, update naga 2021-07-13 01:04:06 -04:00
Dzmitry Malyshau
040a602b69 hal/dx12: bind group creation 2021-07-13 01:03:45 -04:00
Dzmitry Malyshau
7d29a3b70e hal/dx12: binding resources and index/vertex buffers 2021-07-13 01:03:44 -04:00
Dzmitry Malyshau
c0432761d9 hal/dx12: use range-alloc for descriptor heaps 2021-07-13 01:03:15 -04:00
Dzmitry Malyshau
ba1bff58ed hal/dx12: attachment clears and resolvess 2021-07-13 01:03:14 -04:00
Dzmitry Malyshau
00859b9e0c Stop using render pass boundary usages for resource transitions 2021-07-13 01:02:42 -04:00
Dzmitry Malyshau
12bc3eb3fc hal/dx12: set render targets 2021-07-13 01:01:31 -04:00
Dzmitry Malyshau
81f31f5555 hal: change blend color argument 2021-07-13 01:01:30 -04:00
Dzmitry Malyshau
1f91c5f297 hal/dx12: debug markers 2021-07-13 01:01:30 -04:00
Dzmitry Malyshau
27b8085048 hal/dx12: queries 2021-07-13 01:01:29 -04:00
Dzmitry Malyshau
b818157f67 hal/dx12: draws and dispatches 2021-07-13 01:01:28 -04:00
Dzmitry Malyshau
9069c2301f hal/dx12: implement fill_buffer with zero 2021-07-13 01:01:28 -04:00
Dzmitry Malyshau
2c76b0e656 hal/dx12: clippy fixes, buffer-texture copies 2021-07-13 01:01:27 -04:00
Dzmitry Malyshau
35ee65707f hal: make copy to work on one array layer at a time 2021-07-13 01:01:26 -04:00
Dzmitry Malyshau
f79c3781c3 hal/dx12: buffer-buffer and texture-texture copies 2021-07-13 01:01:25 -04:00
Dzmitry Malyshau
4f6812fc36 hal/dx12: resource barriers 2021-07-13 01:01:25 -04:00
Dzmitry Malyshau
43a39a229e hal/dx12: command pooling 2021-07-13 01:01:24 -04:00
Dzmitry Malyshau
e128021aee hal/dx12: pipeline layout 2021-07-13 01:01:23 -04:00
Dzmitry Malyshau
904621ee19 hal/dx12: sampler and query set creation 2021-07-13 01:01:23 -04:00
Dzmitry Malyshau
04ca3212de hal/dx12: intercept debug output 2021-07-13 01:01:22 -04:00
Dzmitry Malyshau
855689462c hal/dx12: fences 2021-07-13 01:01:21 -04:00
Dzmitry Malyshau
c7519432ee Filter texture usages on view creation 2021-07-13 01:01:21 -04:00
Dzmitry Malyshau
925ece8b40 hal/dx12: creation of RTV/DSV/UAV 2021-07-13 01:01:20 -04:00
Dzmitry Malyshau
23615aa55d hal/dx12: texture and view creation 2021-07-13 01:01:19 -04:00
Dzmitry Malyshau
c01f6a557e hal/dx12: enable the backend in wgpu-core 2021-07-13 01:01:19 -04:00
Dzmitry Malyshau
971aee0e1c hal/dx12: buffer creation, device idling 2021-07-13 01:01:18 -04:00
Dzmitry Malyshau
0942fb1346 hal/dx12: swap chain configuration 2021-07-13 01:01:17 -04:00
Dzmitry Malyshau
eb565a59f7 hal/dx12: move device and encoder into modules 2021-07-13 01:01:17 -04:00
Dzmitry Malyshau
3a2bbfd563 hal/dx12: adapter initialization 2021-07-13 01:01:16 -04:00
Zicklag
7e837ffcdc Enable VK_KHR_timeline_semaphore On Vulkan < 1.2 2021-07-12 18:51:38 -05:00
Connor Fitzgerald
6c1dd5e153 Always use EXT Robustness 2021-07-11 22:28:45 -04:00
bors[bot]
4781d9da7b
Merge #1607
1607: Fix Downlevel Vertex Stage Storage Buffer Check r=kvark a=cwfitzgerald

**Connections**

Fixes a bug in #1599. Also follows up on #1583 marking all of hello-compute as a failure.

**Testing**

Tests now pass on rpi4.


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-07 14:01:37 +00:00
Connor Fitzgerald
8ded21862e Fix downlevel vertex stage storage buffer check 2021-07-06 21:43:47 -04:00
bors[bot]
d2a27e0c4e
Merge #1604
1604: Upgrade `arrayvec` to 0.7 r=kvark a=a1phyr

Upgrade `arrayvec` to version 0.7 (using const generics).

Co-authored-by: Benoît du Garreau <bdgdlm@outlook.com>
2021-07-06 05:31:22 +00:00
Dzmitry Malyshau
2efccb2bf8 hal/vk: fix indirect stage flag 2021-07-06 00:56:43 -04:00
Mikko Lehtonen
7e277c2ed9 Fix macos build 2021-07-06 02:08:19 +03:00
Benoît du Garreau
e7269e72f3 Upgrade arrayvec to 0.7 2021-07-06 00:45:24 +02:00
bors[bot]
118cf2cdba
Merge #1599
1599: Fix Limits for lava/llvmpipe and re-enable and re-work CI r=kvark,groves,wumpf a=cwfitzgerald

**Connections**

No longer fixes #1551.

**Description**

This PR has a couple things going on at once.

- Fixes limits for llvmpipe, lavapipe, and rpi4.
- Added a downlevel limit to express that RPI4 does not allow storage buffers in vertex shaders on GL.
- Added a `Limits::downlevel_default()` that takes minimum limits from GLES and adds some more documentation on how to choose limits.
- Moved all examples to the new downlevel limits
- Reworks CI to re-enable software testing and unify instructions.

**Testing**

It is

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-04 19:23:23 +00:00
Connor Fitzgerald
130ddcf561 Unify CI and testing 2021-07-04 15:22:51 -04:00
Dzmitry Malyshau
3de1681eb0 hal/vk: enable timeline semaphores 2021-07-04 00:50:05 -04:00
Dzmitry Malyshau
8ae7d51c82 hal/vk: request timeline semaphores if available 2021-07-04 00:50:05 -04:00
Connor Fitzgerald
26f3c03150 Add downlevel limit for vertex shader access to SSBO 2021-07-03 22:15:16 -04:00
bors[bot]
762cdb3953
Merge #1589
1589: [GL] Fix min_storage_buffer_offset_alignment param r=kvark a=Gordon-F

**Connections**
Android Emulator (11) error:
```
2021-07-02 14:49:12.500 8292-8317/rust.example.cube E/emuglGLESv2_enc: device/generic/goldfish-opengl/system/GLESv2_enc/GL2Encoder.cpp:s_glGetIntegerv:876 GL error 0x500
```

**Description**
As a workaround set this parameter to default value.


Co-authored-by: Gordon-F <ishaposhnik@icloud.com>
2021-07-04 00:33:32 +00:00
Dzmitry Malyshau
a4a4d541b8 hal/metal: bump storage limits 2021-07-03 20:26:15 -04:00
Gordon-F
a077102457 [GL] Fix min_storage_buffer_offset_alignment param 2021-07-03 22:45:45 +03:00
bors[bot]
edbe3b33fa
Merge #1593
1593: Fix VVL on halmark example r=kvark a=kvark

**Connections**
We have a bunch of VVL related to resource destruction on the halmark example.
It also seems to leak memory quite a ton and eventually hang the system.

**Description**
This PR fixes the logic of changing the command pools in halmark, its initialization sequence, and its destruction.

**Testing**
Tested on halmark and others


Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-07-03 05:13:18 +00:00
Dzmitry Malyshau
e2f97ea659 hal/gles: detect llvmpipe instead of lavapipe 2021-07-03 01:09:39 -04:00
Dzmitry Malyshau
497c6647ee hal/vulkan: fix instance destruction logic 2021-07-03 01:07:21 -04:00
Dzmitry Malyshau
b15f1ebfb7 halmark: fix the command pool recycling policy 2021-07-03 00:23:11 -04:00
Dzmitry Malyshau
81b382f5cd Readme and clippy fixes 2021-07-02 20:43:01 -04:00
Clayton Walker
25c452cbdd Add metal layer back in 2021-07-02 15:51:11 -06:00
bors[bot]
df2b0b5843
Merge #1585
1585: hal/egl fix support for context extensions r=cwfitzgerald a=kvark

**Connections**
Follow-up to #1584
Closes  #1577

**Description**
TIL that EGL extensions work differently from the EGL-1.5 stuff, and we are now treating them properly.

**Testing**
Basic testing on AMD


Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
2021-07-02 19:29:15 +00:00
Dzmitry Malyshau
67625b2a54 hal/egl fix support for context extensions 2021-07-02 15:23:06 -04:00
bors[bot]
43c26e57e0
Merge #1588
1588: Update naga to 0b9af95 r=kvark a=kvark

**Connections**
Picks up https://github.com/gfx-rs/naga/pull/1060 for #1581

**Description**
Naga update

**Testing**
Untested


Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2021-07-02 06:00:13 +00:00
Dzmitry Malyshau
ba8fcb937d Update naga to 0b9af95 2021-07-02 01:58:19 -04:00
Dzmitry Malyshau
34389396f9 hal/metal: mark buffer immutability 2021-07-02 01:52:28 -04:00
bors[bot]
871cbed18a
Merge #1584
1584: Update testing limits for rpi4 r=kvark a=cwfitzgerald

**Connections**

Related to #1574. Exposed #1583.

**Description**

Changes the reftesting limits to be tolerant of how the RPI4 renders. Fixes the debug half of #1577. 

Fixes some naming issues as well.

**Testing**

It is


Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2021-07-02 04:34:55 +00:00
Connor Fitzgerald
f76200e725 Update testing limits for rpi4 2021-07-02 00:13:33 -04:00
Dzmitry Malyshau
579de425e5 hal/vk: fix sampler default LOD range 2021-07-02 00:05:36 -04:00
Dzmitry Malyshau
ba006cfaa7 Rename ColorWrite, TextureUsage, and BufferUsage 2021-06-30 14:57:38 -04:00
Dzmitry Malyshau
568ac3fa24 Switch all bitflag names to plural 2021-06-30 14:43:36 -04:00
Dzmitry Malyshau
6f13eebb7b hal/gles: compressed ETC2 texture support 2021-06-30 12:06:59 -04:00
Dzmitry Malyshau
45074b2939 hal: more implementation comments 2021-06-30 02:31:13 -04:00
Dzmitry Malyshau
4be8864b38 hal/gles: totally rework the vertex data binding 2021-06-30 02:31:13 -04:00
Dzmitry Malyshau
40e2c33c6f hal/gles: hack around cubemap support 2021-06-30 02:29:30 -04:00
Dzmitry Malyshau
582c128520 Pick up naga's GLSL continuing and Y-flip fixes 2021-06-30 02:29:30 -04:00
Dzmitry Malyshau
3a796c2244 hal/gles: fix buffer mapping 2021-06-30 02:29:30 -04:00
Dzmitry Malyshau
6025a8d25e hal/gles: enable robust access by default 2021-06-30 02:29:29 -04:00
Dzmitry Malyshau
25ec7447e2 hal/gles: improve the exposed limits 2021-06-30 02:29:29 -04:00
Dzmitry Malyshau
e4aee90341 hal/gles: object labels, view dimensions, and buffer clears 2021-06-30 02:29:29 -04:00
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]
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]
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]
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]
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]
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
Dzmitry Malyshau
e21e9c838c halmark: change instance flags 2021-06-17 21:10:13 -04:00
Dzmitry Malyshau
7c61fa481f Refactor halmark example to properly recycle command pools 2021-06-17 21:03:57 -04:00
Dzmitry Malyshau
c73ce25f42 hal/vk: update the fence value 2021-06-17 16:29:23 -04:00
Dzmitry Malyshau
220f359535 Address review notes 2021-06-17 14:18:30 -04:00
Dzmitry Malyshau
0b506afc60 hal/vk: use non-coherent-atom-size 2021-06-16 23:52:04 -04:00
Dzmitry Malyshau
7410b700d6 fix swapchain recycling, copies, device destruction, RODS 2021-06-16 23:18:50 -04:00
Dzmitry Malyshau
54d7391df0 Minor tweaks to make CI happy 2021-06-16 20:28:45 -04:00
Dzmitry Malyshau
fb662dfbec hal/vk: polishing to run halmark with no validation issues 2021-06-16 17:15:34 -04:00
Dzmitry Malyshau
c53addac8a hal/vk: draws and dispatches. Refactor query set descriptor 2021-06-16 14:17:37 -04:00
Dzmitry Malyshau
1952ecb99c hal/vk: enable vulkan portability support on macos 2021-06-16 11:42:37 -04:00
Dzmitry Malyshau
67dfdb9193 hal/vk: debug markers, bind groups, viewports 2021-06-16 02:05:34 -04:00
Dzmitry Malyshau
bc6bb0c3df hal/vk: render passes and queries 2021-06-16 01:26:14 -04:00
Dzmitry Malyshau
6f655e0b14 hal/vk: barriers and copies 2021-06-15 15:58:12 -04:00
Dzmitry Malyshau
a260cff0f0 hal/vk: queue operations 2021-06-15 11:38:07 -04:00
Dzmitry Malyshau
668fedd1c0 hal: rename aux to util 2021-06-15 01:33:19 -04:00
Dzmitry Malyshau
00de15990e hal/vk: pipeline creation 2021-06-15 01:24:25 -04:00
Dzmitry Malyshau
9d85602349 hal: re-architect command encoding and pooling 2021-06-14 13:30:28 -04:00
Dzmitry Malyshau
d8979cad4a hal/vk: command pools, clippy warnings 2021-06-14 10:26:40 -04:00
Dzmitry Malyshau
c2bb2d5dfc Experimental command pool API 2021-06-14 01:58:09 -04:00
Dzmitry Malyshau
4eae5a38d0 hal/vk: hook up gpu-descriptor 2021-06-12 01:04:15 -04:00
Dzmitry Malyshau
006c1baaf2 hal/vk: pipeline layout, object labels and logging 2021-06-11 20:23:15 -04:00
Dzmitry Malyshau
61e2e242cd hal/vk: textures and samplers 2021-06-11 19:14:41 -04:00
Dzmitry Malyshau
b4380e4576 hal/vk: buffer and texture creation 2021-06-11 15:53:07 -04:00
Dzmitry Malyshau
9ae5e36ad8 hal/vk: format mapping 2021-06-11 14:27:00 -04:00
Dzmitry Malyshau
dc340421c4 hal/vk: instance and adapter 2021-06-11 02:09:29 -04:00
Dzmitry Malyshau
75b6ecea58 hal: Fix iOS build 2021-06-10 17:09:46 -04:00
Dzmitry Malyshau
e345ad1c64 hal: make example to destroy temporary views 2021-06-10 16:55:17 -04:00
Dzmitry Malyshau
faf8f7e890 Simple API for coherent mapping 2021-06-10 16:05:44 -04:00
Dzmitry Malyshau
d88aa99997 Fix rows-per-image treatment, clippy warnings 2021-06-10 15:43:21 -04:00
Dzmitry Malyshau
38e13a178b hal/mtl: array length support 2021-06-10 14:22:32 -04:00
Dzmitry Malyshau
006f8abbba build and clippy fixes, command buffer cleanup 2021-06-10 12:44:29 -04:00
Dzmitry Malyshau
317237771e hal: rename bunnymark to halmark 2021-06-10 11:29:35 -04:00
Dzmitry Malyshau
782c72d32c hal/mtl: queue 2021-06-10 10:54:06 -04:00
Dzmitry Malyshau
3109b1b63d hal/mtl: most of the command encoding 2021-06-10 02:31:31 -04:00
Dzmitry Malyshau
bdaf57dbed hal/mtl: pipelines and fences 2021-06-09 23:38:48 -04:00
Dzmitry Malyshau
9f904700ee hal/mtl: creation of bind groups 2021-06-09 17:06:43 -04:00
Dzmitry Malyshau
f46459c589 hal/mtl: buffer, texture, and view creation 2021-06-09 01:51:45 -04:00
Dzmitry Malyshau
3475d839f9 hal/metal: instance,adapter, and surface 2021-06-09 00:55:49 -04:00
Dzmitry Malyshau
6d229847be hal: redesign the bind group descriptor 2021-06-08 17:12:28 -04:00
Dzmitry Malyshau
a0b51ce35c hal: remove the cows 2021-06-08 15:18:06 -04:00
Dzmitry Malyshau
502c57501f hal: bunnymark example 2021-06-08 14:58:48 -04:00
Dzmitry Malyshau
a421c1c8b6 Instance plumbing 2021-06-08 11:46:53 -04:00
Dzmitry Malyshau
ff2a3e84fc update synchronization, fix last errors in wgc 2021-06-08 02:03:44 -04:00
Dzmitry Malyshau
0a82c232ba hal: port the rest of wgpu-core 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
c61ee1262b hal: transfer operations 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
6d51fab864 hal:: Fill the command buffer calls 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
738ae2b227 Surface API 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
bae3c694bd Documentation update 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
0ea4cac04b Rework shader and pipeline creation 2021-06-08 00:46:08 -04:00
Dzmitry Malyshau
569cd0cdd6 WIP new wgpu-hal 2021-06-08 00:46:08 -04:00