Commit graph

188 commits

Author SHA1 Message Date
Jay Oster c2454b01ab
Simplify vertex attributes (#228)
- Vertex UVs can be computed from the positions, which saves a small amount of code and a small amount of bandwidth (both inconsequential).
- This is mostly for readability.
- Fixes vertically-flipped pixel buffer in the `custom-shader` example.
2021-11-20 14:06:23 -08:00
Jay Oster fa03a61fa3
Prepare 0.8.0 (#227) 2021-11-16 12:13:40 -08:00
Jay Oster b185ec32e9
Initial WebGL2 support. (#218)
Co-authored-by: MarkAnthonyM <37249494+MarkAnthonyM@users.noreply.github.com>
2021-11-16 11:37:56 -08:00
Jay Oster acd42495f2
Use adapter limits (unless overridden) (#226)
- Fixes a regression caused by #223
- `downlevel_webgl2_defaults` only supports 2048x2048 pixels buffers
- This will allow pixel buffers up to the max supported by the hardware
2021-11-14 17:20:57 -08:00
Jay Oster 2a37e3ed1d
Update badges (#225) 2021-11-13 18:26:24 -08:00
Jay Oster 6662fec55b
Set default device limits to downlevel_webgl2_defaults (#223)
- Fixes #139
- See also #115
2021-11-12 11:01:32 -08:00
Jay Oster 0fc722e011
Refactor public API (#222)
* Simplify constructor return types

* Render methods do not need an exclusive borrow
2021-11-08 20:03:38 -08:00
Jay Oster 5b00f7e32f
Make SurfaceSize private (#220)
- This struct is only used internally. No need to make it public.
- Technically a breaking change, so this will bump the SemVer.
2021-11-02 22:05:10 -07:00
Jay Oster eb07e61f5c
Update egui to 0.15 (#217)
- Replaces `egui_winit_platform` with `egui-winit`
- Renames the example package to avoid crate name collision
2021-10-26 19:21:58 -07:00
Jay Oster efeec7f727
Fix minimal-fltk example release builds with Rust 1.56.0 (#216)
- See https://github.com/rust-lang/rust/issues/88576
2021-10-21 16:15:47 -07:00
Jay Oster 2c98dc3f33
Recommend Edition 2021 as an alternative to Cargo resolver version 2 (#215) 2021-10-21 15:57:15 -07:00
Jay Oster 9264a255bf
Remove patch number from dependency versions (#214)
- Cargo treats non-prefixed version numbers the same when the patch number is omitted.
- This is just cleaner and makes breaking updates easier to manage.
2021-10-17 14:26:56 -07:00
Jay Oster ef99ace0ca
Update egui_wgpu_backend (#213) 2021-10-09 20:24:14 -07:00
Jay Oster b05b1fb2b9
Update Dear ImGui screenshot (#212) 2021-10-08 15:00:23 -07:00
Jay Oster 0e6c5286ff
Update line_drawing (#211) 2021-10-08 13:06:48 -07:00
Jay Oster 0295a54e30
Prepare 0.7.0 (#210) 2021-10-08 12:11:43 -07:00
JMS55 800dd931b7
Update to wgpu 0.11 (#209)
Co-authored-by: Jay Oster <jay@kodewerx.org>
2021-10-08 11:49:51 -07:00
Mohammed Alyousef a2529c63c3
update fltk-rs, and use raw-window-handle feature (#208) 2021-10-05 10:46:37 -07:00
Nicholas Rishel 308a8bdc02
Use crab emoji instead of markdown (#204)
Github style markdown emoticons don't work on crates.io. Use emoji instead.
2021-09-16 17:51:29 -07:00
Jay Oster c94dab65b7
Use wgpu environment variables (#198)
- Enables projects using `pixels` to select GPU and backend with
  the same environment variables used by `wgpu` examples.
- cc #142
2021-09-04 15:26:30 -07:00
Jay Oster 50c77a5f83
Add Send + Sync bounds for user-defined errors (#197)
- This enables compatibility with anyhow and the async ecosystem
2021-09-04 14:41:43 -07:00
Jay Oster db00a67c60
Add user-defined errors for render functions (#196)
- Fixes #189
2021-09-04 09:00:25 -07:00
Jay Oster 0f8b1abe87
Update dependencies (#195) 2021-09-04 00:39:03 -07:00
Jay Oster 6225f7225a
Workaround unusual Cargo bug with git dependencies (#194)
- See #193
2021-09-02 17:17:44 -07:00
Jay Oster 210b373882
Add resolver = "2" to all examples (#192)
- These are ignored, but it should prevent copy-pasta errors from users
2021-09-01 21:48:51 -07:00
Jay Oster b7e01422d4
Prepare 0.6.0 (#191) 2021-09-01 21:06:17 -07:00
Jay Oster b00c65fc55
Properly clip pixel buffer when larger than surface texture (#190)
- Fixes #186
2021-09-01 20:53:08 -07:00
Jay Oster e08c91bfd2
Update to wgpu 0.10 (#187)
- It would be nice to return an error from the render function
- imgui-winit is still a WIP (open PR: https://github.com/Yatekii/imgui-wgpu-rs/pull/66)
- Update README

Co-authored-by: Mohammed Alyousef <mohammed.alyousef@neurosrg.com>
2021-09-01 14:50:43 -07:00
Jay Oster 480764ed5a
Add funding link for Patreon (#184) 2021-07-17 16:14:15 -07:00
Jay Oster 303f1d90f5
Prepare 0.5.0 (#183)
* Prepare 0.5.0

* Update dependencies
2021-07-17 08:57:25 -07:00
Jay Oster 288da3675f
Use the swapchain-preferred texture format by default (#182)
- Fixes #140
- Adds a public method to get the current GPU framebuffer texture format (AKA the render texture format).
- This wasn't as difficult as it seemed; the extra API is used by the examples to get the right texture format instead of being hardcoded.
2021-07-17 08:21:49 -07:00
Jay Oster ce549a79b6
Update to egui 0.13 (#181) 2021-06-27 11:32:17 -07:00
Jay Oster c4df23f65d
Update to wgpu 0.9 (#179)
* Update to wgpu 0.9

* Fix validation error in WGSL shader

- This moves the hardcoded vertex positions and texture coordinates to
  the vertex buffer.
- Replaces the two-triangle quad to 1 full-screen triangle (fixes #180)
- Rewrites the custom shader example to fix a bug with large surface
  textures;
  - The input texture size was used for the output texture, causing the
    purple rectangle to appear very jumpy on large displays in full screen.
- The `ScalingRenderer` now exposes its clipping rectangle. The custom
  shader example uses this for its own clipping rectangle, but it can
  also be used for interacting with the border in general.

* Switch to `wgpu::include_wgsl!()`

- This is a nice little simplification.
- Thanks to @JMS55 for the suggestion!
2021-06-27 11:09:29 -07:00
Jay Oster 3ce4b75ad9
Fix shader include (#178) 2021-06-17 20:21:05 -07:00
Jay Oster 294a875c8e
Update dependencies and prepare release (#177) 2021-06-17 20:00:24 -07:00
Jay Oster e5da717351
Update dependencies for egui-winit example (#176)
* Update egui-winit example to greatly simplify the platform event handler

- I was able to upstream this logic into the egui_winit_platform crate

* Fix the wgpu validation error
2021-06-08 07:34:47 -07:00
Jay Oster 338a63a40e
Minor improvement: only one shader module is necessary (#175) 2021-06-08 07:09:58 -07:00
Jay Oster 7913cbdb85
Update egui_winit_platform (#173) 2021-06-06 22:34:59 -07:00
Jay Oster 8d77ac2f8b
Rewrite shaders in WGSL (#172)
- Fixes #141
2021-06-05 18:40:33 -07:00
Jay Oster 23da739650
Update fltk (#169)
- Fixes #163
- Reimplements window resize
  - Still has problems on macOS; Resizing with the drag handle blocks the main loop. See:
    - https://github.com/glfw/glfw/issues/1251
    - https://github.com/rust-windowing/winit/issues/219
2021-05-29 03:27:33 -07:00
Jay Oster b76ae1f7bc
Update winit to 0.25 (#168)
- Update winit
- Update egui_winit_platform
- Update imgui_winit_support
- Fix hyperlink and resize in `egui-winit` example
2021-05-29 02:18:48 -07:00
Jay Oster 355448a7f1
Update egui-winit example dependencies (#167)
* Update egui-winit example dependencies

* Update MSRV
2021-05-12 18:50:33 -07:00
Jay Oster f3d2b0643e
Fix UI colors in imgui-winit example (#166)
- Removes the sRGB workaround that was needed before `imgui-winit` 0.12
2021-05-08 23:14:26 -07:00
Jay Oster 0b26cf015f
Update docs (#165)
- Screenshot for the `imgui-winit` example was quite outdated. Dear ImGui even has a new theme, now.
2021-05-08 19:13:30 -07:00
Jay Oster cdcfe57868
Validate width and height inputs (#162)
* Validate width and height inputs

- Fixes #157

* Add window size check to `imgui-winit` demo

- There is really nothing better that can be done in this case.
- The surface, buffer, and world sizes must all be non-zero.
- A zero-length surface would (previously) panic in `wgpu`.
- A zero-length buffer would panic with the new assertions.
- A zero-length world would cause a divide-by-zero panic when drawing.
2021-05-08 17:26:21 -07:00
Jay Oster f238814d12
Update wgpu to 0.8 (#160)
- Also update other dependencies
2021-05-07 23:52:11 -07:00
Jay Oster 316400e6e0
Prepare release 0.3.0 (#159)
* Try to fix CI by updating MSRV

* Prepare release
2021-05-05 00:48:25 -07:00
Jay Oster 9bfed17a7f
Various fixes (#154)
* Cargo clippy

* Fix typo
2021-03-29 00:52:43 -07:00
JMS55 11c5961e4c
Use default() when making wgpu::RenderPipelineDescriptor (#152) 2021-03-11 18:14:34 -08:00
Jay Oster 8071f34a1f
Rename resize to resize_surface (#149)
- Also cleanup documentation.
- Workaround FLTK window resize issues by disabling resizability.
2021-03-09 04:15:24 -08:00