Mercurial > games > semicongine
comparison semiconginev2/rendering/renderer.nim @ 1247:c15770761865
add: gltf loading test, gltf loading for materials
author | sam <sam@basx.dev> |
---|---|
date | Wed, 24 Jul 2024 23:26:34 +0700 |
parents | 42eeb59f3a43 |
children | 01e9f41d35b1 |
comparison
equal
deleted
inserted
replaced
1246:356089365076 | 1247:c15770761865 |
---|---|
468 usage.add VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | 468 usage.add VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
469 let format = GetVkFormat(grayscale = elementType(image.data) is Gray, usage = usage) | 469 let format = GetVkFormat(grayscale = elementType(image.data) is Gray, usage = usage) |
470 | 470 |
471 image.vk = svkCreate2DImage(image.width, image.height, format, usage, image.samples) | 471 image.vk = svkCreate2DImage(image.width, image.height, format, usage, image.samples) |
472 renderData.images.add image.vk | 472 renderData.images.add image.vk |
473 image.sampler = createSampler(magFilter = image.interpolation, minFilter = image.interpolation) | 473 image.sampler = createSampler( |
474 magFilter = image.magInterpolation, | |
475 minFilter = image.minInterpolation, | |
476 addressModeU = image.wrapU, | |
477 addressModeV = image.wrapV, | |
478 ) | |
474 renderData.samplers.add image.sampler | 479 renderData.samplers.add image.sampler |
475 | 480 |
476 let memoryRequirements = image.vk.svkGetImageMemoryRequirements() | 481 let memoryRequirements = image.vk.svkGetImageMemoryRequirements() |
477 let memoryType = BestMemory(mappable = false, filter = memoryRequirements.memoryTypes) | 482 let memoryType = BestMemory(mappable = false, filter = memoryRequirements.memoryTypes) |
478 # check if there is an existing allocated memory block that is large enough to be used | 483 # check if there is an existing allocated memory block that is large enough to be used |