Define device limits in App, and raise buffer size limits

This commit is contained in:
Jarrod Doyle 2023-05-04 16:17:32 +01:00
parent 6d9fc9b0b8
commit 71d547cd62
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 11 additions and 3 deletions

View File

@ -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,

View File

@ -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,
)