Changeset 996dd3e in opengl-game for vulkan-utils.hpp


Ignore:
Timestamp:
May 14, 2021, 1:09:34 AM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
a3cefaa
Parents:
9d21aac
Message:

Completely remove storage buffers from the GraphicsPipeline_Vulkan class and start moving storage buffer operations out of the addObject() and updateObject() functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-utils.hpp

    r9d21aac r996dd3e  
    117117template<class DataType>
    118118void VulkanUtils::copyDataToBuffer(VkDevice device, VkPhysicalDevice physicalDevice, VkCommandPool commandPool,
    119       const vector<DataType>& srcData, VkBuffer dstBuffer, size_t dstVertexOffset, VkQueue graphicsQueue) {
     119                                   const vector<DataType>& srcData, VkBuffer dstBuffer, size_t dstVertexOffset,
     120                                   VkQueue graphicsQueue) {
    120121   VkDeviceSize srcDataSize = srcData.size() * sizeof(DataType);
    121122
     
    140141template<class DataType>
    141142void VulkanUtils::copyDataToMemory(VkDevice device, const DataType& srcData, VkDeviceMemory bufferMemory,
    142    VkDeviceSize offset) {
     143                                   VkDeviceSize offset) {
    143144   copyDataToMemory(device, srcData, bufferMemory, offset, sizeof(DataType));
    144145}
    145146
     147// TODO: This would be used when the GPU memory is host-coherent. If it it not, I also need to use vkFlushMappedMemoryRanges
     148// I should create a variant that supports non-coherent memory
    146149template<class DataType>
    147150void VulkanUtils::copyDataToMemory(VkDevice device, const DataType& srcData, VkDeviceMemory bufferMemory,
Note: See TracChangeset for help on using the changeset viewer.