Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate examples to winit's new "app" API #626

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

yutannihilation
Copy link
Contributor

A followup of #559

I see #559 (comment) indicates there's some plan of more significant rewrite, so please feel free to close this. This is mainly my practice of migration to winit's new API.

cf. changelog

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still works for me. Thanks!

Are you planning on also applying this to the with_winit example, or should we just land this as-is?


// The vello RenderContext which is a global context that lasts for the lifetime of the application
let mut render_cx = RenderContext::new();
struct RenderStateWithContext<'s> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should rename this to something which describes what it is for, rather than what it contains. E.g. SimpleVelloApp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! SimpleVelloApp sounds better.

@yutannihilation
Copy link
Contributor Author

Are you planning on also applying this to the with_winit example, or should we just land this as-is?

Thanks, I think I can address it in this pull request.

@yutannihilation
Copy link
Contributor Author

Sorry, I tried with_winit, but it crashes on my local after my rewrite and it will probably take some time to figure out what's happening due to my lack of knowledge. So, I'd like to not include it in this pull request.

     Running `target\debug\with_winit_bin.exe`
[2024-07-15T15:04:06.672Z ERROR wgpu_hal::vulkan::instance] GENERAL [Loader Message (0x0)]
        loader_scanned_icd_add: Driver C:\Windows\System32\DriverStore\FileRepository\u0379858.inf_amd64_1719b9caae095668\B377432\.\amdvlk64.dll says it supports interface version 6 but still exports core entrypoints (Policy #LDP_DRIVER_6)
[2024-07-15T15:04:06.673Z ERROR wgpu_hal::vulkan::instance]     objects: (type: INSTANCE, hndl: 0x1f291a0ccd0, name: ?)
Initialising in parallel using 14 threads
Parsed svg Ghostscript_Tiger in 8.9593ms
Encoded svg Ghostscript_Tiger in 799.6µs
thread 'main' panicked at examples\with_winit\src\lib.rs:511:22:
failed to get surface texture: Timeout
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\with_winit_bin.exe` (exit code: 101)

Here's the migrated code of with_winit (WIP).

main...yutannihilation:winit-0.30-new-api-2

@DJMcNab
Copy link
Member

DJMcNab commented Jul 15, 2024

Hmm. I'll land this then. Would you mind making a draft follow-up PR with those changes?

@DJMcNab DJMcNab added this pull request to the merge queue Jul 15, 2024
@yutannihilation
Copy link
Contributor Author

Sure, I will!

Merged via the queue into linebender:main with commit 6efa498 Jul 15, 2024
16 checks passed
@yutannihilation yutannihilation deleted the winit-0.30-new-api branch July 15, 2024 15:30
github-merge-queue bot pushed a commit that referenced this pull request Jul 17, 2024
Second round of #626

Currently, this crashes with the following on my local, so I think I'm
doing something wrong.

```
     Running `target\debug\with_winit_bin.exe`
[2024-07-15T15:33:30.317Z ERROR wgpu_hal::vulkan::instance] GENERAL [Loader Message (0x0)]
        loader_scanned_icd_add: Driver C:\Windows\System32\DriverStore\FileRepository\u0379858.inf_amd64_1719b9caae095668\B377432\.\amdvlk64.dll says it supports interface version 6 but still exports core entrypoints (Policy #LDP_DRIVER_6)
[2024-07-15T15:33:30.318Z ERROR wgpu_hal::vulkan::instance]     objects: (type: INSTANCE, hndl: 0x1ca928fbea0, name: ?)
Initialising in parallel using 14 threads
Parsed svg Ghostscript_Tiger in 8.3298ms
Encoded svg Ghostscript_Tiger in 893.9µs
thread 'main' panicked at examples\with_winit\src\lib.rs:511:22:
failed to get surface texture: Timeout
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\with_winit_bin.exe` (exit code: 101)

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants