diff --git a/src/main.rs b/src/main.rs index 6d9f0fd9..4871c2c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -222,7 +222,7 @@ impl GraphicsData { let model_buf = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { label: Some(format!("ModelGraphics{}",i).as_str()), contents: bytemuck::cast_slice(&model_uniforms), - usage: wgpu::BufferUsages::STORAGE | wgpu::BufferUsages::COPY_DST, + usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST, }); let model_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { layout: &self.bind_group_layouts.model, @@ -331,9 +331,6 @@ impl framework::Example for GraphicsData { | wgpu::Features::TEXTURE_COMPRESSION_ETC2 | wgpu::Features::TEXTURE_COMPRESSION_BC } - fn required_features() -> wgpu::Features { - wgpu::Features::STORAGE_RESOURCE_BINDING_ARRAY - } fn required_limits() -> wgpu::Limits { wgpu::Limits::default() //framework.rs was using goofy limits that caused me a multi-day headache } @@ -498,7 +495,7 @@ impl framework::Example for GraphicsData { binding: 0, visibility: wgpu::ShaderStages::VERTEX, ty: wgpu::BindingType::Buffer { - ty: wgpu::BufferBindingType::Storage { read_only: true }, + ty: wgpu::BufferBindingType::Uniform, has_dynamic_offset: false, min_binding_size: None, }, diff --git a/src/shader.wgsl b/src/shader.wgsl index d886a73f..e289c022 100644 --- a/src/shader.wgsl +++ b/src/shader.wgsl @@ -49,9 +49,10 @@ 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; @group(1) @binding(0) -var model_instances: array; +var model_instances: array; @group(1) @binding(1) var model_texture: texture_2d;