Changeset 87c8f1a in opengl-game for vulkan-utils.cpp


Ignore:
Timestamp:
Nov 1, 2019, 5:11:45 PM (4 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
d2d9286
Parents:
34bdf3a
git-author:
Dmitry Portnoy <dmitry.portnoy@…> (11/01/19 17:09:16)
git-committer:
Dmitry Portnoy <dmitry.portnoy@…> (11/01/19 17:11:45)
Message:

In vaulkangame, define vertex buffer and index buffer data and transfer it to the gpu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-utils.cpp

    r34bdf3a r87c8f1a  
    482482}
    483483
     484void VulkanUtils::copyBuffer(VkDevice device, VkCommandPool commandPool, VkBuffer srcBuffer,
     485      VkBuffer dstBuffer, VkDeviceSize srcOffset, VkDeviceSize dstOffset, VkDeviceSize size,
     486      VkQueue graphicsQueue) {
     487   VkCommandBuffer commandBuffer = beginSingleTimeCommands(device, commandPool);
     488
     489   VkBufferCopy copyRegion = { srcOffset, dstOffset, size };
     490   vkCmdCopyBuffer(commandBuffer, srcBuffer, dstBuffer, 1, &copyRegion);
     491
     492   endSingleTimeCommands(device, commandPool, commandBuffer, graphicsQueue);
     493}
     494
    484495bool VulkanUtils::hasStencilComponent(VkFormat format) {
    485496   return format == VK_FORMAT_D32_SFLOAT_S8_UINT || format == VK_FORMAT_D24_UNORM_S8_UINT;
Note: See TracChangeset for help on using the changeset viewer.