462: Using default nsview if not provided by raw-window-handle r=kvark a=lmcgrath
Per #453 I've added some native code to get the default `NSView` if it's not provided by `RawWindowHandle`. This is to support libraries like SDL2 which expose an `NSWindow` but no `NSView`. I'm using the [`[NSWindow contentView]`](https://developer.apple.com/documentation/appkit/nswindow/1419160-contentview) property to get the `NSView`.
Co-authored-by: Logan McGrath <1755866+lmcgrath@users.noreply.github.com>
Only two unsafe functions were used internally:
- `slice::from_raw_parts`
- `Box::from_raw`
The safety messages are adapted from the safety messages of these functions.
448: Fix framebuffers not always being cleaned up if invalid r=kvark a=LaylConway
This changes framebuffers to be cleaned up if only one view is cleaned up, instead of if all views are cleaned up. This is necessary because currently, at least for me, swapchain images will have a different view every frame. This means that if other views continue to exist between frames, the resulting framebuffers will never be cleaned up.
Fixes#447
Co-authored-by: Layl <2385329-layl@users.noreply.gitlab.com>
153: Update readme badges r=kvark a=rukai
Adds docs.rs badge link and replaces gitter badge with a matrix badge.
Looks like the the matrix room needs to be more public or else i've somehow messed up the matrix room name in the badge url.
Co-authored-by: Rukai <rubickent@gmail.com>
449: Fix missing memory release r=kvark a=zakorgy
This fixes the issue where the underlying memory of buffers and textures not released when calling `Global::delete`.
cc @kvark
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/gfx-rs/wgpu/449)
<!-- Reviewable:end -->
Co-authored-by: Zakor Gyula <gyula.zakor@h-lab.eu>
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).
157: Handle resizing in hello-triangle r=kvark a=quadrupleslap
Nothing gets drawn on my computer unless the swap chain is resized along with the window.
```
$ uname -a
Linux red 5.3.7-arch1-1-ARCH #1 SMP PREEMPT Fri Oct 18 00:17:03 UTC 2019 x86_64 GNU/Linux
$ wmctrl -m
Name: bspwm
Class: wm
PID: 665
Window manager's "showing the desktop" mode: N/A
```
Co-authored-by: Ram Kaniyur <quadrupleslap@gmail.com>
439: Refactor usage tracking to be truly sparse r=dependency a=kvark
~~This is a required step towards #438 . We want to be tracking the usage by only having resource IDs around, not resources themselves. So we aren't going to have access to `full_selector`.~~
It's also streamlining some of the verbose parts of the internal API for usage tracking.
It also uses `SmallVec` for the texture tracker ranges, essentially making it lightweight for most cases (where the layer count is 1).
Compromises:
- removes `SEPARATE_DEPTH_STENCIL_STATES` support. It's not in the near future to enable it anyway.
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>