Commit Graph

8406 Commits

Author SHA1 Message Date
Dzmitry Malyshau
c74f8e8db8 Cube cleanup and the new generated texture 2019-02-04 09:55:32 -05:00
Dzmitry Malyshau
8f985dd09e Fix gfx-cube example 2019-02-03 22:19:36 -05:00
Dzmitry Malyshau
d50f8199dd Buffer to texture copies 2019-02-03 21:59:35 -05:00
Dzmitry Malyshau
3ec4ff99b0 Vertex buffer description in the pipelines 2019-02-03 20:39:13 -05:00
Dzmitry Malyshau
3d47436129 rust: vertex/index binding 2019-02-03 15:51:54 -05:00
Dzmitry Malyshau
d4c8c881d0 gfx framework GLSL reading, most of the cube example 2019-02-02 22:48:53 -05:00
Dzmitry Malyshau
a735eddf81 Sampler creation support 2019-02-02 22:37:51 -05:00
Dzmitry Malyshau
ed5499d025 Basic gfx-examples framework 2019-02-02 21:02:33 -05:00
Dzmitry Malyshau
afe00aa90f Borrow temporary queus and frames on Rust side 2019-02-02 21:02:33 -05:00
bors[bot]
a2b6ec167f Merge #51
51: native: basic support for pipeine stages in barriers r=grovesNL a=kvark

It's a naive approach focused on solving the Vulkan validation errors :)

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2019-02-02 09:25:43 +00:00
Dzmitry Malyshau
57f0cd184f native: basic support for pipeine stages in barriers 2019-01-31 21:42:35 -05:00
bors[bot]
6c202f627c Merge #48
48: Set buffer data r=grovesNL a=kvark

Simple and limited implementation, should be sufficient for the first examples.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2019-01-31 21:18:56 +00:00
Dzmitry Malyshau
55c22a0d9a Implement basic set_buffer_data 2019-01-30 15:31:06 -05:00
bors[bot]
664d9e75e5 Merge #50
50: added forgotten create_bind_group r=kvark a=porky11

I added the missing function `create_bind_group` and some important data types.
See an example [here](https://github.com/porky11/wgpu/blob/uniform-buffer-example/examples/hello_triangle_rust/main.rs). (Should work when filling the vertex buffer with useful values).

Co-authored-by: Fabio Krapohl <fabio.u.krapohl@fau.de>
2019-01-30 19:44:54 +00:00
Fabio Krapohl
c5be22a242 added forgotten create_bind_group
fixed suggestions

use `ref` in match
2019-01-30 20:35:20 +01:00
bors[bot]
3dbcdc0327 Merge #49
49: GLFW integration r=grovesNL a=kvark

This is #40 that is rebased and fixed a bit.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2019-01-24 20:10:53 +00:00
Dzmitry Malyshau
e8e5938e06 Linux support for GLFW example 2019-01-24 12:33:34 -05:00
Joshua Groves
2a47ced556 Remove examples Makefile from CI 2019-01-24 12:08:32 -05:00
Joshua Groves
3d98457eb9 Add support for GLFW on Windows 2019-01-24 12:08:32 -05:00
Joshua Groves
26f965cfbb Use CMake and update triangle example 2019-01-24 12:08:32 -05:00
Joshua Groves
05b5ee42e7 Regenerate bindings 2019-01-24 12:08:32 -05:00
Joshua Groves
af1e240655 Add macOS surface creation 2019-01-24 12:08:32 -05:00
Dzmitry Malyshau
8547b591ad Dependencies and Cargo configurations update for 0.1 2019-01-24 07:39:51 -08:00
bors[bot]
5acbf75fb8 Merge #45
45: Remove non-winit from the example r=grovesNL a=kvark

This are the follow-up fixes to #38 as suggested by the review

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2019-01-23 03:06:54 +00:00
Dzmitry Malyshau
edf269dbed Remove the non-winit path from the example 2019-01-22 17:10:08 -08:00
bors[bot]
742fee7e41 Merge #38
38: Draw the first triangle r=grovesNL a=kvark

- [x] vertex/index buffers
- [x] draws
- [x] bind groups
  - [x] creation
  - [x] binding
  - [x] Rust side
- [x] triangle


Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2019-01-22 20:07:34 +00:00
Dzmitry Malyshau
2ec9d05074 Triangle example, minor corrections 2019-01-21 19:20:09 -05:00
Dzmitry Malyshau
32f7ae4f28 Basic buffer creation 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
4f939bc32f Bind group resource transitions 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
dee685aa0c native: bind groups for both compute and graphics 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
6699f4bed1 native: Abstract the binding tracker into a separate module 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
3ed4620c1f Bind compute groups if layout is matching 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
fb6a91589e native: simple bind group creation 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
64fb727bad draw methods 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
bb7fee796d get_with_usage helper 2019-01-21 16:18:56 -05:00
Dzmitry Malyshau
08cd75f38c Set vertex and index buffers 2019-01-21 16:18:56 -05:00
bors[bot]
eff92d3427 Merge #42
42: Remove glfw submodule r=nobody a=grovesNL

Fixes #41

I temporarily added a glfw submodule as part of #40 but it looks like it was mistakenly added as part of #39

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2019-01-21 10:15:24 +00:00
Joshua Groves
6cb9806408 Remove glfw submodule 2019-01-21 02:57:04 -07:00
bors[bot]
8f312af8e6 Merge #39
39: Remove generic and option from render pass descriptor r=kvark a=grovesNL

- Temporarily lock cbindgen to known working revision until a new version is published
- Remove generic and `Option` from `RenderPassDescriptor`, map between wgpu/wgpu-native types like other descriptors, and add a missing length field (this appears necessary to generate bindings)
- Regenerate bindings (using `a7be40c65 2018-12-26`, earlier versions should work too)
- Remove `+nightly` for bindings generation from Makefile, because newer nightlies won't work at the moment
- Fix typo in Makefile `clean`

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2019-01-21 03:08:18 +00:00
Joshua Groves
558681fddc Don't specify nightly for bindings generation 2019-01-20 16:46:02 -07:00
Joshua Groves
f647fd8030 Regenerate bindings 2019-01-20 16:25:49 -07:00
Joshua Groves
c7f2425b98 Remove generic from render pass descriptor 2019-01-20 16:24:37 -07:00
Joshua Groves
e51cce7e5d Lock cbindgen to working revision 2019-01-20 15:47:54 -07:00
bors[bot]
0f592b4443 Merge #34
34: Basic windowing and presentation r=grovesNL a=kvark

- [x] native swapchain creation
- [x] native use of frames and presentation
- [x] native semaphore waits
- [x] rust wrapping
- [x] working examples

~~I may or may not bite the bullet and update gfx-rs here. Probably not :)~~

## Architecture

There is a bit of complexity here to manage all the synchronization and lifetimes properly. Essentially, presentation is exposed in Vulkan/gfx-rs as a separate hidden queue, so we inevitably run into the territory of using semaphores for synchronization, where previously we could ignore them for workloads on a single queue.

A swapchain has a fixed (at creation) number of frames, each represented by a texture plus view pair. When `get_next_texture` is called we acquire the next image index and return this pair. We wait for the associated fence to make sure the frame is no image used. We then associate a semaphore with this index for image availability.

The texture has extra information to link back to an image of the swapchain (which is `None` for regular textures). Whenever it's used, the command buffer collects that link to be used on submission, where it's just resolved to a semaphore that we wait on actual submission.

Presenting on a swapchain creates a temporary command buffer that we only use for transiting the swapchain image into presentable state. This small submission is useful for establishing a "ready" semaphore as well as a fence (waited in `get_next_image`). The "ready" semaphore is used immediately for native `present` call.

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2019-01-19 13:31:35 +00:00
Dzmitry Malyshau
5deb6e2047 DX11 support 2019-01-17 23:03:11 -05:00
Dzmitry Malyshau
2221b112c7 Fix command buffer recycling 2019-01-17 21:11:01 -05:00
Dzmitry Malyshau
c868db2cc7 Windowing in the triangle example, more presentation bits 2019-01-17 09:42:59 -05:00
bors[bot]
5324fa6e1c Merge #7
7: Add missing cargo metadata for the release r=msiglreith a=kvark



Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2019-01-17 11:20:40 +00:00
Dzmitry Malyshau
e32112a89a Swapchain exposed on Rust side 2019-01-16 09:15:56 -05:00
Dzmitry Malyshau
90154fb6f5 Wait for swapchain semaphores 2019-01-16 08:56:35 -05:00