PowerPreference::Default will now prefer discrete GPUs
when on AC power and will prefer integrated GPUs while
on battery power (i.e. the battery is discharging).
359: Make examples work again r=kvark a=GabrielMajeri
This PR fixes the C example code to not crash and actually run.
I've also added a few assertions to ensure a warning is emitted next time somebody forgots to increase `max_bind_groups` to something non-zero on device creation.
To help with debugging the examples, I've configured CMake to include debug info in the builds. Some new Makefile targets for the examples have been added to automate running them.
Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
Get the examples running again.
The compute example has been simplified to use only one buffer.
A new check has been added to ensure the `max_bind_groups`
device limit is properly set.
This PR removes optional backend features in favor of run-time
selection at the `request_adapter` entry point. Adapters from all
supported gpu backends on the platform are reported.
It also makes gfx-rs dependency to be public (for now).
Disable vsync
Revert accidential hardcode of num_frames
Make the PresentMode configurable
Adapt examples
+ adjust style according to @kvrak
Adher to @kvarks wishes for style.
Examples build.
Fix unnecessary ampersand.
212: More consistent descriptor passing r=kvark a=porky11
also use pointer for descriptor in `wgpu_command_encoder_begin_render_pass` for consistency reasons
Co-authored-by: Fabio Krapohl <fabio.u.krapohl@fau.de>
* always plural form without _ptr suffix for pointers
* always same name as pointer for size, but with _length suffix
* special case: single size applies to multiple pointers => only use length as name
192: add necessary windows lib files for vulkan, dx12, dx11 r=kvark a=Napokue
Introduce new argument BACKEND to specify the back-end framework in the hello_triangle_c CMake script. I will update the other examples, hello_remote_c & hello_compute_c (working on this one) in a future PR.
fix#188
Co-authored-by: Timo de Kort <dekort.timo@gmail.com>
127: Track async mapping properly r=grovesNL,swiftcoder a=kvark
Fixes#117, fixes#95, fixes#132
The change can be logically split into 3 parts:
1. when `ActiveSubmission` is retired, we now move the mapped buffers into the "ready to map" vector. This was the missing bit that caused mapping to not work previously.
2. mapping callbacks in Rust wrapper are refactored and they `unmap()` automatically now on users behalf
3. we wait for idle before destroying the device, which allows us to process all the pending callbacks. This fix gets rid of the dummy submission our compute example used to do.
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>