Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Commit

Permalink
Enforce lifetimes of resource dependencies of passes
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Jan 13, 2020
1 parent 87650d9 commit aec0831
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ impl<'a> RenderPass<'a> {
pub fn set_bind_group(
&mut self,
index: u32,
bind_group: &BindGroup,
bind_group: &'a BindGroup,
offsets: &[BufferAddress],
) {
unsafe {
Expand All @@ -1210,7 +1210,7 @@ impl<'a> RenderPass<'a> {
/// Sets the active render pipeline.
///
/// Subsequent draw calls will exhibit the behavior defined by `pipeline`.
pub fn set_pipeline(&mut self, pipeline: &RenderPipeline) {
pub fn set_pipeline(&mut self, pipeline: &'a RenderPipeline) {
unsafe {
wgn::wgpu_render_pass_set_pipeline(
self.id.as_mut().unwrap(),
Expand All @@ -1232,7 +1232,7 @@ impl<'a> RenderPass<'a> {
///
/// Subsequent calls to [`draw_indexed`](RenderPass::draw_indexed) on this [`RenderPass`] will
/// use `buffer` as the source index buffer.
pub fn set_index_buffer(&mut self, buffer: &Buffer, offset: BufferAddress) {
pub fn set_index_buffer(&mut self, buffer: &'a Buffer, offset: BufferAddress) {
unsafe {
wgn::wgpu_render_pass_set_index_buffer(
self.id.as_mut().unwrap(),
Expand All @@ -1249,7 +1249,7 @@ impl<'a> RenderPass<'a> {
pub fn set_vertex_buffers(
&mut self,
start_slot: u32,
buffer_pairs: &[(&Buffer, BufferAddress)],
buffer_pairs: &[(&'a Buffer, BufferAddress)],
) {
let mut buffers = Vec::new();
let mut offsets = Vec::new();
Expand Down Expand Up @@ -1340,7 +1340,7 @@ impl<'a> RenderPass<'a> {
/// Draws primitives from the active vertex buffer(s) based on the contents of the `indirect_buffer`.
///
/// The active vertex buffers can be set with [`RenderPass::set_vertex_buffers`].
pub fn draw_indirect(&mut self, indirect_buffer: &Buffer, indirect_offset: BufferAddress) {
pub fn draw_indirect(&mut self, indirect_buffer: &'a Buffer, indirect_offset: BufferAddress) {
unsafe {
wgn::wgpu_render_pass_draw_indirect(
self.id.as_mut().unwrap(),
Expand All @@ -1357,7 +1357,7 @@ impl<'a> RenderPass<'a> {
/// vertex buffers can be set with [`RenderPass::set_vertex_buffers`].
pub fn draw_indexed_indirect(
&mut self,
indirect_buffer: &Buffer,
indirect_buffer: &'a Buffer,
indirect_offset: BufferAddress,
) {
unsafe {
Expand Down Expand Up @@ -1385,7 +1385,7 @@ impl<'a> ComputePass<'a> {
pub fn set_bind_group(
&mut self,
index: u32,
bind_group: &BindGroup,
bind_group: &'a BindGroup,
offsets: &[BufferAddress],
) {
unsafe {
Expand All @@ -1400,7 +1400,7 @@ impl<'a> ComputePass<'a> {
}

/// Sets the active compute pipeline.
pub fn set_pipeline(&mut self, pipeline: &ComputePipeline) {
pub fn set_pipeline(&mut self, pipeline: &'a ComputePipeline) {
unsafe {
wgn::wgpu_compute_pass_set_pipeline(
self.id.as_mut().unwrap(),
Expand All @@ -1422,7 +1422,7 @@ impl<'a> ComputePass<'a> {
}

/// Dispatches compute work operations, based on the contents of the `indirect_buffer`.
pub fn dispatch_indirect(&mut self, indirect_buffer: &Buffer, indirect_offset: BufferAddress) {
pub fn dispatch_indirect(&mut self, indirect_buffer: &'a Buffer, indirect_offset: BufferAddress) {
unsafe {
wgn::wgpu_compute_pass_dispatch_indirect(
self.id.as_mut().unwrap(),
Expand Down

0 comments on commit aec0831

Please sign in to comment.