diff semiconginev2/rendering/renderer.nim @ 1234:841e12f33c47

add: text & font rendering, not tested yet
author sam <sam@basx.dev>
date Sat, 20 Jul 2024 00:03:57 +0700
parents 70f6c1cfe005
children 176383220123
line wrap: on
line diff
--- a/semiconginev2/rendering/renderer.nim	Fri Jul 19 21:25:42 2024 +0700
+++ b/semiconginev2/rendering/renderer.nim	Sat Jul 20 00:03:57 2024 +0700
@@ -331,6 +331,10 @@
 
     when typeof(value) is GPUData:
       AssignGPUData(renderdata, value)
+
+    elif typeof(value) is DescriptorSet:
+      AssignBuffers(renderdata, value.data, uploadData = uploadData)
+
     elif typeof(value) is array:
       when elementType(value) is GPUValue:
         for v in value.mitems:
@@ -455,7 +459,7 @@
   var usage = @[VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_USAGE_SAMPLED_BIT]
   if image.isRenderTarget:
     usage.add VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
-  let format = GetVkFormat(elementType(image.data) is TVec1[uint8], usage = usage)
+  let format = GetVkFormat(grayscale = elementType(image.data) is Gray, usage = usage)
 
   image.vk = svkCreate2DImage(image.width, image.height, format, usage, image.samples)
   renderData.images.add image.vk