Mercurial > games > semicongine
comparison tests/test_rendering.nim @ 1230:51221494caeb
fix: uncomment all tests
author | sam <sam@basx.dev> |
---|---|
date | Fri, 19 Jul 2024 04:49:18 +0700 |
parents | 5dcb503ef0c0 |
children | 70f6c1cfe005 |
comparison
equal
deleted
inserted
replaced
1229:5dcb503ef0c0 | 1230:51221494caeb |
---|---|
309 # cleanup | 309 # cleanup |
310 checkVkResult vkDeviceWaitIdle(vulkan.device) | 310 checkVkResult vkDeviceWaitIdle(vulkan.device) |
311 DestroyPipeline(pipeline) | 311 DestroyPipeline(pipeline) |
312 DestroyRenderData(renderdata) | 312 DestroyRenderData(renderdata) |
313 | 313 |
314 proc test_05_triangle_2pass(nFrames: int) = | 314 proc test_05_triangle_2pass(nFrames: int, depthBuffer: bool, samples: VkSampleCountFlagBits) = |
315 var | 315 var |
316 (offscreenRP, presentRP) = CreateIndirectPresentationRenderPass(depthBuffer = true, samples = VK_SAMPLE_COUNT_4_BIT) | 316 (offscreenRP, presentRP) = CreateIndirectPresentationRenderPass(depthBuffer = depthBuffer, samples = samples) |
317 swapchain = InitSwapchain(renderpass = presentRP).get() | 317 swapchain = InitSwapchain(renderpass = presentRP).get() |
318 | 318 |
319 var renderdata = InitRenderData() | 319 var renderdata = InitRenderData() |
320 | 320 |
321 type | 321 type |
503 (depthBuffer: true, samples: VK_SAMPLE_COUNT_1_BIT), | 503 (depthBuffer: true, samples: VK_SAMPLE_COUNT_1_BIT), |
504 (depthBuffer: true, samples: VK_SAMPLE_COUNT_4_BIT), | 504 (depthBuffer: true, samples: VK_SAMPLE_COUNT_4_BIT), |
505 ] | 505 ] |
506 | 506 |
507 # test normal | 507 # test normal |
508 if false: | 508 for i, (depthBuffer, samples) in renderPasses: |
509 for i, (depthBuffer, samples) in renderPasses: | 509 var renderpass = CreateDirectPresentationRenderPass(depthBuffer = depthBuffer, samples = samples) |
510 var renderpass = CreateDirectPresentationRenderPass(depthBuffer = depthBuffer, samples = samples) | 510 var swapchain = InitSwapchain(renderpass = renderpass).get() |
511 var swapchain = InitSwapchain(renderpass = renderpass).get() | 511 |
512 | 512 # tests a simple triangle with minimalistic shader and vertex format |
513 # tests a simple triangle with minimalistic shader and vertex format | 513 test_01_triangle(nFrames, swapchain) |
514 test_01_triangle(nFrames, swapchain) | 514 |
515 | 515 # tests instanced triangles and quads, mixing meshes and instances |
516 # tests instanced triangles and quads, mixing meshes and instances | 516 test_02_triangle_quad_instanced(nFrames, swapchain) |
517 test_02_triangle_quad_instanced(nFrames, swapchain) | 517 |
518 | 518 # teste descriptor sets |
519 # teste descriptor sets | 519 test_03_simple_descriptorset(nFrames, swapchain) |
520 test_03_simple_descriptorset(nFrames, swapchain) | 520 |
521 | 521 # tests multiple descriptor sets and arrays |
522 # tests multiple descriptor sets and arrays | 522 test_04_multiple_descriptorsets(nFrames, swapchain) |
523 test_04_multiple_descriptorsets(nFrames, swapchain) | 523 |
524 | 524 checkVkResult vkDeviceWaitIdle(vulkan.device) |
525 checkVkResult vkDeviceWaitIdle(vulkan.device) | 525 vkDestroyRenderPass(vulkan.device, renderpass.vk, nil) |
526 vkDestroyRenderPass(vulkan.device, renderpass.vk, nil) | 526 DestroySwapchain(swapchain) |
527 DestroySwapchain(swapchain) | |
528 | 527 |
529 # test multiple render passes | 528 # test multiple render passes |
530 block: | 529 for i, (depthBuffer, samples) in renderPasses: |
531 test_05_triangle_2pass(nFrames) | 530 test_05_triangle_2pass(nFrames, depthBuffer, samples) |
532 | 531 |
533 DestroyVulkan() | 532 DestroyVulkan() |