diff tests/test_text.nim @ 1335:f2ff6f624932

fix: image copies of font atlas
author sam <sam@basx.dev>
date Thu, 22 Aug 2024 22:31:05 +0700
parents df3c075e5dea
children
line wrap: on
line diff
--- a/tests/test_text.nim	Thu Aug 22 22:18:33 2024 +0700
+++ b/tests/test_text.nim	Thu Aug 22 22:31:05 2024 +0700
@@ -18,7 +18,7 @@
   var pipeline =
     createPipeline[DefaultFontShader[FontDS]](renderPass = vulkan.swapchain.renderPass)
 
-  var ds = asDescriptorSetData(FontDS(fontAtlas: font.fontAtlas))
+  var ds = asDescriptorSetData(FontDS(fontAtlas: font.fontAtlas.copy()))
   uploadImages(renderdata, ds)
   initDescriptorSet(renderdata, pipeline.layout(0), ds)
 
@@ -55,15 +55,15 @@
   var pipeline =
     createPipeline[DefaultFontShader[FontDS]](renderPass = vulkan.swapchain.renderPass)
 
-  var ds1 = asDescriptorSetData(FontDS(fontAtlas: font1.fontAtlas))
+  var ds1 = asDescriptorSetData(FontDS(fontAtlas: font1.fontAtlas.copy()))
   uploadImages(renderdata, ds1)
   initDescriptorSet(renderdata, pipeline.layout(0), ds1)
 
-  var ds2 = asDescriptorSetData(FontDS(fontAtlas: font2.fontAtlas))
+  var ds2 = asDescriptorSetData(FontDS(fontAtlas: font2.fontAtlas.copy()))
   uploadImages(renderdata, ds2)
   initDescriptorSet(renderdata, pipeline.layout(0), ds2)
 
-  var ds3 = asDescriptorSetData(FontDS(fontAtlas: font3.fontAtlas))
+  var ds3 = asDescriptorSetData(FontDS(fontAtlas: font3.fontAtlas.copy()))
   uploadImages(renderdata, ds3)
   initDescriptorSet(renderdata, pipeline.layout(0), ds3)
 
@@ -128,7 +128,7 @@
   var pipeline =
     createPipeline[DefaultFontShader[FontDS]](renderPass = vulkan.swapchain.renderPass)
 
-  var ds = asDescriptorSetData(FontDS(fontAtlas: font.fontAtlas))
+  var ds = asDescriptorSetData(FontDS(fontAtlas: font.fontAtlas.copy()))
   uploadImages(renderdata, ds)
   initDescriptorSet(renderdata, pipeline.layout(0), ds)
 
@@ -201,7 +201,7 @@
   var pipeline =
     createPipeline[DefaultFontShader[FontDS]](renderPass = vulkan.swapchain.renderPass)
 
-  var ds = asDescriptorSetData(FontDS(fontAtlas: font.fontAtlas))
+  var ds = asDescriptorSetData(FontDS(fontAtlas: font.fontAtlas.copy()))
   uploadImages(renderdata, ds)
   initDescriptorSet(renderdata, pipeline.layout(0), ds)