Skip to content

Commit

Permalink
fix: not copy resource;
Browse files Browse the repository at this point in the history
  • Loading branch information
mycrl committed Aug 5, 2024
1 parent be87af1 commit b44a711
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ impl<'a> Frame<'a> {
};

let texture = texture.unwrap();

// Copy the real texture to copy texture
unsafe {
self.context.CopyResource(&texture, &self.frame_texture);
};

Ok(texture)
}

Expand All @@ -198,11 +204,6 @@ impl<'a> Frame<'a> {
pub fn buffer(&mut self) -> Result<FrameBuffer, Error> {
let texture = self.texture()?;

// Copy the real texture to copy texture
unsafe {
self.context.CopyResource(&texture, &self.frame_texture);
};

// Map the texture to enable CPU access
let mut mapped_resource = D3D11_MAPPED_SUBRESOURCE::default();
unsafe {
Expand Down

0 comments on commit b44a711

Please sign in to comment.