# HG changeset patch # User sam # Date 1723882141 -25200 # Node ID a53a31b6e027194b796d002eaf05804599ea5da4 # Parent 373a4888f6acd7fe645c94fb772cd511a1732f90 did: make renderdata referencable diff -r 373a4888f6ac -r a53a31b6e027 semicongine/rendering.nim --- a/semicongine/rendering.nim Sat Aug 17 13:54:22 2024 +0700 +++ b/semicongine/rendering.nim Sat Aug 17 15:09:01 2024 +0700 @@ -140,19 +140,20 @@ offset: uint64 GPUData* = GPUArray | GPUValue - RenderData* = object + RenderDataObject = object descriptorPool: VkDescriptorPool memory: array[VK_MAX_MEMORY_TYPES.int, seq[MemoryBlock]] buffers: array[BufferType, seq[Buffer]] images: seq[VkImage] imageViews: seq[VkImageView] samplers: seq[VkSampler] + RenderData* = ref RenderDataObject var vulkan* = VulkanGlobals() var fullscreen_internal: bool proc `=copy`(dest: var VulkanGlobals; source: VulkanGlobals) {.error.} -proc `=copy`(dest: var RenderData; source: RenderData) {.error.} +proc `=copy`(dest: var RenderDataObject; source: RenderDataObject) {.error.} proc `=copy`[T, S](dest: var GPUValue[T, S]; source: GPUValue[T, S]) {.error.} proc `=copy`[T, S](dest: var GPUArray[T, S]; source: GPUArray[T, S]) {.error.} proc `=copy`(dest: var MemoryBlock; source: MemoryBlock) {.error.} diff -r 373a4888f6ac -r a53a31b6e027 semicongine/rendering/renderer.nim --- a/semicongine/rendering/renderer.nim Sat Aug 17 13:54:22 2024 +0700 +++ b/semicongine/rendering/renderer.nim Sat Aug 17 15:09:01 2024 +0700 @@ -357,6 +357,7 @@ assignBuffers(renderdata, descriptorSet.data, uploadData = uploadData) proc initRenderData*(descriptorPoolLimit = 1024'u32): RenderData = + result = RenderData() # allocate descriptor pools var poolSizes = [ VkDescriptorPoolSize(thetype: VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, descriptorCount: descriptorPoolLimit),