Skip to content

Commit

Permalink
Repro 6169
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Aug 27, 2024
1 parent 5deaef3 commit e61a0f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/src/hello_triangle/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ async fn run(event_loop: EventLoop<()>, window: Window) {

let instance = wgpu::Instance::default();

let surface = instance.create_surface(&window).unwrap();
unsafe { instance.as_hal::<wgpu::hal::dx12::Api>() };

let mut surface = instance.create_surface(&window).unwrap();
unsafe { surface.as_hal::<wgpu::hal::dx12::Api, _, _>(|s| ()) };
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::default(),
Expand All @@ -22,6 +25,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
})
.await
.expect("Failed to find an appropriate adapter");
unsafe { adapter.as_hal::<wgpu::hal::dx12::Api, _, _>(|a| ()) };

// Create the logical device and command queue
let (device, queue) = adapter
Expand All @@ -38,6 +42,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
)
.await
.expect("Failed to create device");
unsafe { device.as_hal::<wgpu::hal::dx12::Api, _, _>(|d| ()) };

// Load the shaders from disk
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
Expand Down

0 comments on commit e61a0f0

Please sign in to comment.