diff --git a/all-is-cubes-gpu/src/in_wgpu.rs b/all-is-cubes-gpu/src/in_wgpu.rs index 9d723db01..a0fd23fa9 100644 --- a/all-is-cubes-gpu/src/in_wgpu.rs +++ b/all-is-cubes-gpu/src/in_wgpu.rs @@ -85,7 +85,10 @@ impl SurfaceRenderer { adapter: &wgpu::Adapter, ) -> Result { let (device, queue) = adapter - .request_device(&EverythingRenderer::::device_descriptor(), None) + .request_device( + &EverythingRenderer::::device_descriptor(adapter.limits()), + None, + ) .await .map_err(|e| { GraphicsResourceError::new( @@ -232,13 +235,12 @@ pub struct EverythingRenderer { impl EverythingRenderer { /// A device descriptor suitable for the expectations of [`EverythingRenderer`]. - pub fn device_descriptor() -> wgpu::DeviceDescriptor<'static> { + pub fn device_descriptor(available_limits: wgpu::Limits) -> wgpu::DeviceDescriptor<'static> { wgpu::DeviceDescriptor { features: wgpu::Features::empty(), limits: wgpu::Limits { max_inter_stage_shader_components: 32, // number used by blocks-and-lines shader - ..wgpu::Limits::downlevel_webgl2_defaults() - .using_resolution(wgpu::Limits::default()) + ..wgpu::Limits::downlevel_webgl2_defaults().using_resolution(available_limits) }, label: None, } diff --git a/all-is-cubes-gpu/src/in_wgpu/headless.rs b/all-is-cubes-gpu/src/in_wgpu/headless.rs index 9f9c7ad48..ab629491b 100644 --- a/all-is-cubes-gpu/src/in_wgpu/headless.rs +++ b/all-is-cubes-gpu/src/in_wgpu/headless.rs @@ -26,7 +26,7 @@ impl Builder { ) -> Result { let (device, queue) = adapter .request_device( - &in_wgpu::EverythingRenderer::::device_descriptor(), + &in_wgpu::EverythingRenderer::::device_descriptor(adapter.limits()), None, ) .await?; diff --git a/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs b/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs index 34c0340ff..b93a02738 100644 --- a/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs +++ b/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs @@ -41,7 +41,7 @@ where { let (device, queue) = adapter .request_device( - &in_wgpu::EverythingRenderer::::device_descriptor(), + &in_wgpu::EverythingRenderer::::device_descriptor(adapter.limits()), None, ) .await