Changeset 5ea0a37 in opengl-game for sdl-game.hpp


Ignore:
Timestamp:
Jun 11, 2021, 10:05:25 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
90880fb
Parents:
6486ba8
Message:

Add a function to VulkanBuffer to return a pointer to the buffer memory, and replace the use of updateBufferSet with copyDataToMemory to update all the data for a single pipeline in one call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sdl-game.hpp

    r6486ba8 r5ea0a37  
    300300                           bool copyData);
    301301
    302       template<class SSBOType>
    303       void updateBufferSet(BufferSet& set, size_t objIndex, SSBOType& ssbo);
    304 
    305302      // TODO: Since addObject() returns a reference to the new object now,
    306303      // stop using objects.back() to access the object that was just created
     
    338335      void quitGame();
    339336};
    340 
    341 // TODO: See if it makes sense to pass in the current swapchain index instead of updating all of them
    342 template<class SSBOType>
    343 void VulkanGame::updateBufferSet(BufferSet& set, size_t objIndex, SSBOType& ssbo) {
    344    for (size_t i = 0; i < set.memory.size(); i++) {
    345       VulkanUtils::copyDataToMemory(device, &ssbo, set.memory[i], objIndex * sizeof(SSBOType), sizeof(ssbo), false);
    346    }
    347 }
    348337
    349338// TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model and to change
Note: See TracChangeset for help on using the changeset viewer.