# HG changeset patch # User sam # Date 1724483421 -25200 # Node ID 164276e8697fd70bf597a9801568b5b1cd60bef1 # Parent 5ca89802a7465a6cedeb9f0f11f822b5f55645f4 did: small fix with image arrays diff -r 5ca89802a746 -r 164276e8697f semicongine/core/vector.nim --- a/semicongine/core/vector.nim Sat Aug 24 12:33:46 2024 +0700 +++ b/semicongine/core/vector.nim Sat Aug 24 14:10:21 2024 +0700 @@ -137,6 +137,7 @@ G* = vec4(1, 0, 0, 1) B* = vec4(1, 0, 0, 1) + O* = vec3(0, 0, 0) X* = vec3(1, 0, 0) Y* = vec3(0, 1, 0) Z* = vec3(0, 0, 1) @@ -145,6 +146,7 @@ YZ* = vec3(0, 1, 1) XYZ* = vec3(1, 1, 1) + Oi* = vec3i(0, 0, 0) Xi* = vec3i(1, 0, 0) Yi* = vec3i(0, 1, 0) Zi* = vec3i(0, 0, 1) @@ -153,6 +155,7 @@ YZi* = vec3i(0, 1, 1) XYZi* = vec3i(1, 1, 1) + Oi8* = vec3i8(0, 0, 0) Xi8* = vec3i8(1, 0, 0) Yi8* = vec3i8(0, 1, 0) Zi8* = vec3i8(0, 0, 1) diff -r 5ca89802a746 -r 164276e8697f semicongine/rendering/renderer.nim --- a/semicongine/rendering/renderer.nim Sat Aug 24 12:33:46 2024 +0700 +++ b/semicongine/rendering/renderer.nim Sat Aug 24 14:10:21 2024 +0700 @@ -554,7 +554,7 @@ renderData.memory[memoryType][selectedBlockI].offsetNextFree += memoryRequirements.size # imageview can only be created after memory is bound - image.imageview = svkCreate2DImageView(image.vk, format, nLayers = image.nLayers) + image.imageview = svkCreate2DImageView(image.vk, format, nLayers = image.nLayers, isArray = typeof(image) is ImageArray) renderData.imageViews.add image.imageview # data transfer and layout transition diff -r 5ca89802a746 -r 164276e8697f semicongine/rendering/vulkan_wrappers.nim --- a/semicongine/rendering/vulkan_wrappers.nim Sat Aug 24 12:33:46 2024 +0700 +++ b/semicongine/rendering/vulkan_wrappers.nim Sat Aug 24 14:10:21 2024 +0700 @@ -143,11 +143,12 @@ format: VkFormat, aspect = VK_IMAGE_ASPECT_COLOR_BIT, nLayers = 1'u32, + isArray = false ): VkImageView = var createInfo = VkImageViewCreateInfo( sType: VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, image: image, - viewType: if nLayers == 1: VK_IMAGE_VIEW_TYPE_2D else: VK_IMAGE_VIEW_TYPE_2D_ARRAY, + viewType: if isArray: VK_IMAGE_VIEW_TYPE_2D_ARRAY else: VK_IMAGE_VIEW_TYPE_2D, format: format, components: VkComponentMapping( r: VK_COMPONENT_SWIZZLE_IDENTITY,