File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ namespace api {
2020class ParamsBuffer final {
2121 private:
2222 Context* context_p_;
23- size_t nbytes_;
2423 vkapi::VulkanBuffer vulkan_buffer_;
2524
2625 public:
@@ -29,14 +28,12 @@ class ParamsBuffer final {
2928 template <typename Block>
3029 ParamsBuffer (Context* context_p, const Block& block)
3130 : context_p_(context_p),
32- nbytes_ (sizeof (block)),
3331 vulkan_buffer_ (
3432 context_p_->adapter_ptr ()->vma().create_params_buffer(block)) {}
3533
3634 template <typename Block>
3735 ParamsBuffer (Context* context_p, const VkDeviceSize nbytes)
3836 : context_p_(context_p),
39- nbytes_(nbytes),
4037 vulkan_buffer_(
4138 context_p_->adapter_ptr ()->vma().create_uniform_buffer(nbytes)) {}
4239
@@ -70,7 +67,7 @@ class ParamsBuffer final {
7067 template <typename T>
7168 T read () const {
7269 T val;
73- if (sizeof (val) != nbytes_ ) {
70+ if (sizeof (val) != vulkan_buffer_. mem_size () ) {
7471 VK_THROW (
7572 " Attempted to store value from ParamsBuffer to type of different size" );
7673 }
Original file line number Diff line number Diff line change @@ -29,12 +29,7 @@ VulkanBuffer::VulkanBuffer(
2929 const VmaAllocationCreateInfo& allocation_create_info,
3030 const VkBufferUsageFlags usage,
3131 const bool allocate_memory)
32- : buffer_properties_({
33- size,
34- 0u ,
35- size,
36- usage,
37- }),
32+ : buffer_properties_({size, 0u , size}),
3833 allocator_ (vma_allocator),
3934 memory_{},
4035 owns_memory_ (allocate_memory),
@@ -52,7 +47,7 @@ VulkanBuffer::VulkanBuffer(
5247 nullptr , // pNext
5348 0u , // flags
5449 buffer_properties_.size , // size
55- buffer_properties_. buffer_usage , // usage
50+ usage , // usage
5651 VK_SHARING_MODE_EXCLUSIVE, // sharingMode
5752 0u , // queueFamilyIndexCount
5853 nullptr , // pQueueFamilyIndices
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ class VulkanBuffer final {
4848 VkDeviceSize size;
4949 VkDeviceSize mem_offset;
5050 VkDeviceSize mem_range;
51- VkBufferUsageFlags buffer_usage;
5251 };
5352
5453 explicit VulkanBuffer ();
You can’t perform that action at this time.
0 commit comments