From 71d547cd62e88e060b270fdc59e25b88e3579d43 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Thu, 4 May 2023 16:17:32 +0100 Subject: [PATCH] Define device limits in App, and raise buffer size limits --- src/core/app.rs | 10 +++++++++- src/render/context.rs | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/core/app.rs b/src/core/app.rs index b59917e..ad2c85f 100644 --- a/src/core/app.rs +++ b/src/core/app.rs @@ -28,7 +28,15 @@ impl App { .build(&event_loop) .unwrap(); - let render_ctx = render::Context::new(&window).await; + let render_ctx = render::Context::new( + &window, + wgpu::Limits { + max_storage_buffer_binding_size: 1 << 29, + max_buffer_size: 1 << 29, + ..Default::default() + }, + ) + .await; Self { window, diff --git a/src/render/context.rs b/src/render/context.rs index 905c5a3..67d94c0 100644 --- a/src/render/context.rs +++ b/src/render/context.rs @@ -11,7 +11,7 @@ pub struct Context { } impl Context { - pub async fn new(window: &Window) -> Self { + pub async fn new(window: &Window, limits: wgpu::Limits) -> Self { log::info!("Initialising WGPU context..."); let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { backends: wgpu::Backends::VULKAN, @@ -42,7 +42,7 @@ impl Context { &wgpu::DeviceDescriptor { label: None, features: wgpu::Features::empty(), - limits: wgpu::Limits::default(), + limits, }, None, )