Mercurial > games > semicongine
diff semiconginev2/rendering/renderer.nim @ 1236:176383220123
add: first font-rendering test
author | sam <sam@basx.dev> |
---|---|
date | Sat, 20 Jul 2024 17:45:44 +0700 |
parents | 841e12f33c47 |
children | 69489a678141 |
line wrap: on
line diff
--- a/semiconginev2/rendering/renderer.nim Sat Jul 20 15:45:02 2024 +0700 +++ b/semiconginev2/rendering/renderer.nim Sat Jul 20 17:45:44 2024 +0700 @@ -290,14 +290,14 @@ WithStagingBuffer((gpuData.buffer.vk, gpuData.offset), gpuData.size, stagingPtr): copyMem(stagingPtr, gpuData.rawPointer, gpuData.size) -proc UpdateAllGPUBuffers*[T](value: T) = +proc UpdateAllGPUBuffers*[T](value: T, flush = false) = for name, fieldvalue in value.fieldPairs(): when typeof(fieldvalue) is GPUData: - UpdateGPUBuffer(fieldvalue) + UpdateGPUBuffer(fieldvalue, flush = flush) when typeof(fieldvalue) is array: when elementType(fieldvalue) is GPUData: for entry in fieldvalue: - UpdateGPUBuffer(entry) + UpdateGPUBuffer(entry, flush = flush) proc AssignGPUData(renderdata: var RenderData, value: var GPUData) = # find buffer that has space