Skip to content

Commit

Permalink
[rs] Merge gfx-rs#300
Browse files Browse the repository at this point in the history
300: Properly free pass contents r=kvark a=kvark

Fixes gfx-rs#299

Co-authored-by: Dzmitry Malyshau <[email protected]>
  • Loading branch information
bors[bot] and kvark authored May 6, 2020
2 parents ae58ac8 + 55b727e commit 8e2486f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 24 deletions.
4 changes: 2 additions & 2 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ vulkan = ["wgc/gfx-backend-vulkan"]
package = "wgpu-core"
version = "0.5"
git = "https://github.com/gfx-rs/wgpu"
rev = "bee826e79dcbe11b544296179a6bbb2c05d9639b"
rev = "4c448c3fc583da6d22c62c7e92bbb74b53863357"
features = ["raw-window-handle"]

[dependencies.wgt]
package = "wgpu-types"
version = "0.5"
git = "https://github.com/gfx-rs/wgpu"
rev = "bee826e79dcbe11b544296179a6bbb2c05d9639b"
rev = "4c448c3fc583da6d22c62c7e92bbb74b53863357"

[dependencies]
arrayvec = "0.5"
Expand Down
13 changes: 8 additions & 5 deletions wgpu/examples/capture/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ async fn run() {
.unwrap();

let (device, queue) = adapter
.request_device(&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
.request_device(
&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
},
limits: wgpu::Limits::default(),
},
limits: wgpu::Limits::default(),
}, None)
None,
)
.await
.unwrap();

Expand Down
13 changes: 8 additions & 5 deletions wgpu/examples/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ async fn run_async<E: Example>(event_loop: EventLoop<()>, window: Window) {
.unwrap();

let (device, queue) = adapter
.request_device(&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
.request_device(
&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
},
limits: wgpu::Limits::default(),
},
limits: wgpu::Limits::default(),
}, None)
None,
)
.await
.unwrap();

Expand Down
13 changes: 8 additions & 5 deletions wgpu/examples/hello-compute/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
.unwrap();

let (device, queue) = adapter
.request_device(&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
.request_device(
&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
},
limits: wgpu::Limits::default(),
},
limits: wgpu::Limits::default(),
}, None)
None,
)
.await
.unwrap();

Expand Down
13 changes: 8 additions & 5 deletions wgpu/examples/hello-triangle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ async fn run(event_loop: EventLoop<()>, window: Window, swapchain_format: wgpu::
.unwrap();

let (device, queue) = adapter
.request_device(&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
.request_device(
&wgpu::DeviceDescriptor {
extensions: wgpu::Extensions {
anisotropic_filtering: false,
},
limits: wgpu::Limits::default(),
},
limits: wgpu::Limits::default(),
}, None)
None,
)
.await
.unwrap();

Expand Down
6 changes: 4 additions & 2 deletions wgpu/src/backend/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,8 @@ impl crate::Context for Context {
let ptr = wgc::command::compute_ffi::wgpu_compute_pass_finish(pass, &mut length);
slice::from_raw_parts(ptr, length)
};
gfx_select!(*encoder => self.command_encoder_run_compute_pass(*encoder, data))
gfx_select!(*encoder => self.command_encoder_run_compute_pass(*encoder, data));
unsafe { pass.invalidate() };
}

fn encoder_begin_render_pass<'a>(
Expand Down Expand Up @@ -867,7 +868,8 @@ impl crate::Context for Context {
let ptr = wgc::command::render_ffi::wgpu_render_pass_finish(pass, &mut length);
slice::from_raw_parts(ptr, length)
};
gfx_select!(*encoder => self.command_encoder_run_render_pass(*encoder, data))
gfx_select!(*encoder => self.command_encoder_run_render_pass(*encoder, data));
unsafe { pass.invalidate() };
}

fn encoder_finish(&self, encoder: &Self::CommandEncoderId) -> Self::CommandBufferId {
Expand Down

0 comments on commit 8e2486f

Please sign in to comment.