wgpu::TextureView
我在render
如下方法中创建一个:
let mut encoder = self.device.create_command_encoder(...);
let texture_view = self
.surface
.get_current_frame()?
.output
.texture
.create_view(&wgpu::TextureViewDescriptor::default());
let mut render_pass = encoder.begin_render_pas(&wgpu::RenderPassDescriptor {
color_attachments: &[wgpu::RenderPassColorAttachment {
view: &texture_view,
...
}],
...
})
render_pass.set_/* pipeline, bind_group, vertex_buffer, index_buffer */(...);
render_pass.draw_indexed(...);
self.queue.submit(std::iter::once(encoder.finish()));
但是当我运行程序时,它会恐慌:
thread 'main' panicked at 'Texture[1] does not exist', /home/doliphin/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.10.0/src/hub.rs:129:32