Commit Graph

628 Commits

Author SHA1 Message Date
Dzmitry Malyshau
edbe112d23 [rs] Drop for surfaces and adapters 2020-11-16 16:47:21 -05:00
bors[bot]
dff98ac2a8 [rs] Merge #624
624: Remove implicit conversion hello-triangle shader.vert r=kvark a=Napokue

Remove implicit conversion to float, and change it to explicit conversion. Reason for this change is to prepare the hello-triangle example for Naga glsl-spirv path.

Co-authored-by: Timo de Kort <dekort.timo@gmail.com>
2020-11-15 23:36:30 +00:00
Timo de Kort
25b7cea64c [rs] Remove implicit conversion hello-triangle shader.vert 2020-11-15 23:13:53 +01:00
bors[bot]
92e75723d5 [rs] Merge #618
618: Removed unusued Uniform struct in texture-arrays example. r=cwfitzgerald a=Stygeon

The Uniform struct in the texture-arrays example is unused.

Co-authored-by: Stygeon <denrellum@gmail.com>
2020-11-12 01:30:35 +00:00
Stygeon
6fb829d4df [rs] Removed unusued Uniform struct in texture-arrays example. 2020-11-12 02:26:58 +01:00
bors[bot]
033c896c4f [rs] Merge #613
613: Add more context to errors originating in Passes and Encoders r=kvark a=Kimundi

**Description**
This adds some top-level error context information to indicate wether an error originated in a `{Render,Compute}Pass` or `{Command,RenderBundle}Encoder` to make error messages more clear.

Combined with https://github.com/gfx-rs/wgpu/pull/1018, errors in passes will look like this:
```
wgpu error: Validation error

Caused by:
    In a RenderPass
    In a draw command
    index 3600 extends beyond limit 38
```


Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
2020-11-11 04:56:44 +00:00
bors[bot]
2226cc8d31 [rs] Merge #614
614: Bump winit version to 0.23.0 r=cwfitzgerald a=daveshah1

This fixes the following error trying to run the hello-triangle (and probably other) examples on GNOME/Wayland:

    [wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.



Co-authored-by: David Shah <dave@ds0.me>
2020-11-10 20:57:19 +00:00
David Shah
ac806458f9 [rs] Bump winit version to 0.23.0
This fixes the following error trying to run the hello-triangle (and
probably other) examples on GNOME/Wayland:

    [wayland-client error] Attempted to dispatch unknown opcode 0 for wl_shm, aborting.

Signed-off-by: David Shah <dave@ds0.me>
2020-11-10 20:28:41 +00:00
bors[bot]
315dd420f4 [rs] Merge #612
612: Update create_buffer_init_polyfill for wasm32 r=grovesNL a=alankemp

This removes create_buffer_mapped which has been removed in the latest chrome canary and firefox nightly and fixes #609 

Co-authored-by: Alan Kemp <alan@alankemp.com>
2020-11-10 02:59:00 +00:00
Marvin Löbel
a74546f974 [rs] Add more context to errors originating in Passes and Encoders 2020-11-09 23:49:19 +01:00
Alan Kemp
e1b05a583a [rs] Update create_buffer_init_polyfill for wasm32 2020-11-09 21:22:03 +00:00
bors[bot]
ccc178a3d0 [rs] Merge #611
611: Match inputs/outputs in msaa-line shader r=kvark a=kvark

Note: this shouldn't be necessary, as the varyings are matched by location and not the name. However, spirv-cross doesn't try to fiddle with the varying names, so it fails if they are unmatched.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-09 14:31:28 +00:00
Dzmitry Malyshau
b8f157f7df [rs] Match inputs/outputs in msaa-line shader 2020-11-09 09:27:51 -05:00
bors[bot]
8c386efb7c [rs] Merge #610
610: Rename TextureUsage::OUTPUT_ATTACHMENT to RENDER_ATTACHMENT r=kvark a=yzsolt

Depends on https://github.com/gfx-rs/wgpu/pull/1017 

Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
2020-11-09 14:03:43 +00:00
Zsolt Bölöny
e6d7873844 [rs] Update dependencies 2020-11-09 13:50:06 +01:00
Zsolt Bölöny
7c290fdd8d [rs] Rename TextureUsage::OUTPUT_ATTACHMENT to RENDER_ATTACHMENT 2020-11-09 10:35:55 +01:00
bors[bot]
6d8dfaca84 [rs] Merge #606
606: Enable GL backend r=kvark a=kvark

Replaces #182
Depends on https://github.com/gfx-rs/wgpu/pull/907

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-11-05 04:13:45 +00:00
bors[bot]
4d378d6315 [rs] Merge #605
605: Enable X11 Support for the GL Backend r=kvark a=zicklag



Co-authored-by: Zicklag <zicklag@katharostech.com>
2020-11-05 04:05:27 +00:00
Dzmitry Malyshau
58d2b36d13 [rs] Enable GL backend 2020-11-04 23:02:01 -05:00
Zicklag
cd2e2cc61e [rs] Enable X11 Support for the GL Backend 2020-11-03 16:14:58 -06:00
bors[bot]
bcaae6a962 [rs] Merge #598
598: Clarify docs for Queue::write methods r=kvark a=Kimundi



Co-authored-by: Marvin Löbel <loebel.marvin@gmail.com>
2020-10-22 16:17:26 +00:00
Marvin Löbel
9073d18c70 [rs] Clarify docs for Queue::write methods 2020-10-22 17:40:23 +02:00
bors[bot]
1a556facab [rs] Merge #596
596: Update wgpu with another bind group fix, updated power preference r=kvark a=kvark

Includes https://github.com/gfx-rs/wgpu/pull/973 and https://github.com/gfx-rs/wgpu/pull/980

Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
2020-10-13 20:58:27 +00:00
Dzmitry Malyshau
c115aed4cc [rs] Update wgpu with another bind group fix, updated power preference 2020-10-13 16:57:52 -04:00
bors[bot]
42bb7ca65f [rs] Merge #594
594: Fix mipmap example which was y-flipped r=kvark a=Uriopass

Mipmap rendering was y-flipped, hence making one out of every two mipmaps wrong. See:

![image](https://user-images.githubusercontent.com/5420739/95760589-7eba1f80-0cab-11eb-8a5f-bfe9e228b480.png)

(look at the black dots)

Co-authored-by: Paris DOUADY <paris.douady@hotmail.fr>
2020-10-12 14:56:08 +00:00
Paris DOUADY
d66ffc2902 [rs] Fix mipmap example which was y-flipped 2020-10-12 16:51:24 +02:00
Dzmitry Malyshau
5507e16718 [rs] Really fix the environment to WGPU_BACKEND this time 2020-10-11 23:43:39 -04:00
bors[bot]
a028a6f5d1 [rs] Merge #593
593: Update wgpu with push constants API r=kvark a=kvark

Includes https://github.com/gfx-rs/wgpu/pull/966, https://github.com/gfx-rs/wgpu/pull/969, and https://github.com/gfx-rs/wgpu/pull/970

Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-10-12 03:20:17 +00:00
Dzmitry Malyshau
f6858fa109 [rs] Support WGPU_BACKEND environment in the examples 2020-10-11 23:17:38 -04:00
Dzmitry Malyshau
c92dbae57e [rs] Immediate resource destruction 2020-10-11 23:17:37 -04:00
Dzmitry Malyshau
d6843fca7b [rs] Update wgpu with push constants API 2020-10-11 23:17:37 -04:00
bors[bot]
9451c23bb7 [rs] Merge #589
589: Update to latest wgpu with Naga validation r=cwfitzgerald a=kvark

Depends on https://github.com/gfx-rs/wgpu/pull/962
Includes latest Naga validation stuff.
~~Warning: subject to https://github.com/gfx-rs/naga/issues/228~~

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-10-07 21:39:22 +00:00
Dzmitry Malyshau
1b4e6b6a15 [rs] Update to latest wgpu with Naga validation 2020-10-07 17:36:15 -04:00
bors[bot]
7d70d8afbd [rs] Merge #577
577: Fixes #575 - vulkan-portability feature on MacOS r=kvark a=rybertm

See #575.
This PR fixes the issue with enabling `vulkan-portability` on MacOS.

Co-authored-by: Robert Broketa <robertbroketa@gmail.com>
2020-09-22 02:21:37 +00:00
Robert Broketa
79c50797cf [rs] Fixes #575 - vulkan-portability feature on MacOS 2020-09-21 14:32:46 -03:00
bors[bot]
9a4026129a [rs] Merge #574
574: Implement AsRef for BufferView r=kvark a=de-vri-es

This PR implements `AsRef` and `AsMut` in addition to `Deref` and `DerefMut` for `BufferView` and `BufferViewMut`.

This allows the buffer views to be used directly by generic code that wants an `AsRef<[u8]>`.

It's also subjectively a small win when you want to pass the views to non-generic code. I find `buffer.as_ref()` clearer than `&*buffer`. That also goes for `buffer.deref()`, but `Deref` is not in the prelude.

Co-authored-by: Maarten de Vries <maarten@de-vri.es>
2020-09-21 15:43:25 +00:00
Maarten de Vries
81df9fb707 [rs] Implement AsRef for BufferView
Remove AsRef<[u8]> for BufferViewMut.
2020-09-21 17:35:30 +02:00
bors[bot]
4b1c363def [rs] Merge #576
576: Convert swapchain.get_current_frame to a immutable reference r=kvark a=cwfitzgerald

Per our discussion on matrix, converts swapchain.get_current_frame to an immutable reference as it's internally synchronized.

Rationale: will allow me to take a non-pretty RW mutex as read instead of write in my application

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2020-09-20 19:33:08 +00:00
Connor Fitzgerald
f7b78115e3 [rs] Convert swapchain.get_current_frame to a immutable reference 2020-09-20 14:38:43 -04:00
bors[bot]
47c05b324f [rs] Merge #570
570: web: temporarily polyfill `create_buffer_init` r=kvark a=grovesNL

Temporarily polyfill `create_buffer_init` on the web backend by using the old buffer mapping API. This is just a temporary fix until the new buffer mapping API is available in Nightly.

This polyfill allows us to run `cube` from `master` on Nightly (there's still lots missing from other examples). But at least some simple use cases (e.g. projects only using `create_buffer_init`/`write_buffer` and no other buffer mapping functions) can run with `master`.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-09-17 03:20:06 +00:00
Joshua Groves
9270d85e3a [rs] web: temporarily polyfill create_buffer_init 2020-09-17 00:48:58 -02:30
bors[bot]
adfd90a148 [rs] Merge #569
569: Reorder framework canvas setup for web r=kvark a=grovesNL

winit only appends the canvas element once the window is built, and we need the canvas to exist before `create_surface` can use it. So we can just reorder the calls to build the window before using `create_surface` on the web backend in framework.

Also temporarily no-op debug markers for the web until we have them in gecko. Even though they're technically unimplemented, we can still proceed without them.

Co-authored-by: Joshua Groves <josh@joshgroves.com>
2020-09-16 03:57:52 +00:00
Joshua Groves
8153e29c98 [rs] Temporarily no-op debug marker functions for web 2020-09-16 01:05:12 -02:30
Joshua Groves
90cdc32c0c [rs] Reorder framework window creation for web 2020-09-16 01:04:49 -02:30
bors[bot]
da81673f64 [rs] Merge #567
567: Notes on LoadOp r=kvark a=PENGUINLIONG

If the swapchain image was drawn with a pipeline that loads a render target that has not been cleared before, the validation layer gives a triplet of confusing feedbacks:

```log
[2020-09-15T06:42:23Z ERROR gfx_backend_vulkan] 
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (1303270965)] : Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x1d80787bfe8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | Submitted command buffer expects VkImage 0x6dc7200000000005[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
    object info: (type: COMMAND_BUFFER, hndl: 2027350900712)

[2020-09-15T06:42:23Z ERROR gfx_backend_vulkan] 
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (1303270965)] : Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x1d8078586a8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | Submitted command buffer expects VkImage 0x3ba5830000000006[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
    object info: (type: COMMAND_BUFFER, hndl: 2027350754984)

[2020-09-15T06:42:23Z ERROR gfx_backend_vulkan] 
    VALIDATION [UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (1303270965)] : Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x1d8078614f8, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | Submitted command buffer expects VkImage 0x4c5b620000000007[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
    object info: (type: COMMAND_BUFFER, hndl: 2027350791416)
```

And it turns out they come from the triple-buffering swapchain images. It seems `wgpu` would only re-layout the swapchain image if it's been loaded by a clear op. I would be great to warn the users beforehand. (I know it's not something I should ever do tho)

Co-authored-by: PENGUINLIONG <admin@penguinliong.moe>
2020-09-15 13:32:59 +00:00
PENGUINLIONG
39b9a6218b [rs] Notes on LoadOp 2020-09-15 14:43:30 +08:00
bors[bot]
9840ae4eb3 [rs] Merge #565
565: Add context to errors r=kvark a=scoopr

ContextError is just a simple wrapper that contains a string and the original error, and it is used to decorate the error to give it more context.

Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-09-15 01:38:19 +00:00
bors[bot]
4829875193 [rs] Merge #566
566: Report out of memory errors r=kvark a=scoopr



Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
2020-09-15 01:28:40 +00:00
Mikko Lehtonen
2e791cacde [rs] Report out of memory errors 2020-09-14 23:26:20 +03:00
Mikko Lehtonen
60af888c74 [rs] Add context to errors
ContextError is just a simple wrapper that contains a string and the original error, and it is used to decorate the error to give it more context.
2020-09-14 22:54:52 +03:00