Mercurial > games > semicongine
comparison test1.nim @ 1197:f6a0dc7ad052 compiletime-tests
sync from bedroom to office
author | sam <sam@basx.dev> |
---|---|
date | Fri, 12 Jul 2024 23:06:29 +0700 |
parents | 82feceae80b1 |
children | 96a094cd0c78 |
comparison
equal
deleted
inserted
replaced
1196:82feceae80b1 | 1197:f6a0dc7ad052 |
---|---|
1 import os | 1 import std/os |
2 import std/options | |
2 | 3 |
3 import semicongine | 4 import semicongine |
4 | 5 |
5 type | 6 type |
6 MeshA = object | 7 MeshA = object |
131 level: VK_COMMAND_BUFFER_LEVEL_PRIMARY, | 132 level: VK_COMMAND_BUFFER_LEVEL_PRIMARY, |
132 commandBufferCount: INFLIGHTFRAMES, | 133 commandBufferCount: INFLIGHTFRAMES, |
133 ) | 134 ) |
134 checkVkResult vkAllocateCommandBuffers(vulkan.device, addr allocInfo, cmdBuffers.ToCPointer) | 135 checkVkResult vkAllocateCommandBuffers(vulkan.device, addr allocInfo, cmdBuffers.ToCPointer) |
135 | 136 |
137 | |
138 | |
136 # start command buffer | 139 # start command buffer |
137 block: | 140 block: |
138 let | 141 let |
139 currentFramebuffer = VkFramebuffer(0) # TODO | 142 currentFramebuffer = VkFramebuffer(0) # TODO |
140 currentFrameInFlight = 1 | 143 currentFrameInFlight = 1 |
178 # setup viewport | 181 # setup viewport |
179 vkCmdSetViewport(cmd, firstViewport = 0, viewportCount = 1, addr(viewport)) | 182 vkCmdSetViewport(cmd, firstViewport = 0, viewportCount = 1, addr(viewport)) |
180 vkCmdSetScissor(cmd, firstScissor = 0, scissorCount = 1, addr(scissor)) | 183 vkCmdSetScissor(cmd, firstScissor = 0, scissorCount = 1, addr(scissor)) |
181 | 184 |
182 # bind pipeline, will be loop | 185 # bind pipeline, will be loop |
183 block: | 186 # block: |
184 Bind(pipeline1, cmd, currentFrameInFlight = currentFrameInFlight) | 187 # Bind(pipeline1, cmd, currentFrameInFlight = currentFrameInFlight) |
185 | 188 |
186 # render object, will be loop | 189 # render object, will be loop |
187 block: | 190 # block: |
188 Render(cmd, pipeline1, myGlobals, uniforms1, myMesh1, instances1) | 191 # Render(cmd, pipeline1, myGlobals, uniforms1, myMesh1, instances1) |
189 | 192 |
190 vkCmdEndRenderPass(cmd) | 193 vkCmdEndRenderPass(cmd) |
191 checkVkResult cmd.vkEndCommandBuffer() | 194 checkVkResult cmd.vkEndCommandBuffer() |