Skip to content

Commit

Permalink
Update project to work with wgpu 0.20 and imgui 0.12 and winit 0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
benmkw committed May 10, 2024
1 parent edc6bc4 commit 141424c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 31 deletions.
34 changes: 32 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/
and this project adheres to cargo's version of [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Per Keep a Changelog there are 6 main categories of changes:

- Added
- Changed
- Deprecated
Expand Down Expand Up @@ -37,7 +38,9 @@ Per Keep a Changelog there are 6 main categories of changes:
## Unreleased

- Internal: Fixed Scissor-Rect to not span across Framebuffersize, by limiting to framebuffer width. @PixelboysTM
- Bump wgpu version to 0.19. @sarchar (changes based on @calcoph pull request)
- Bump wgpu version to 0.20. @sarchar (0.19), @benmkw (0.20)
- Bump imgui version to 0.12.0. @benmkw
- Bump winit version to 0.29.3. @benmkw

## v0.24.0

Expand All @@ -54,6 +57,7 @@ Released 2023-08-02
## v0.22.0

Released 2023-02-10

- Change `BindGroup` inside `Texture::from_raw_parts` to `Option<BindGroup>` to allow bind group being created by `imgui-wgpu-rs` @BeastLe9enD
- Make `Texture::from_raw_parts` take `Arc<T>` instead of `T` to avoid being forced to move into the texture @BeastLe9enD
- Moved from Rust Edition 2018 -> 2021 @Snowiiii
Expand All @@ -62,32 +66,38 @@ Released 2023-02-10
## v0.21.0

Released 2022-12-17

- Bump imgui version to 0.9.0. Fix examples to match. @aholtzma-am

## v0.20.0

Released 2022-07-11

### Updated

- updated `wgpu` to 0.13 @Davidster
- Internal: Use Fifo present mode in examples @Davidster

### Fixed

- Fix issues with resizing due to the framebuffer size not being updated. @druks-232cc

## v0.19.0

Released 2021-12-30

### Changed

- Split up render into two internal functions, `prepare` and `split_render`.
- Add `SamplerDesc` to TextureConfig

### Updated

- updated wgpu dependency to `0.12`

### Removed
- unreleased `simple-api` and moved to https://github.com/benmkw/imgui-wgpu-simple-api

- unreleased `simple-api` and moved to <https://github.com/benmkw/imgui-wgpu-simple-api>

## v0.18.0

Expand All @@ -98,29 +108,35 @@ Released 2021-10-08
Released 2021-10-08

#### Updated

- updated wgpu dependency to `>=0.10,<0.12`

## v0.17.1

Released 2021-09-22

#### Updated

- updated imgui dependency to `>=0.1,<0.9`

#### Removed

- unstable simple-api is now it's own, unpublished, crate.

## v0.17.0

Released 2021-09-04

#### Changed

- Internal: translate shaders from SPIR-V to WGSL

#### Updated

- updated `wgpu` to 0.10

#### Fixed

- Internal: fix all warnings from static analysis (clippy).
- Internal: Do not render draw commands that fall outside the framebuffer
- Internal: Avoid wgpu logic error by not rendering empty clip rects
Expand All @@ -130,60 +146,71 @@ Released 2021-09-04
Released 2021-07-14

#### Added

- Internal: Vastly improved CI and release process.
- Internal: PR and Issue Templates

#### Changed

- Examples: Use `env_logger` instead of `wgpu-subscriber`
- Examples: Use `pollster` as block_on provider instead of `futures`

#### Fixed

- Rendering to multi-sampled images no longer errors.
- Examples: Simple API examples now properly depend on that feature existing.

#### Updated

- updated `wgpu` to 0.9

## v0.15.1

Released 2021-05-08

#### Fixed

- removed hack due to wgpu bug

#### Updated

- updated `wgpu` to 0.8.1

## v0.15.0

Released 2021-05-08

#### Updated

- updated `wgpu` to 0.8

## v0.14.0

Released 2021-02-12

#### Updated

- updated `imgui` to 0.7

## v0.13.1

Released 2021-02-01

#### Fixed

- Readme

## v0.13.0

Released 2021-02-01

#### Added

- Add experimental simple api behind feature `simple_api_unstable`
- Implemented `std::error::Error` for `RendererError`

#### Updated

- updated to `wgpu` 0.7
- support `winit` 0.24 as well as 0.23

Expand All @@ -192,15 +219,18 @@ Released 2021-02-01
Released 2020-11-21

#### Added

- A changelog!
- Shaders are now SRGB aware. Choose `RendererConfig::new()` to get shaders outputting in linear color
and `RendererConfig::new_srgb()` for shaders outputting SRGB.

#### Updated

- `imgui` to `0.6`.
- `winit` to `0.23`

#### Removed

- GLSL shaders and `glsl-to-spirv`. If you want a custom shader, provide custom spirv to `RendererConfig::with_shaders()`, however you must generate it.

## Diffs
Expand Down
30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[package]
name = "imgui-wgpu"
version = "0.24.0"
authors = ["Noah Hüsser <[email protected]>", "Connor Fitzgerald <[email protected]>", "Steven Wittens <[email protected]>"]
authors = [
"Noah Hüsser <[email protected]>",
"Connor Fitzgerald <[email protected]>",
"Steven Wittens <[email protected]>",
]
edition = "2021"
description = "A wgpu render backend for imgui-rs."
documentation = "https://docs.rs/imgui-wgpu/"
Expand All @@ -12,11 +16,7 @@ categories = ["gui", "graphics", "rendering", "rendering::graphics-api"]
keywords = ["gui", "graphics", "wgpu", "imgui"]
license = "MIT OR Apache-2.0"

exclude = [
".gitignore",
".github",
"resources",
]
exclude = [".gitignore", ".github", "resources"]

[[package.metadata.release.pre-release-replacements]]
file = "CHANGELOG.md"
Expand All @@ -34,29 +34,29 @@ replace = "## Unreleased\n\n## v{{version}}\n\nReleased {{date}}"
file = "CHANGELOG.md"
search = "\\[Unreleased\\]\\(https://github.com/Yatekii/imgui-wgpu-rs/compare/v([a-z0-9.-]+)\\.\\.\\.HEAD\\)"
replace = "[Unreleased](https://github.com/Yatekii/imgui-wgpu-rs/compare/v{{version}}...HEAD)\n- [v{{version}}](https://github.com/Yatekii/imgui-wgpu-rs/compare/v$1...v{{version}})"
min = 0 # allow first increment
min = 0 # allow first increment
[[package.metadata.release.pre-release-replacements]]
file = "CHANGELOG.md"
search = "<!-- Begin Diffs -->"
replace = "- [Unreleased](https://github.com/Yatekii/imgui-wgpu-rs/compare/v{{version}}...HEAD)"
min = 0 # allow non-first increment
min = 0 # allow non-first increment

[dependencies]
bytemuck = "1"
imgui = { git = "https://github.com/imgui-rs/imgui-rs" }
imgui = "0.12"
log = "0.4"
smallvec = "1"
wgpu = "0.19"
wgpu = "0.20"

[dev-dependencies]
bytemuck = { version = "1.13", features = ["derive"] }
cgmath = "0.18"
env_logger = "0.10"
image = { version = "0.24", default-features = false, features = ["png"] }
imgui-winit-support = { git = "https://github.com/imgui-rs/imgui-rs" }
env_logger = "0.11.3"
image = { version = "0.25.1", default-features = false, features = ["png"] }
imgui-winit-support = "0.12"
pollster = "0.3"
raw-window-handle = "0.5"
winit = "0.29"
raw-window-handle = "0.6.1"
winit = "0.29.3"

[package.metadata.docs.rs]
all-features = true
9 changes: 4 additions & 5 deletions examples/cube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::Instant;
use wgpu::{include_wgsl, util::DeviceExt, Extent3d};
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, WindowEvent, KeyEvent},
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{ControlFlow, EventLoop},
keyboard::{Key, NamedKey},
window::Window,
Expand Down Expand Up @@ -255,11 +255,14 @@ impl Example {
module: &shader,
entry_point: "vs_main",
buffers: &vertex_buffers,
compilation_options: Default::default(),
},

fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "fs_main",
targets: &[Some(config.format.into())],
compilation_options: Default::default(),
}),
primitive: wgpu::PrimitiveState {
cull_mode: Some(wgpu::Face::Back),
Expand Down Expand Up @@ -348,7 +351,6 @@ fn main() {
window.set_title(&format!("imgui-wgpu {version}"));
let size = window.inner_size();


(window, size)
};

Expand Down Expand Up @@ -446,9 +448,6 @@ fn main() {

// Event loop
let _ = event_loop.run(|event, elwt| {
if cfg!(feature = "metal-auto-capture") {
elwt.exit();
};
match event {
Event::WindowEvent {
event: WindowEvent::Resized(size),
Expand Down
5 changes: 1 addition & 4 deletions examples/custom-texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::time::Instant;
use wgpu::Extent3d;
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, WindowEvent, KeyEvent},
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{ControlFlow, EventLoop},
keyboard::{Key, NamedKey},
window::Window,
Expand Down Expand Up @@ -139,9 +139,6 @@ fn main() {

// Event loop
let _ = event_loop.run(|event, elwt| {
if cfg!(feature = "metal-auto-capture") {
elwt.exit();
};
match event {
Event::WindowEvent {
event: WindowEvent::Resized(size),
Expand Down
7 changes: 2 additions & 5 deletions examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use pollster::block_on;
use std::time::Instant;
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, WindowEvent, KeyEvent},
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{ControlFlow, EventLoop},
keyboard::{Key, NamedKey},
window::Window,
Expand Down Expand Up @@ -111,9 +111,6 @@ fn main() {

// Event loop
let _ = event_loop.run(|event, elwt| {
if cfg!(feature = "metal-auto-capture") {
elwt.exit();
};
match event {
Event::WindowEvent {
event: WindowEvent::Resized(size),
Expand All @@ -135,7 +132,7 @@ fn main() {
Event::WindowEvent {
event:
WindowEvent::KeyboardInput {
event:
event:
KeyEvent {
logical_key: Key::Named(NamedKey::Escape),
state: ElementState::Pressed,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ impl Renderer {
step_mode: VertexStepMode::Vertex,
attributes: &vertex_attr_array![0 => Float32x2, 1 => Float32x2, 2 => Unorm8x4],
}],
compilation_options: Default::default(),
},
primitive: PrimitiveState {
topology: PrimitiveTopology::TriangleList,
Expand Down Expand Up @@ -488,6 +489,7 @@ impl Renderer {
}),
write_mask: ColorWrites::ALL,
})],
compilation_options: Default::default(),
}),
multiview: None,
});
Expand Down

0 comments on commit 141424c

Please sign in to comment.