Remove the non-winit path from the example

This commit is contained in:
Dzmitry Malyshau 2019-01-22 17:08:21 -08:00
parent 742fee7e41
commit edf269dbed
3 changed files with 3 additions and 36 deletions

View File

@ -117,39 +117,4 @@ fn main() {
ControlFlow::Continue
});
}
#[cfg(not(feature = "winit"))]
{
let _ = render_pipeline;
let texture = device.create_texture(&wgpu::TextureDescriptor {
size: wgpu::Extent3d {
width: 256,
height: 256,
depth: 1,
},
array_size: 1,
dimension: wgpu::TextureDimension::D2,
format: wgpu::TextureFormat::R8g8b8a8Unorm,
usage: wgpu::TextureUsageFlags::OUTPUT_ATTACHMENT,
});
let color_view = texture.create_default_texture_view();
let mut cmd_buf = device.create_command_buffer(&wgpu::CommandBufferDescriptor {});
{
let rpass = cmd_buf.begin_render_pass(&wgpu::RenderPassDescriptor {
color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor {
attachment: &color_view,
load_op: wgpu::LoadOp::Clear,
store_op: wgpu::StoreOp::Store,
clear_color: wgpu::Color::GREEN,
}],
depth_stencil_attachment: None,
});
rpass.end_pass();
}
device
.get_queue()
.submit(&[cmd_buf]);
}
}

View File

@ -66,6 +66,9 @@ pub extern "C" fn wgpu_compute_pass_set_bind_group(
let bind_group_guard = HUB.bind_groups.read();
let bind_group = bind_group_guard.get(bind_group_id);
//Note: currently, WebGPU compute passes have synchronization defined
// at a dispatch granularity, so we insert the necessary barriers here.
CommandBuffer::insert_barriers(
&mut pass.raw,
pass.buffer_tracker.consume_by_replace(&bind_group.used_buffers),

View File

@ -73,7 +73,6 @@ pub extern "C" fn wgpu_render_pass_set_index_buffer(
TrackPermit::EXTEND,
)
.unwrap();
buffer_guard.get(buffer_id);
let view = hal::buffer::IndexBufferView {
buffer: &buffer.raw,