Commit Graph
109 Commits
Author SHA1 Message Date
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
Riccardo Zaglia d46c39af1d FIx raw Vulkan API 2021-10-22 21:53:20 -04:00
Dzmitry Malyshau 47fb0efb2c ETC2 texture format refactor (#2064) 2021-10-13 13:42:44 -04:00
Wumpf a28c52873f Move clear_texture impl from wgpu-hal to wgpu-core (#2046)
* new test for clearing textures of all formats

* clear_texture is now always implemented in wgpu-core instead of wgpu-hal

* add 1D/array/volume texture to clear_texture test

* set mip_level_count to 1 for D1 textures in clear_texture test

* fix warning & clippy lints

* Fix web build

* [pr feedback] fix potentially skipped resource transition, fix wrong mip size for texture clear

* collect_zero_buffer_copies_for_clear_texture aligns rows now properly
2021-10-13 13:42:13 -04:00
Dzmitry Malyshau d48bc62826 hal/vk: check for NV optimus 2021-10-09 16:33:45 -04:00
Dzmitry Malyshau dfa4948033 Update naga to 0e3fbc8 2021-10-07 08:32:01 -04:00
Connor Fitzgerald 647f6ee9f2 Disable partially bound arrays on intel/windows 2021-10-05 08:57:33 -04:00
Connor Fitzgerald c3d906856f Add spans to provide more information profile gaps 2021-10-03 22:54:15 -04:00
Connor Fitzgerald b679342d9e Support descriptor arrays shorter than binding length 2021-09-30 14:11:51 -04:00
João Capucho 9bc5908492 Add method to create shader modules without runtime checks (#1978)
* Add method to create shader modules without runtime checks

* Use opaque struct to represent shader bound checks
2021-09-27 19:51:44 +00:00
Connor Fitzgerald ff8f258b95 Fix VK and GL renderdoc captures 2021-09-21 18:41:16 -04:00
Dzmitry Malyshau 87c8680ffd hal/vk: Enable image robustness where available 2021-09-19 15:18:37 -04:00
Dzmitry Malyshau c8436de1ec Force point size output on Vulkan 2021-09-15 19:15:23 -04:00
Dzmitry Malyshau 180dc27144 Work around Adreno's OpName bug 2021-09-08 22:24:27 -04:00
Connor Fitzgerald 809909137c Merge pull request #1919 from kvark/spv
vulkan: compile shader modules at pipeline creation time
2021-09-08 17:25:50 -04:00
Luke Street 76bcd9c494 Implement min_{uniform,storage}_buffer_offset_alignment limits (#1923)
* Implement min_{uniform,storage}_buffer_offset_alignment limits

* Add Limits::using_alignment

* Update docs & examples

* Create binding_model::buffer_binding_type_alignment fn
2021-09-08 13:53:02 -04:00
Dzmitry Malyshau e00bfac6cf vulkan: compile shader modules at pipeline creation time 2021-09-07 20:06:16 -04:00
Dzmitry Malyshau 076031c1ba hal: switch texture copies to expect physical sizes (#1908) 2021-09-07 13:13:11 +00:00
Zhixing Zhang 66979eb68d add missing capability (#1911) 2021-09-07 01:30:50 +00:00
Wumpf df2a686c29 Reintroduce clear_texture Metal/Vulkan/DX12 (#1905)
* enable CLEAR_COMMANDS feature for all adapters

* replaced fill_buffer with clear_buffer (minus variable value)

* Improve clear buffer/texture test
and remove unused clear-buffer.ron test

* renamed clear_image to clear_texture

* skeleton for new wgpu-hal clear_texture

* clear_texture implementation for vulkan

* clear_texture now restricts usage

* clear_texture implementation for dx12

* Implemented clear_texture for Metal backend

* Clean up GLES clear_buffer and leave note on how to implement clear_texture in the future

* fix linux compilation & formatting issues

* comment & namespace fixes

* Extent3d has now a simple mipmap calculating function

Fix incorrect use of texture.size in clear_texture for metal/dx12
Fix incorrect mip/layer ranges in clear_texture for metal/dx12
2021-09-06 21:14:40 -04:00
Connor Fitzgerald 938c069608 Properly implement timestamp periods (#1907) 2021-09-04 22:24:15 -04:00
Dzmitry Malyshau d23288e455 hal/linux: Work around Intel+Nvidia presentation conflict 2021-09-02 14:50:05 -04:00
Dzmitry Malyshau 3ced8bf892 hal/vk: always request StorageImageExtendedFormats in SPIR-V 2021-09-01 19:08:01 -04:00
Connor Fitzgerald 41c96a6574 Implement Debug Markers for Vulkan 2021-09-01 16:32:49 -04:00
Christofer Nolander 06316c1bac hal/metal: support Features::NON_FILL_POLYGON_MODE (#1885)
* hal/metal: support Features::NON_FILL_POLYGON_MODE

* Document Metal support for NON_FILL_POLYGON_MODE

* Split Features::NON_FILL_POLYGON_MODE in two

Adds two new features: `LINE_POLYGON_MODE` and `POINT_POLYGON_MODE`.

Allows metal to support `PolygonMode::Line` while not being required to
support `PolygonMode::Point`.

* Formatting

* Rename {LINE,POINT}_POLYGON_MODE to POLYGON_MODE_{LINE,POINT}
2021-08-31 16:20:38 +00:00
Riccardo Zaglia 0a2be6099c Add Texture::as_hal() 2021-08-31 10:30:23 -04:00
Riccardo Zaglia 1c086a51ff hal/vk: Allow non-owned Instance and Device from raw; allow owned Texture from raw 2021-08-25 00:34:19 -04:00
Dzmitry Malyshau 590ef1d8cf Switch naga to latest on git (#1858) 2021-08-24 18:20:44 -04:00
Dzmitry Malyshau 9da5c1d3a0 Release v0.10 (#1820)
* Release v0.10

* hal/gles: update glow handles logic
2021-08-18 19:06:21 +00:00
Connor Fitzgerald 3afab9c5aa Splits non-uniform indexing into two different features (#1785) 2021-08-10 22:43:08 -04:00
Dzmitry Malyshau 552a5f138e Rename texture usage names 2021-07-28 00:17:54 -04:00
bors[bot]andRiccardo Zaglia 3eb3eed8cf Merge #1609
1609: [Vulkan] Initialize wgpu objects from raw handles r=kvark a=zarik5

**Connections**
This PR is a successor of https://github.com/gfx-rs/gfx/pull/3762

**Description**
The `handle_is_external` flag mechanism was not enough to ensure safety, when for example the Instance is wrapped in `Arc<>` and a library cannot keep track of all its clones. This is the case with the bevy render rewrite. The solution was to let wgpu be in charge of destroying the handles, but it also has to keep a reference to a "drop guard" which is always dropped after the handle is destroyed. For the OpenXR integration, this drop guard will be `xr::Instance`.

For now this is just a proof of concept. Only instance creation is handled, and there is even type error in `wgc::Instance::from_hal()`.

I have a few concerns:
* Is it ok to expose `hal::Instance` from the wgpu crate? Or should the user pass all the parameters so `hal::Instance` can be constructed internally? This second options is more disruptive, since the wgpu-types crate would need to import all platform-specific crates to define the structure/enum to hold the raw handles.
* Without counting the call to create the `hal::Instance`, there are 4 indirection calls to save the raw instance. Can this be optimized in any way?

Do you think it is possible to merge wgpu-hal into wgpu-core? This could help with reducing the distance from the surface level API to the platform specific APIs even more.

**Testing**
Vulkan/Android (Oculus Quest) using [this sample](https://github.com/zarik5/openxrs/blob/wgpu-test/openxr/examples/vulkan.rs).


Co-authored-by: Riccardo Zaglia <riccardo.zaglia5@gmail.com>
2021-07-26 05:03:13 +00:00
Riccardo Zaglia 2657849977 [Vulkan] Initialize wgpu objects from raw handles 2021-07-25 21:51:40 +02: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
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
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
Dzmitry Malyshau 00859b9e0c Stop using render pass boundary usages for resource transitions 2021-07-13 01:02:42 -04:00
Dzmitry Malyshau 81f31f5555 hal: change blend color argument 2021-07-13 01:01:30 -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 04ca3212de hal/dx12: intercept debug output 2021-07-13 01:01:22 -04:00
Dzmitry Malyshau c7519432ee Filter texture usages on view creation 2021-07-13 01:01:21 -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