Changeset b7fc3c2 in opengl-game for vulkan-game.hpp


Ignore:
Timestamp:
Jun 10, 2021, 2:58:54 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
c1ec4f6
Parents:
bb76950
git-author:
Dmitry Portnoy <dportnoy@…> (06/10/21 14:53:52)
git-committer:
Dmitry Portnoy <dportnoy@…> (06/10/21 14:58:54)
Message:

Modify the VulkanBuffer class to take a range and to align data based on that rather than the size of an individual data item. Also, reorganize the code in VulkanGae::updateScene() in a more logical fashion, and remove VulkanGame::updateObject() and inline its functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.hpp

    rbb76950 rb7fc3c2  
    459459
    460460      template<class VertexType, class SSBOType>
    461       void updateObject(SceneObject<VertexType, SSBOType>& obj);
    462 
    463       template<class VertexType, class SSBOType>
    464461      void updateObjectVertices(GraphicsPipeline_Vulkan<VertexType>& pipeline,
    465462            SceneObject<VertexType, SSBOType>& obj, size_t index);
     
    508505}
    509506
    510 // TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model
    511 // and to change the model matrix later by setting model_transform and then calling updateObject()
     507// TODO: Right now, it's basically necessary to pass the identity matrix in for ssbo.model and to change
     508// the model matrix later by setting model_transform and then calculating the new ssbo.model.
    512509// Figure out a better way to allow the model matrix to be set during object creation
    513510template<class VertexType, class SSBOType>
     
    517514                                                         VulkanBuffer<SSBOType>& objectBuffer, SSBOType ssbo) {
    518515   // TODO: Use the model field of ssbo to set the object's model_base
    519    // currently, the passed in model is useless since it gets overridden in updateObject() anyway
     516   // currently, the passed-in model is useless since it gets overridden when ssbo.model is recalculated
    520517   size_t numVertices = pipeline.getNumVertices();
    521518
     
    624621}
    625622
    626 // TODO: Just pass in the single object instead of a list of all of them
    627 template<class VertexType, class SSBOType>
    628 void VulkanGame::updateObject(SceneObject<VertexType, SSBOType>& obj) {
    629    obj.ssbo.model = obj.model_transform * obj.model_base;
    630    obj.center = vec3(obj.ssbo.model * vec4(0.0f, 0.0f, 0.0f, 1.0f));
    631 
    632    obj.modified = false;
    633 }
    634 
    635623template<class VertexType, class SSBOType>
    636624void VulkanGame::updateObjectVertices(GraphicsPipeline_Vulkan<VertexType>& pipeline,
Note: See TracChangeset for help on using the changeset viewer.