diff --git a/wgpu-core/src/validation.rs b/wgpu-core/src/validation.rs index ad76f0523fc..921ec492752 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 98ee4dfdfbb..49a2ae309c0 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; @stage(vertex) fn vs_main( @@ -17,7 +14,7 @@ fn vs_main( ) -> VertexOutput { var out: VertexOutput; out.tex_coord = tex_coord; - out.position = r_locals.transform * position; + out.position = transform * position; return out; }