diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d93f7f..ab7be39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,10 +26,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Incorrect buffer sizes in the `Mesh` pipeline. This caused vertices to entirely disappear when rendering big meshes, leading to a potential crash. +- Validation error when rendering meshes using Vulkan, Metal, D3D11, or D3D12. [#81] [#66]: https://github.com/hecrj/coffee/pull/66 [#77]: https://github.com/hecrj/coffee/pull/77 [#78]: https://github.com/hecrj/coffee/pull/78 +[#81]: https://github.com/hecrj/coffee/pull/81 ## [0.3.1] - 2019-06-20 diff --git a/Cargo.toml b/Cargo.toml index 5a83d5e..027b955 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,5 +50,4 @@ wgpu = { version = "0.2", optional = true, git = "https://github.com/gfx-rs/wgpu wgpu_glyph = { version = "0.3", optional = true, git = "https://github.com/hecrj/wgpu_glyph", rev = "0577e4d2be6b035a14aa0c5d82b143aaf26c1bd3" } [dev-dependencies] -# Example dependencies rand = "0.6" diff --git a/src/graphics/backend_wgpu/triangle.rs b/src/graphics/backend_wgpu/triangle.rs index b76f42c..5835506 100644 --- a/src/graphics/backend_wgpu/triangle.rs +++ b/src/graphics/backend_wgpu/triangle.rs @@ -112,12 +112,12 @@ impl Pipeline { let vertices = device.create_buffer(&wgpu::BufferDescriptor { size: mem::size_of::() as u64 * Self::INITIAL_BUFFER_SIZE as u64, - usage: wgpu::BufferUsage::VERTEX, + usage: wgpu::BufferUsage::VERTEX | wgpu::BufferUsage::TRANSFER_DST, }); let indices = device.create_buffer(&wgpu::BufferDescriptor { size: Self::INITIAL_BUFFER_SIZE as u64 * 2, - usage: wgpu::BufferUsage::INDEX, + usage: wgpu::BufferUsage::INDEX | wgpu::BufferUsage::TRANSFER_DST, }); Pipeline { @@ -164,12 +164,14 @@ impl Pipeline { self.vertices = device.create_buffer(&wgpu::BufferDescriptor { size: mem::size_of::() as u64 * new_size as u64, - usage: wgpu::BufferUsage::VERTEX, + usage: wgpu::BufferUsage::VERTEX + | wgpu::BufferUsage::TRANSFER_DST, }); self.indices = device.create_buffer(&wgpu::BufferDescriptor { size: new_size as u64 * 2, - usage: wgpu::BufferUsage::INDEX, + usage: wgpu::BufferUsage::INDEX + | wgpu::BufferUsage::TRANSFER_DST, }); self.buffer_size = new_size; diff --git a/tests/_graphics/models/mesh.png b/tests/_graphics/models/mesh.png deleted file mode 100644 index d18ed2e..0000000 Binary files a/tests/_graphics/models/mesh.png and /dev/null differ