Changeset 5049354 in opengl-game


Ignore:
Timestamp:
Apr 7, 2021, 3:02:50 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
914bb99
Parents:
db2d995
Message:

Change copyDataToMemory to use an arbitrary offset instead of multiplying it by the data size

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • graphics-pipeline_vulkan.hpp

    rdb2d995 r5049354  
    547547   if (!is_same_v<SSBOType, void*>) {
    548548      for (size_t i = 0; i < storageBufferSet.memory.size(); i++) {
    549          VulkanUtils::copyDataToMemory(this->device, storageBufferSet.memory[i], objIndex, ssbo);
     549         VulkanUtils::copyDataToMemory(this->device, storageBufferSet.memory[i], objIndex * sizeof(SSBOType), ssbo);
    550550      }
    551551   }
  • vulkan-utils.hpp

    rdb2d995 r5049354  
    135135   void* data;
    136136
    137    vkMapMemory(device, bufferMemory, offset * sizeof(DataType), sizeof(DataType), 0, &data);
     137   vkMapMemory(device, bufferMemory, offset, sizeof(DataType), 0, &data);
    138138   memcpy(data, &srcData, sizeof(DataType));
    139139   vkUnmapMemory(device, bufferMemory);
Note: See TracChangeset for help on using the changeset viewer.