Changeset 6bac215 in opengl-game for sdl-game.cpp


Ignore:
Timestamp:
Jun 9, 2021, 12:38:14 AM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
bb76950
Parents:
8dcbf62
git-author:
Dmitry Portnoy <dportnoy@…> (06/09/21 00:38:09)
git-committer:
Dmitry Portnoy <dportnoy@…> (06/09/21 00:38:14)
Message:

Rewrite a large portion of the VulkanBuffer class, start using it more
to resize buffers, and simplify resizeBufferSet() since the additions to
VulkanBuffer can now do some of what that function used to do

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sdl-game.cpp

    r8dcbf62 r6bac215  
    269269
    270270   createBufferSet(objects_modelPipeline.capacity * sizeof(SSBO_ModelObject),
    271       VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
    272       VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
    273       storageBuffers_modelPipeline);
     271                   VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT
     272                   | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
     273                   VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
     274                   storageBuffers_modelPipeline);
    274275}
    275276
     
    456457
    457458   // TODO: Probably move the resizing to the VulkanBuffer class
    458    if (objects_modelPipeline.numObjects > objects_modelPipeline.capacity) {
     459   if (objects_modelPipeline.resized) {
    459460      // TODO: Also resize the dynamic ubo
    460461      resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool,
    461462                      graphicsQueue);
     463
     464      objects_modelPipeline.resize();
    462465   }
    463466
Note: See TracChangeset for help on using the changeset viewer.