diff semiconginev2/rendering/renderer.nim @ 1255:2b5ca798f6d6

did: make example town loadable and renderable, yay!
author sam <sam@basx.dev>
date Sun, 28 Jul 2024 00:17:34 +0700
parents b0f4c8ccd49a
children
line wrap: on
line diff
--- a/semiconginev2/rendering/renderer.nim	Sat Jul 27 20:47:54 2024 +0700
+++ b/semiconginev2/rendering/renderer.nim	Sun Jul 28 00:17:34 2024 +0700
@@ -607,10 +607,10 @@
 
 proc assertCanRenderMesh(TShader, TMesh, TInstance: typedesc) =
   for attrName, attrValue in default(TShader).fieldPairs:
-    if hasCustomPragma(attrValue, VertexAttribute):
+    when hasCustomPragma(attrValue, VertexAttribute):
       var foundAttr = false
       for meshAttrName, meshAttrValue in default(TMesh).fieldPairs:
-        if attrName == meshAttrName:
+        when attrName == meshAttrName:
           assert typeof(meshAttrValue) is GPUArray, "Mesh attribute '" & attrName & "' must be a GPUArray"
           assert typeof(attrValue) is elementType(meshAttrValue.data), "Type of shader attribute and mesh attribute '" & attrName & "' is not the same"
           foundAttr = true