|
|
|
@ -28,7 +28,7 @@ impl State {
|
|
|
|
|
let surface = unsafe { instance.create_surface(window) };
|
|
|
|
|
let adapter = instance
|
|
|
|
|
.request_adapter(&wgpu::RequestAdapterOptions {
|
|
|
|
|
power_preference: wgpu::PowerPreference::Default,
|
|
|
|
|
power_preference: wgpu::PowerPreference::default(),
|
|
|
|
|
compatible_surface: Some(&surface),
|
|
|
|
|
})
|
|
|
|
|
.await
|
|
|
|
@ -37,9 +37,9 @@ impl State {
|
|
|
|
|
let (device, queue) = adapter
|
|
|
|
|
.request_device(
|
|
|
|
|
&wgpu::DeviceDescriptor {
|
|
|
|
|
label: None,
|
|
|
|
|
features: wgpu::Features::empty(),
|
|
|
|
|
limits: wgpu::Limits::default(),
|
|
|
|
|
shader_validation: true,
|
|
|
|
|
},
|
|
|
|
|
None, // Trace path
|
|
|
|
|
)
|
|
|
|
@ -47,7 +47,7 @@ impl State {
|
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
|
|
let sc_desc = wgpu::SwapChainDescriptor {
|
|
|
|
|
usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT,
|
|
|
|
|
usage: wgpu::TextureUsage::RENDER_ATTACHMENT,
|
|
|
|
|
format: wgpu::TextureFormat::Bgra8UnormSrgb,
|
|
|
|
|
width: size.width,
|
|
|
|
|
height: size.height,
|
|
|
|
@ -98,7 +98,6 @@ impl State {
|
|
|
|
|
},
|
|
|
|
|
sample_count: 1,
|
|
|
|
|
sample_mask: !0,
|
|
|
|
|
alpha_to_coverage_enabled: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let vs_module = device.create_shader_module(wgpu::include_spirv!("challenge.vert.spv"));
|
|
|
|
@ -194,6 +193,7 @@ impl State {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
|
|
|
|
|
label: Some("Render Pass"),
|
|
|
|
|
color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor {
|
|
|
|
|
attachment: &frame.view,
|
|
|
|
|
resolve_target: None,
|
|
|
|
|