comparison src/zamikongine/engine.nim @ 481:c472abfcee57

add: generate ubermeshes
author Sam <sam@basx.dev>
date Tue, 10 Jan 2023 00:23:40 +0700
parents 14e5151f68d1
children 73a0954beabd
comparison
equal deleted inserted replaced
480:14e5151f68d1 481:c472abfcee57
500 engine.vulkan.frameDimension, 500 engine.vulkan.frameDimension,
501 engine.vulkan.renderPass, 501 engine.vulkan.renderPass,
502 vertexShader, 502 vertexShader,
503 fragmentShader, 503 fragmentShader,
504 ) 504 )
505 var allmeshes: seq[Mesh[T]]
505 for mesh in partsOfType[ref Mesh[T]](engine.currentscenedata): 506 for mesh in partsOfType[ref Mesh[T]](engine.currentscenedata):
506 engine.vulkan.vertexBuffers.add createVertexBuffers(mesh[], engine.vulkan.device.device, engine.vulkan.device.physicalDevice.device, engine.vulkan.commandPool, engine.vulkan.device.graphicsQueue) 507 allmeshes.add(mesh[])
508 var ubermesh = createUberMesh(allmeshes)
509 engine.vulkan.vertexBuffers.add createVertexBuffers(ubermesh, engine.vulkan.device.device, engine.vulkan.device.physicalDevice.device, engine.vulkan.commandPool, engine.vulkan.device.graphicsQueue)
510
511 var allindexedmeshes: seq[IndexedMesh[T, U]]
507 for mesh in partsOfType[ref IndexedMesh[T, U]](engine.currentscenedata): 512 for mesh in partsOfType[ref IndexedMesh[T, U]](engine.currentscenedata):
508 engine.vulkan.indexedVertexBuffers.add createIndexedVertexBuffers(mesh[], engine.vulkan.device.device, engine.vulkan.device.physicalDevice.device, engine.vulkan.commandPool, engine.vulkan.device.graphicsQueue) 513 allindexedmeshes.add(mesh[])
514 var indexedubermesh = createUberMesh(allindexedmeshes)
515 engine.vulkan.indexedVertexBuffers.add createIndexedVertexBuffers(indexedubermesh, engine.vulkan.device.device, engine.vulkan.device.physicalDevice.device, engine.vulkan.commandPool, engine.vulkan.device.graphicsQueue)
509 516
510 proc recordCommandBuffer(renderPass: VkRenderPass, pipeline: VkPipeline, commandBuffer: VkCommandBuffer, framebuffer: VkFramebuffer, frameDimension: VkExtent2D, engine: var Engine) = 517 proc recordCommandBuffer(renderPass: VkRenderPass, pipeline: VkPipeline, commandBuffer: VkCommandBuffer, framebuffer: VkFramebuffer, frameDimension: VkExtent2D, engine: var Engine) =
511 var 518 var
512 beginInfo = VkCommandBufferBeginInfo( 519 beginInfo = VkCommandBufferBeginInfo(
513 sType: VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, 520 sType: VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,