From f788b0e924098febc4a2b9545c8aa6603c232929 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 22 Jul 2024 12:29:20 -0700 Subject: [PATCH] fix it --- src/graphics.rs | 4 +++- src/shader.wgsl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics.rs b/src/graphics.rs index a5c827a..fbeb0cc 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -463,7 +463,9 @@ impl GraphicsState{ instance_count+=model.instances.len(); for instances_chunk in model.instances.rchunks(chunk_size){ model_count+=1; - let model_uniforms=get_instances_buffer_data(instances_chunk); + let mut model_uniforms=get_instances_buffer_data(instances_chunk); + //TEMP: fill with zeroes to pass validation + model_uniforms.resize(MODEL_BUFFER_SIZE*512,0.0f32); let model_buf=device.create_buffer_init(&wgpu::util::BufferInitDescriptor{ label:Some(format!("Model{} Buf",model_count).as_str()), contents:bytemuck::cast_slice(&model_uniforms), diff --git a/src/shader.wgsl b/src/shader.wgsl index 5addba9..4298a03 100644 --- a/src/shader.wgsl +++ b/src/shader.wgsl @@ -48,7 +48,7 @@ struct ModelInstance{ //my fancy idea is to create a megatexture for each model that includes all the textures each intance will need //the texture transform then maps the texture coordinates to the location of the specific texture //group 1 is the model -const MAX_MODEL_INSTANCES=4096; +const MAX_MODEL_INSTANCES=512; @group(2) @binding(0) var model_instances: array;