diff --git a/wgpu-core/src/validation.rs b/wgpu-core/src/validation.rs index ad76f0523f..921ec49275 100644 --- a/wgpu-core/src/validation.rs +++ b/wgpu-core/src/validation.rs @@ -868,9 +868,6 @@ impl Interface { _ => continue, }; let ty = match module.types[var.ty].inner { - naga::TypeInner::Struct { members: _, span } => ResourceType::Buffer { - size: wgt::BufferSize::new(span as u64).unwrap(), - }, naga::TypeInner::Image { dim, arrayed, @@ -884,10 +881,9 @@ impl Interface { naga::TypeInner::Array { stride, .. } => ResourceType::Buffer { size: wgt::BufferSize::new(stride as u64).unwrap(), }, - ref other => { - log::error!("Unexpected resource type: {:?}", other); - continue; - } + ref other => ResourceType::Buffer { + size: wgt::BufferSize::new(other.size(&module.constants) as u64).unwrap(), + }, }; let handle = resources.append( Resource { diff --git a/wgpu/examples/cube/shader.wgsl b/wgpu/examples/cube/shader.wgsl index 5d106494ea..e79bd02610 100644 --- a/wgpu/examples/cube/shader.wgsl +++ b/wgpu/examples/cube/shader.wgsl @@ -3,12 +3,9 @@ struct VertexOutput { @builtin(position) position: vec4, }; -struct Locals { - transform: mat4x4 -}; @group(0) @binding(0) -var r_locals: Locals; +var transform: mat4x4; @vertex fn vs_main( @@ -17,7 +14,7 @@ fn vs_main( ) -> VertexOutput { var result: VertexOutput; result.tex_coord = tex_coord; - result.position = r_locals.transform * position; + result.position = transform * position; return result; }