# HG changeset patch # User Sam # Date 1696431743 -25200 # Node ID a6bcee717532af405a59b74d8f4c61704cac77f9 # Parent eef6cc3e110420163e7dd18a8a43ebebeaada823 add: mesh name to drawable diff -r eef6cc3e1104 -r a6bcee717532 src/semicongine/renderer.nim --- a/src/semicongine/renderer.nim Mon Oct 02 10:15:09 2023 +0700 +++ b/src/semicongine/renderer.nim Wed Oct 04 22:02:23 2023 +0700 @@ -261,6 +261,7 @@ # create drawables let indexed = mesh.indexType != MeshIndexType.None var drawable = Drawable( + name: mesh.name, elementCount: if indexed: mesh[].indicesCount else: mesh[].vertexCount, bufferOffsets: offsets, instanceCount: mesh[].instanceCount, diff -r eef6cc3e1104 -r a6bcee717532 src/semicongine/vulkan/drawable.nim --- a/src/semicongine/vulkan/drawable.nim Mon Oct 02 10:15:09 2023 +0700 +++ b/src/semicongine/vulkan/drawable.nim Wed Oct 04 22:02:23 2023 +0700 @@ -7,6 +7,7 @@ type Drawable* = object + name*: string elementCount*: int # number of vertices or indices bufferOffsets*: Table[VkPipeline, seq[(string, MemoryPerformanceHint, int)]] # list of buffers and list of offset for each attribute in that buffer instanceCount*: int # number of instance @@ -19,9 +20,9 @@ func `$`*(drawable: Drawable): string = if drawable.indexed: - &"Drawable(elementCount: {drawable.elementCount}, instanceCount: {drawable.instanceCount}, bufferOffsets: {drawable.bufferOffsets}, indexType: {drawable.indexType}, indexBufferOffset: {drawable.indexBufferOffset})" + &"Drawable({drawable.name}, elementCount: {drawable.elementCount}, instanceCount: {drawable.instanceCount}, bufferOffsets: {drawable.bufferOffsets}, indexType: {drawable.indexType}, indexBufferOffset: {drawable.indexBufferOffset})" else: - &"Drawable(elementCount: {drawable.elementCount}, instanceCount: {drawable.instanceCount}, bufferOffsets: {drawable.bufferOffsets})" + &"Drawable({drawable.name}, elementCount: {drawable.elementCount}, instanceCount: {drawable.instanceCount}, bufferOffsets: {drawable.bufferOffsets})" proc draw*(drawable: Drawable, commandBuffer: VkCommandBuffer, vertexBuffers: Table[MemoryPerformanceHint, Buffer], indexBuffer: Buffer, pipeline: VkPipeline) = debug "Draw ", drawable