diff semiconginev2/rendering/renderer.nim @ 1240:42eeb59f3a43

add: more tests, line and point rendering
author sam <sam@basx.dev>
date Mon, 22 Jul 2024 12:42:35 +0700
parents 69489a678141
children c15770761865
line wrap: on
line diff
--- a/semiconginev2/rendering/renderer.nim	Mon Jul 22 00:46:10 2024 +0700
+++ b/semiconginev2/rendering/renderer.nim	Mon Jul 22 12:42:35 2024 +0700
@@ -304,7 +304,6 @@
   renderdata: var RenderData,
   bufferType: BufferType,
   size: uint64,
-  needsFrameInFlight = -1
 ): (Buffer, uint64) =
 
   # find buffer that has space
@@ -312,9 +311,8 @@
 
   for i in 0 ..< renderData.buffers[bufferType].len:
     let buffer = renderData.buffers[bufferType][i]
-    if needsFrameInFlight == -1 or buffer.useForFrameInFlight == needsFrameInFlight:
-      if buffer.size - alignedTo(buffer.offsetNextFree, BUFFER_ALIGNMENT) >= size:
-        selectedBufferI = i
+    if buffer.size - alignedTo(buffer.offsetNextFree, BUFFER_ALIGNMENT) >= size:
+      selectedBufferI = i
 
   # otherwise create new buffer
   if selectedBufferI < 0:
@@ -323,8 +321,6 @@
       size = max(size, BUFFER_ALLOCATION_SIZE),
       bufferType = bufferType,
     )
-    if needsFrameInFlight >= 0:
-      renderdata.buffers[bufferType][selectedBufferI].useForFrameInFlight = needsFrameInFlight
 
   # assigne value
   let selectedBuffer = renderdata.buffers[bufferType][selectedBufferI]