diff src/zamikongine/engine.nim @ 24:71bbe11d8de8

did: change shader compilation to run during program compilation, maybe add dynamic version later
author Sam <sam@basx.dev>
date Wed, 11 Jan 2023 11:15:02 +0700
parents b45a5d338cd0
children b1b05d4efb52
line wrap: on
line diff
--- a/src/zamikongine/engine.nim	Wed Jan 11 00:43:43 2023 +0700
+++ b/src/zamikongine/engine.nim	Wed Jan 11 11:15:02 2023 +0700
@@ -1,4 +1,3 @@
-import std/sequtils
 import std/typetraits
 import std/strformat
 import std/enumerate
@@ -247,7 +246,7 @@
     )
   checkVkResult device.vkCreateRenderPass(addr(renderPassCreateInfo), nil, addr(result))
 
-proc setupRenderPipeline[T](device: VkDevice, frameDimension: VkExtent2D, renderPass: VkRenderPass, vertexShader, fragmentShader: string): RenderPipeline =
+proc setupRenderPipeline[T](device: VkDevice, frameDimension: VkExtent2D, renderPass: VkRenderPass, vertexShader, fragmentShader: static string): RenderPipeline =
   # load shaders
   result.shaders.add(device.initShaderProgram(VK_SHADER_STAGE_VERTEX_BIT, vertexShader))
   result.shaders.add(device.initShaderProgram(VK_SHADER_STAGE_FRAGMENT_BIT, fragmentShader))
@@ -489,7 +488,7 @@
   ) = result.vulkan.device.device.setupSyncPrimitives()
 
 
-proc setupPipeline*[T: object, U: uint16|uint32](engine: var Engine, scenedata: ref Thing, vertexShader, fragmentShader: string) =
+proc setupPipeline*[T: object, U: uint16|uint32](engine: var Engine, scenedata: ref Thing, vertexShader, fragmentShader: static string) =
   engine.currentscenedata = scenedata
   engine.vulkan.pipeline = setupRenderPipeline[T](
     engine.vulkan.device.device,