Skip to content

Commit

Permalink
Try to work around rust-windowing#199
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed Jun 24, 2019
1 parent 0b29906 commit e727fd9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions metal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,11 @@ impl MetalDevice {

render_command_encoder.use_resource(&data_buffer, MTLResourceUsage::Read);

// Metal expects the data buffer to remain live. (Issue #199.)
// FIXME(pcwalton): When do we deallocate this? What are the expected
// lifetime semantics?
mem::forget(data_buffer);

if let Some(vertex_argument_buffer) = vertex_argument_buffer {
let range = NSRange::new(0, vertex_argument_buffer.length());
vertex_argument_buffer.did_modify_range(range);
Expand Down

0 comments on commit e727fd9

Please sign in to comment.