mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Merge #45
45: Remove non-winit from the example r=grovesNL a=kvark This are the follow-up fixes to #38 as suggested by the review Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>
This commit is contained in:
commit
5acbf75fb8
@ -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]);
|
||||
}
|
||||
}
|
||||
|
@ -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),
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user