diff options
| author | Micha White <botahamec@outlook.com> | 2023-02-05 12:44:37 -0500 |
|---|---|---|
| committer | Micha White <botahamec@outlook.com> | 2023-02-05 12:44:37 -0500 |
| commit | 7c3956da9005e204f8b140cd569022568de53824 (patch) | |
| tree | 31821716f946499cfbafe7d38f8c6c7d07df5634 | |
| parent | 699fe35086d38b5e70cd476232bb79554cd39511 (diff) | |
Allow for buffers larger than 256 MB
| -rw-r--r-- | alligator_render/examples/bunnymark.rs | 2 | ||||
| -rw-r--r-- | alligator_render/src/config.rs | 4 | ||||
| -rw-r--r-- | alligator_render/src/renderer.rs | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/alligator_render/examples/bunnymark.rs b/alligator_render/examples/bunnymark.rs index 55feb86..1579cf0 100644 --- a/alligator_render/examples/bunnymark.rs +++ b/alligator_render/examples/bunnymark.rs @@ -132,7 +132,7 @@ fn main() { // configure the render window let render_config = RenderWindowConfig { title: "BunnyMark", - instance_capacity: 5_000_000, + instance_capacity: 150_000, default_width: NonZeroU32::new(1280).unwrap(), default_height: NonZeroU32::new(720).unwrap(), vsync: false, diff --git a/alligator_render/src/config.rs b/alligator_render/src/config.rs index 952e885..e342657 100644 --- a/alligator_render/src/config.rs +++ b/alligator_render/src/config.rs @@ -67,7 +67,9 @@ pub struct RenderWindowConfig<'a> { pub vsync: bool, /// The initial capacity of the instance buffer. The size will increase if /// it's not large enough. Increasing this value may improve performance - /// towards the beginning, if a lot of instances are being created. + /// towards the beginning, if a lot of instances are being created. For + /// compatibility with older devices, it's recommended to keep this number + /// below 150 thousand. pub instance_capacity: usize, } diff --git a/alligator_render/src/renderer.rs b/alligator_render/src/renderer.rs index fdd8c34..e6a3d22 100644 --- a/alligator_render/src/renderer.rs +++ b/alligator_render/src/renderer.rs @@ -178,6 +178,10 @@ impl Renderer { .request_device( &wgpu::DeviceDescriptor { features: wgpu::Features::empty(), + limits: wgpu::Limits { + max_buffer_size: adapter.limits().max_buffer_size, + ..Default::default() + }, ..Default::default() }, None, |
