Mercurial > games > semicongine
changeset 441:afdd5ca14abf
did: auto-formatting
line wrap: on
line diff
--- a/semicongine/animation.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/animation.nim Sat Feb 17 16:37:24 2024 +0700 @@ -24,7 +24,7 @@ Alternate Keyframe[T] = object timestamp: AnimationTime - value : T + value: T easeIn: Ease easeOut: Ease Animation*[T] = object @@ -46,7 +46,7 @@ func easePow3(x: float32): float32 = x * x * x func easePow4(x: float32): float32 = x * x * x * x func easePow5(x: float32): float32 = x * x * x * x * x -func easeExpo(x: float32): float32 = ( if x == 0: 0'f32 else: pow(2'f32, 10'f32 * x - 10'f32) ) +func easeExpo(x: float32): float32 = (if x == 0: 0'f32 else: pow(2'f32, 10'f32 * x - 10'f32)) func easeSine(x: float32): float32 = 1'f32 - cos((x * PI) / 2'f32) func easeCirc(x: float32): float32 = 1'f32 - sqrt(1'f32 - pow(x, 2'f32)) @@ -81,10 +81,10 @@ else: return combine(EASEFUNC_MAP[keyframe.easeIn], makeEaseOut(EASEFUNC_MAP[keyframe.easeOut]))(t) -func keyframe*[T](timestamp: AnimationTime, value: T, easeIn=Linear, easeOut=None): Keyframe[T] = +func keyframe*[T](timestamp: AnimationTime, value: T, easeIn = Linear, easeOut = None): Keyframe[T] = Keyframe[T](timestamp: timestamp, value: value, easeIn: easeIn, easeOut: easeOut) -func newAnimation*[T](keyframes: openArray[Keyframe[T]], duration: float32, direction=Forward, iterations=1): Animation[T] = +func newAnimation*[T](keyframes: openArray[Keyframe[T]], duration: float32, direction = Forward, iterations = 1): Animation[T] = assert keyframes.len >= 2, "An animation needs at least 2 keyframes" assert keyframes[0].timestamp == 0, "An animation's first keyframe needs to have timestamp=0" assert keyframes[^1].timestamp == 1, "An animation's last keyframe needs to have timestamp=1" @@ -117,7 +117,7 @@ iterations: iterations ) -func newAnimation*[T](fun: (t: AnimationTime) -> T, duration: float32, direction=Forward, iterations=1): Animation[T] = +func newAnimation*[T](fun: (t: AnimationTime) -> T, duration: float32, direction = Forward, iterations = 1): Animation[T] = Animation[T]( animationFunction: fun, duration: duration, @@ -128,7 +128,7 @@ proc reset*(player: var AnimationPlayer) = player.currentValue = player.animation.animationFunction(0) player.currentTime = 0 - player.currentDirection = if player.animation.direction == Backward: -1 else : 1 + player.currentDirection = if player.animation.direction == Backward: -1 else: 1 player.currentIteration = player.animation.iterations
--- a/semicongine/audio.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/audio.nim Sat Feb 17 16:37:24 2024 +0700 @@ -65,12 +65,12 @@ assert (name in mixer.sounds) mixer.sounds[name] = sound -proc addTrack*(mixer: var Mixer, name: string, level: Level=1'f) = +proc addTrack*(mixer: var Mixer, name: string, level: Level = 1'f) = assert not (name in mixer.tracks) mixer.lock.withLock(): mixer.tracks[name] = Track(level: level) -proc play*(mixer: var Mixer, soundName: string, track="", stopOtherSounds=false, loop=false, levelLeft, levelRight: Level): uint64 = +proc play*(mixer: var Mixer, soundName: string, track = "", stopOtherSounds = false, loop = false, levelLeft, levelRight: Level): uint64 = assert track in mixer.tracks assert soundName in mixer.sounds, soundName & " not loaded" mixer.lock.withLock(): @@ -87,15 +87,15 @@ result = mixer.playbackCounter inc mixer.playbackCounter -proc play*(mixer: var Mixer, soundName: string, track="", stopOtherSounds=false, loop=false, level: Level=1'f): uint64 = +proc play*(mixer: var Mixer, soundName: string, track = "", stopOtherSounds = false, loop = false, level: Level = 1'f): uint64 = play( - mixer=mixer, - soundName=soundName, - track=track, - stopOtherSounds=stopOtherSounds, - loop=loop, - levelLeft=level, - levelRight=level + mixer = mixer, + soundName = soundName, + track = track, + stopOtherSounds = stopOtherSounds, + loop = loop, + levelLeft = level, + levelRight = level ) proc stop*(mixer: var Mixer) = @@ -105,7 +105,7 @@ proc getLevel*(mixer: var Mixer): Level = mixer.level proc getLevel*(mixer: var Mixer, track: string): Level = mixer.tracks[track].level -proc getLevel*(mixer: var Mixer, playbackId : uint64): (Level, Level) = +proc getLevel*(mixer: var Mixer, playbackId: uint64): (Level, Level) = for track in mixer.tracks.mvalues: if playbackId in track.playing: return (track.playing[playbackId].levelLeft, track.playing[playbackId].levelRight) @@ -120,7 +120,7 @@ if playbackId in track.playing: track.playing[playbackId].levelLeft = levelLeft track.playing[playbackId].levelRight = levelRight -proc setLevel*(mixer: var Mixer, playbackId : uint64, level: Level) = +proc setLevel*(mixer: var Mixer, playbackId: uint64, level: Level) = setLevel(mixer, playbackId, level, level) proc stop*(mixer: var Mixer, track: string) =
--- a/semicongine/collision.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/collision.nim Sat Feb 17 16:37:24 2024 +0700 @@ -91,7 +91,7 @@ a = simplex[0] b = simplex[1] ab = b - a - ao = - a + ao = - a if sameDirection(ab, ao): direction = cross(cross(ab, ao), ab) @@ -101,16 +101,16 @@ return false -func triangle(simplex: var seq[Vec3f], direction: var Vec3f, twoDimensional=false): bool = +func triangle(simplex: var seq[Vec3f], direction: var Vec3f, twoDimensional = false): bool = let a = simplex[0] b = simplex[1] c = simplex[2] ab = b - a ac = c - a - ao = - a + ao = - a abc = ab.cross(ac) - + if sameDirection(abc.cross(ac), ao): if sameDirection(ac, ao): simplex = @[a, c] @@ -128,7 +128,7 @@ if (sameDirection(abc, ao)): direction = abc else: - simplex = @[ a, c, b] + simplex = @[a, c, b] direction = -abc return false @@ -142,11 +142,11 @@ ab = b - a ac = c - a ad = d - a - ao = - a + ao = - a abc = ab.cross(ac) acd = ac.cross(ad) adb = ad.cross(ab) - + if sameDirection(abc, ao): simplex = @[a, b, c] return triangle(simplex, direction) @@ -156,7 +156,7 @@ if sameDirection(adb, ao): simplex = @[a, d, b] return triangle(simplex, direction) - + return true func getFaceNormals(polytope: seq[Vec3f], faces: seq[int]): (seq[Vec4f], int) = @@ -193,7 +193,7 @@ else: edges.add (faces[a], faces[b]) -func nextSimplex(simplex: var seq[Vec3f], direction: var Vec3f, twoDimensional=false): bool = +func nextSimplex(simplex: var seq[Vec3f], direction: var Vec3f, twoDimensional = false): bool = case simplex.len of 2: simplex.line(direction) of 3: simplex.triangle(direction, twoDimensional) @@ -220,7 +220,7 @@ var support = supportPoint(a, b, minNormal) sDistance = minNormal.dot(support) - + if abs(sDistance - minDistance) > 0.001'f32: minDistance = high(float32) var uniqueEdges: seq[(int, int)] @@ -247,7 +247,7 @@ newFaces.add edgeIndex1 newFaces.add edgeIndex2 newFaces.add polytope.len - + polytope.add support var (newNormals, newMinFace) = getFaceNormals(polytope, newFaces) @@ -311,7 +311,7 @@ result = (normal: newVec3f(minNormal.x, minNormal.y), penetrationDepth: minDistance + 0.001'f32) -func intersects*(a, b: Collider, as2D=false): bool = +func intersects*(a, b: Collider, as2D = false): bool = var support = supportPoint(a, b, newVec3f(0.8153, -0.4239, if as2D: 0.0 else: 0.5786)) # just random initial vector simplex = newSeq[Vec3f]() @@ -321,16 +321,16 @@ while n < MAX_COLLISON_DETECTION_ITERATIONS: support = supportPoint(a, b, direction) if support.dot(direction) <= 0: - return false + return false simplex.insert(support, 0) - if nextSimplex(simplex, direction, twoDimensional=as2D): + if nextSimplex(simplex, direction, twoDimensional = as2D): return true # prevent numeric instability if direction == newVec3f(0, 0, 0): direction[0] = 0.0001 inc n -func collision*(a, b: Collider, as2D=false): tuple[hasCollision: bool, normal: Vec3f, penetrationDepth: float32] = +func collision*(a, b: Collider, as2D = false): tuple[hasCollision: bool, normal: Vec3f, penetrationDepth: float32] = var support = supportPoint(a, b, newVec3f(0.8153, -0.4239, if as2D: 0.0 else: 0.5786)) # just random initial vector simplex = newSeq[Vec3f]() @@ -340,9 +340,9 @@ while n < MAX_COLLISON_DETECTION_ITERATIONS: support = supportPoint(a, b, direction) if support.dot(direction) <= 0: - return result + return result simplex.insert(support, 0) - if nextSimplex(simplex, direction, twoDimensional=as2D): + if nextSimplex(simplex, direction, twoDimensional = as2D): let (normal, depth) = if as2D: collisionPoint2D(simplex, a, b) else: collisionPoint3D(simplex, a, b) return (true, normal, depth) # prevent numeric instability
--- a/semicongine/core/dynamic_arrays.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/core/dynamic_arrays.nim Sat Feb 17 16:37:24 2024 +0700 @@ -252,7 +252,7 @@ elif T is TMat4[float32]: value.mat4f32[] = data elif T is TMat4[float64]: value.mat4f64[] = data elif T is Texture: value.texture[] = data - else: {. error: "Virtual datatype has no values" .} + else: {.error: "Virtual datatype has no values".} proc setValue[T: GPUType|int|uint|float](value: var DataList, i: int, data: T) = assert i < value.len @@ -305,9 +305,9 @@ elif T is TMat4[float32]: value.mat4f32[i] = data elif T is TMat4[float64]: value.mat4f64[i] = data elif T is Texture: value.texture[i] = data - else: {. error: "Virtual datatype has no values" .} + else: {.error: "Virtual datatype has no values".} -proc initDataList*(theType: DataType, len=0): DataList = +proc initDataList*(theType: DataType, len = 0): DataList = result = DataList(theType: theType) case result.theType of Float32: result.float32 = new seq[float32] @@ -355,7 +355,7 @@ of TextureType: result.texture = new seq[Texture] result.setLen(len) -proc initDataList*[T: GPUType](len=1): DataList = +proc initDataList*[T: GPUType](len = 1): DataList = result = initDataList(getDataType[T]()) result.setLen(len) @@ -413,7 +413,7 @@ elif T is TMat4[float32]: value.mat4f32 elif T is TMat4[float64]: value.mat4f64 elif T is Texture: value.texture - else: {. error: "Virtual datatype has no values" .} + else: {.error: "Virtual datatype has no values".} func getValue[T: GPUType|int|uint|float](value: DataList, i: int): T = when T is float32: value.float32[i] @@ -465,7 +465,7 @@ elif T is TMat4[float32]: value.mat4f32[i] elif T is TMat4[float64]: value.mat4f64[i] elif T is Texture: value.texture[i] - else: {. error: "Virtual datatype has no values" .} + else: {.error: "Virtual datatype has no values".} template `[]`*(list: DataList, t: typedesc): ref seq[t] = getValues[t](list) @@ -583,7 +583,7 @@ elif T is TMat4[float32]: value.mat4f32[].add data elif T is TMat4[float64]: value.mat4f64[].add data elif T is Texture: value.texture[].add data - else: {. error: "Virtual datatype has no values" .} + else: {.error: "Virtual datatype has no values".} proc appendValues*(value: var DataList, data: DataList) = assert value.theType == data.theType, &"Expected datalist of type {value.theType} but got {data.theType}" @@ -634,7 +634,7 @@ of TextureType: value.texture[].add data.texture[] proc appendFrom*(a: var DataList, i: int, b: DataList, j: int) = - assert a.theType == b.theType + assert a.theType == b.theType case a.theType of Float32: a.float32[i] = b.float32[j] of Float64: a.float64[i] = b.float64[j]
--- a/semicongine/core/gpu_types.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/core/gpu_types.nim Sat Feb 17 16:37:24 2024 +0700 @@ -125,7 +125,7 @@ of Mat4F64: 128 of TextureType: 0 -func size*(attribute: ShaderAttribute, perDescriptor=false): int = +func size*(attribute: ShaderAttribute, perDescriptor = false): int = if perDescriptor: attribute.theType.size div attribute.theType.numberOfVertexInputAttributeDescriptors else: @@ -190,14 +190,14 @@ elif T is Texture: TextureType else: static: - raise newException(Exception, &"Unsupported data type for GPU data: {name(T)}" ) + raise newException(Exception, &"Unsupported data type for GPU data: {name(T)}") func attr*[T: GPUType]( name: string, - perInstance=false, - arrayCount=0, - noInterpolation=false, - memoryPerformanceHint=PreferFastRead, + perInstance = false, + arrayCount = 0, + noInterpolation = false, + memoryPerformanceHint = PreferFastRead, ): auto = ShaderAttribute( name: name, @@ -312,8 +312,8 @@ of TextureType: 1 func glslType*(theType: DataType): string = - # todo: likely not correct as we would need to enable some - # extensions somewhere (Vulkan/GLSL compiler?) to have + # todo: likely not correct as we would need to enable some + # extensions somewhere (Vulkan/GLSL compiler?) to have # everything work as intended. Or maybe the GPU driver does # some automagic conversion stuf.. case theType: @@ -366,7 +366,7 @@ for j in 0 ..< attribute.theType.numberOfVertexInputAttributeDescriptors: i += attribute.theType.nLocationSlots -func glslUniforms*(group: openArray[ShaderAttribute], blockName="Uniforms", binding: int): seq[string] = +func glslUniforms*(group: openArray[ShaderAttribute], blockName = "Uniforms", binding: int): seq[string] = if group.len == 0: return @[] # currently only a single uniform block supported, therefore binding = 0
--- a/semicongine/core/vector.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/core/vector.nim Sat Feb 17 16:37:24 2024 +0700 @@ -43,23 +43,23 @@ func ConstG[T: SomeNumber](): auto {.compiletime.} = TVec3[T]([T(0), T(1), T(0)]) func ConstB[T: SomeNumber](): auto {.compiletime.} = TVec3[T]([T(0), T(0), T(1)]) -func newVec2f*(x=0'f32, y=0'f32): auto = +func newVec2f*(x = 0'f32, y = 0'f32): auto = Vec2f([x, y]) -func newVec3f*(x=0'f32, y=0'f32, z=0'f32): auto = +func newVec3f*(x = 0'f32, y = 0'f32, z = 0'f32): auto = Vec3f([x, y, z]) -func newVec4f*(x=0'f32, y=0'f32, z=0'f32, a=0'f32): auto = +func newVec4f*(x = 0'f32, y = 0'f32, z = 0'f32, a = 0'f32): auto = Vec4f([x, y, z, a]) -func newVec2i*(x=0'i32, y=0'i32): auto = +func newVec2i*(x = 0'i32, y = 0'i32): auto = Vec2i([x, y]) -func newVec3i*(x=0'i32, y=0'i32, z=0'i32): auto = +func newVec3i*(x = 0'i32, y = 0'i32, z = 0'i32): auto = Vec3i([x, y, z]) -func newVec4i*(x=0'i32, y=0'i32, z=0'i32, a=0'i32): auto = +func newVec4i*(x = 0'i32, y = 0'i32, z = 0'i32, a = 0'i32): auto = Vec4i([x, y, z, a]) -func newVec2u*(x=0'u32, y=0'u32): auto = +func newVec2u*(x = 0'u32, y = 0'u32): auto = Vec2u([x, y]) -func newVec3u*(x=0'u32, y=0'u32, z=0'u32): auto = +func newVec3u*(x = 0'u32, y = 0'u32, z = 0'u32): auto = Vec3u([x, y, z]) -func newVec4u*(x=0'u32, y=0'u32, z=0'u32, a=0'u32): auto = +func newVec4u*(x = 0'u32, y = 0'u32, z = 0'u32, a = 0'u32): auto = Vec4u([x, y, z, a]) # generates constants: Xf, Xf32, Xf64, Xi, Xi8, Xi16, Xi32, Xi64 @@ -282,8 +282,8 @@ nnkGenericParams.newTree(nnkIdentDefs.newTree(newIdentNode("T"), newEmptyNode(), newEmptyNode())), nnkFormalParams.newTree( newEmptyNode(), - nnkIdentDefs.newTree( newIdentNode("vec"), nnkVarTy.newTree(newIdentNode("TVec")), newEmptyNode()), - nnkIdentDefs.newTree( newIdentNode("value"), newIdentNode("T"), newEmptyNode()) + nnkIdentDefs.newTree(newIdentNode("vec"), nnkVarTy.newTree(newIdentNode("TVec")), newEmptyNode()), + nnkIdentDefs.newTree(newIdentNode("value"), newIdentNode("T"), newEmptyNode()) ), newEmptyNode(), newEmptyNode(),
--- a/semicongine/core/vulkanapi.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/core/vulkanapi.nim Sat Feb 17 16:37:24 2024 +0700 @@ -633,12 +633,12 @@ VK_PIPELINE_CACHE_CREATE_RESERVED_1_BIT_EXT = 0b00000000000000000000000000000010 VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkPipelineCacheCreateFlagBits]): VkPipelineCacheCreateFlags = - for flag in flags: - result = VkPipelineCacheCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineCacheCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineCacheCreateFlags): seq[VkPipelineCacheCreateFlagBits] = - for value in VkPipelineCacheCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineCacheCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineCacheCreateFlags): bool = cint(a) == cint(b) type VkPrimitiveTopology* {.size: sizeof(cint).} = enum @@ -2069,24 +2069,24 @@ VK_QUEUE_OPTICAL_FLOW_BIT_NV = 0b00000000000000000000000100000000 VK_QUEUE_RESERVED_9_BIT_EXT = 0b00000000000000000000001000000000 func toBits*(flags: openArray[VkQueueFlagBits]): VkQueueFlags = - for flag in flags: - result = VkQueueFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkQueueFlags(uint(result) or uint(flag)) func toEnums*(number: VkQueueFlags): seq[VkQueueFlagBits] = - for value in VkQueueFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkQueueFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkQueueFlags): bool = cint(a) == cint(b) type VkCullModeFlagBits* {.size: sizeof(cint).} = enum VK_CULL_MODE_FRONT_BIT = 0b00000000000000000000000000000001 VK_CULL_MODE_BACK_BIT = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkCullModeFlagBits]): VkCullModeFlags = - for flag in flags: - result = VkCullModeFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkCullModeFlags(uint(result) or uint(flag)) func toEnums*(number: VkCullModeFlags): seq[VkCullModeFlagBits] = - for value in VkCullModeFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkCullModeFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkCullModeFlags): bool = cint(a) == cint(b) const VK_CULL_MODE_NONE* = 0 @@ -2096,24 +2096,24 @@ VK_RENDER_PASS_CREATE_RESERVED_0_BIT_KHR = 0b00000000000000000000000000000001 VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkRenderPassCreateFlagBits]): VkRenderPassCreateFlags = - for flag in flags: - result = VkRenderPassCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkRenderPassCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkRenderPassCreateFlags): seq[VkRenderPassCreateFlagBits] = - for value in VkRenderPassCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkRenderPassCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkRenderPassCreateFlags): bool = cint(a) == cint(b) type VkDeviceQueueCreateFlagBits* {.size: sizeof(cint).} = enum VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0b00000000000000000000000000000001 VK_DEVICE_QUEUE_CREATE_RESERVED_1_BIT_QCOM = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkDeviceQueueCreateFlagBits]): VkDeviceQueueCreateFlags = - for flag in flags: - result = VkDeviceQueueCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkDeviceQueueCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkDeviceQueueCreateFlags): seq[VkDeviceQueueCreateFlagBits] = - for value in VkDeviceQueueCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDeviceQueueCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDeviceQueueCreateFlags): bool = cint(a) == cint(b) type VkMemoryPropertyFlagBits* {.size: sizeof(cint).} = enum @@ -2127,12 +2127,12 @@ VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD = 0b00000000000000000000000010000000 VK_MEMORY_PROPERTY_RDMA_CAPABLE_BIT_NV = 0b00000000000000000000000100000000 func toBits*(flags: openArray[VkMemoryPropertyFlagBits]): VkMemoryPropertyFlags = - for flag in flags: - result = VkMemoryPropertyFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkMemoryPropertyFlags(uint(result) or uint(flag)) func toEnums*(number: VkMemoryPropertyFlags): seq[VkMemoryPropertyFlagBits] = - for value in VkMemoryPropertyFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkMemoryPropertyFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkMemoryPropertyFlags): bool = cint(a) == cint(b) type VkMemoryHeapFlagBits* {.size: sizeof(cint).} = enum @@ -2140,12 +2140,12 @@ VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 0b00000000000000000000000000000010 VK_MEMORY_HEAP_SEU_SAFE_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkMemoryHeapFlagBits]): VkMemoryHeapFlags = - for flag in flags: - result = VkMemoryHeapFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkMemoryHeapFlags(uint(result) or uint(flag)) func toEnums*(number: VkMemoryHeapFlags): seq[VkMemoryHeapFlagBits] = - for value in VkMemoryHeapFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkMemoryHeapFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkMemoryHeapFlags): bool = cint(a) == cint(b) type VkAccessFlagBits* {.size: sizeof(cint).} = enum @@ -2178,12 +2178,12 @@ VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0b00000100000000000000000000000000 VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0b00001000000000000000000000000000 func toBits*(flags: openArray[VkAccessFlagBits]): VkAccessFlags = - for flag in flags: - result = VkAccessFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkAccessFlags(uint(result) or uint(flag)) func toEnums*(number: VkAccessFlags): seq[VkAccessFlagBits] = - for value in VkAccessFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkAccessFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkAccessFlags): bool = cint(a) == cint(b) type VkBufferUsageFlagBits* {.size: sizeof(cint).} = enum @@ -2215,12 +2215,12 @@ VK_BUFFER_USAGE_RESERVED_25_BIT_AMD = 0b00000010000000000000000000000000 VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0b00000100000000000000000000000000 func toBits*(flags: openArray[VkBufferUsageFlagBits]): VkBufferUsageFlags = - for flag in flags: - result = VkBufferUsageFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkBufferUsageFlags(uint(result) or uint(flag)) func toEnums*(number: VkBufferUsageFlags): seq[VkBufferUsageFlagBits] = - for value in VkBufferUsageFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkBufferUsageFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkBufferUsageFlags): bool = cint(a) == cint(b) type VkBufferCreateFlagBits* {.size: sizeof(cint).} = enum @@ -2231,12 +2231,12 @@ VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0b00000000000000000000000000010000 VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000100000 func toBits*(flags: openArray[VkBufferCreateFlagBits]): VkBufferCreateFlags = - for flag in flags: - result = VkBufferCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkBufferCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkBufferCreateFlags): seq[VkBufferCreateFlagBits] = - for value in VkBufferCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkBufferCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkBufferCreateFlags): bool = cint(a) == cint(b) type VkShaderStageFlagBits* {.size: sizeof(cint).} = enum @@ -2260,12 +2260,12 @@ VK_SHADER_STAGE_EXT_483_RESERVE_17 = 0b00000000000000100000000000000000 VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI = 0b00000000000010000000000000000000 func toBits*(flags: openArray[VkShaderStageFlagBits]): VkShaderStageFlags = - for flag in flags: - result = VkShaderStageFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkShaderStageFlags(uint(result) or uint(flag)) func toEnums*(number: VkShaderStageFlags): seq[VkShaderStageFlagBits] = - for value in VkShaderStageFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkShaderStageFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkShaderStageFlags): bool = cint(a) == cint(b) const VK_SHADER_STAGE_ALL_GRAPHICS* = 0x0000001F @@ -2296,12 +2296,12 @@ VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM = 0b00000000001000000000000000000000 VK_IMAGE_USAGE_RESERVED_22_BIT_EXT = 0b00000000010000000000000000000000 func toBits*(flags: openArray[VkImageUsageFlagBits]): VkImageUsageFlags = - for flag in flags: - result = VkImageUsageFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkImageUsageFlags(uint(result) or uint(flag)) func toEnums*(number: VkImageUsageFlags): seq[VkImageUsageFlagBits] = - for value in VkImageUsageFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkImageUsageFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkImageUsageFlags): bool = cint(a) == cint(b) type VkImageCreateFlagBits* {.size: sizeof(cint).} = enum @@ -2326,12 +2326,12 @@ VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT = 0b00000000000001000000000000000000 VK_IMAGE_CREATE_RESERVED_19_BIT_EXT = 0b00000000000010000000000000000000 func toBits*(flags: openArray[VkImageCreateFlagBits]): VkImageCreateFlags = - for flag in flags: - result = VkImageCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkImageCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkImageCreateFlags): seq[VkImageCreateFlagBits] = - for value in VkImageCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkImageCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkImageCreateFlags): bool = cint(a) == cint(b) type VkImageViewCreateFlagBits* {.size: sizeof(cint).} = enum @@ -2339,12 +2339,12 @@ VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT = 0b00000000000000000000000000000010 VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkImageViewCreateFlagBits]): VkImageViewCreateFlags = - for flag in flags: - result = VkImageViewCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkImageViewCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkImageViewCreateFlags): seq[VkImageViewCreateFlagBits] = - for value in VkImageViewCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkImageViewCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkImageViewCreateFlags): bool = cint(a) == cint(b) type VkSamplerCreateFlagBits* {.size: sizeof(cint).} = enum @@ -2354,12 +2354,12 @@ VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000001000 VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkSamplerCreateFlagBits]): VkSamplerCreateFlags = - for flag in flags: - result = VkSamplerCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSamplerCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkSamplerCreateFlags): seq[VkSamplerCreateFlagBits] = - for value in VkSamplerCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSamplerCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSamplerCreateFlags): bool = cint(a) == cint(b) type VkPipelineCreateFlagBits* {.size: sizeof(cint).} = enum @@ -2395,12 +2395,12 @@ VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0b00100000000000000000000000000000 VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT = 0b01000000000000000000000000000000 func toBits*(flags: openArray[VkPipelineCreateFlagBits]): VkPipelineCreateFlags = - for flag in flags: - result = VkPipelineCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineCreateFlags): seq[VkPipelineCreateFlagBits] = - for value in VkPipelineCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineCreateFlags): bool = cint(a) == cint(b) type VkPipelineShaderStageCreateFlagBits* {.size: sizeof(cint).} = enum @@ -2408,12 +2408,12 @@ VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 0b00000000000000000000000000000010 VK_PIPELINE_SHADER_STAGE_CREATE_RESERVED_3_BIT_KHR = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkPipelineShaderStageCreateFlagBits]): VkPipelineShaderStageCreateFlags = - for flag in flags: - result = VkPipelineShaderStageCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineShaderStageCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineShaderStageCreateFlags): seq[VkPipelineShaderStageCreateFlagBits] = - for value in VkPipelineShaderStageCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineShaderStageCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineShaderStageCreateFlags): bool = cint(a) == cint(b) type VkColorComponentFlagBits* {.size: sizeof(cint).} = enum @@ -2422,23 +2422,23 @@ VK_COLOR_COMPONENT_B_BIT = 0b00000000000000000000000000000100 VK_COLOR_COMPONENT_A_BIT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkColorComponentFlagBits]): VkColorComponentFlags = - for flag in flags: - result = VkColorComponentFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkColorComponentFlags(uint(result) or uint(flag)) func toEnums*(number: VkColorComponentFlags): seq[VkColorComponentFlagBits] = - for value in VkColorComponentFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkColorComponentFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkColorComponentFlags): bool = cint(a) == cint(b) type VkFenceCreateFlagBits* {.size: sizeof(cint).} = enum VK_FENCE_CREATE_SIGNALED_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkFenceCreateFlagBits]): VkFenceCreateFlags = - for flag in flags: - result = VkFenceCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkFenceCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkFenceCreateFlags): seq[VkFenceCreateFlagBits] = - for value in VkFenceCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkFenceCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkFenceCreateFlags): bool = cint(a) == cint(b) type VkFormatFeatureFlagBits* {.size: sizeof(cint).} = enum @@ -2474,23 +2474,23 @@ VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0b00100000000000000000000000000000 VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0b01000000000000000000000000000000 func toBits*(flags: openArray[VkFormatFeatureFlagBits]): VkFormatFeatureFlags = - for flag in flags: - result = VkFormatFeatureFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkFormatFeatureFlags(uint(result) or uint(flag)) func toEnums*(number: VkFormatFeatureFlags): seq[VkFormatFeatureFlagBits] = - for value in VkFormatFeatureFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkFormatFeatureFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkFormatFeatureFlags): bool = cint(a) == cint(b) type VkQueryControlFlagBits* {.size: sizeof(cint).} = enum VK_QUERY_CONTROL_PRECISE_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkQueryControlFlagBits]): VkQueryControlFlags = - for flag in flags: - result = VkQueryControlFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkQueryControlFlags(uint(result) or uint(flag)) func toEnums*(number: VkQueryControlFlags): seq[VkQueryControlFlagBits] = - for value in VkQueryControlFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkQueryControlFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkQueryControlFlags): bool = cint(a) == cint(b) type VkQueryResultFlagBits* {.size: sizeof(cint).} = enum @@ -2500,12 +2500,12 @@ VK_QUERY_RESULT_PARTIAL_BIT = 0b00000000000000000000000000001000 VK_QUERY_RESULT_WITH_STATUS_BIT_KHR = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkQueryResultFlagBits]): VkQueryResultFlags = - for flag in flags: - result = VkQueryResultFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkQueryResultFlags(uint(result) or uint(flag)) func toEnums*(number: VkQueryResultFlags): seq[VkQueryResultFlagBits] = - for value in VkQueryResultFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkQueryResultFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkQueryResultFlags): bool = cint(a) == cint(b) type VkCommandBufferUsageFlagBits* {.size: sizeof(cint).} = enum @@ -2513,12 +2513,12 @@ VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0b00000000000000000000000000000010 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkCommandBufferUsageFlagBits]): VkCommandBufferUsageFlags = - for flag in flags: - result = VkCommandBufferUsageFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkCommandBufferUsageFlags(uint(result) or uint(flag)) func toEnums*(number: VkCommandBufferUsageFlags): seq[VkCommandBufferUsageFlagBits] = - for value in VkCommandBufferUsageFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkCommandBufferUsageFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkCommandBufferUsageFlags): bool = cint(a) == cint(b) type VkQueryPipelineStatisticFlagBits* {.size: sizeof(cint).} = enum @@ -2537,12 +2537,12 @@ VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT = 0b00000000000000000001000000000000 VK_QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI = 0b00000000000000000010000000000000 func toBits*(flags: openArray[VkQueryPipelineStatisticFlagBits]): VkQueryPipelineStatisticFlags = - for flag in flags: - result = VkQueryPipelineStatisticFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkQueryPipelineStatisticFlags(uint(result) or uint(flag)) func toEnums*(number: VkQueryPipelineStatisticFlags): seq[VkQueryPipelineStatisticFlagBits] = - for value in VkQueryPipelineStatisticFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkQueryPipelineStatisticFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkQueryPipelineStatisticFlags): bool = cint(a) == cint(b) type VkImageAspectFlagBits* {.size: sizeof(cint).} = enum @@ -2558,12 +2558,12 @@ VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT = 0b00000000000000000000001000000000 VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT = 0b00000000000000000000010000000000 func toBits*(flags: openArray[VkImageAspectFlagBits]): VkImageAspectFlags = - for flag in flags: - result = VkImageAspectFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkImageAspectFlags(uint(result) or uint(flag)) func toEnums*(number: VkImageAspectFlags): seq[VkImageAspectFlagBits] = - for value in VkImageAspectFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkImageAspectFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkImageAspectFlags): bool = cint(a) == cint(b) type VkSparseImageFormatFlagBits* {.size: sizeof(cint).} = enum @@ -2571,23 +2571,23 @@ VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0b00000000000000000000000000000010 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkSparseImageFormatFlagBits]): VkSparseImageFormatFlags = - for flag in flags: - result = VkSparseImageFormatFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSparseImageFormatFlags(uint(result) or uint(flag)) func toEnums*(number: VkSparseImageFormatFlags): seq[VkSparseImageFormatFlagBits] = - for value in VkSparseImageFormatFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSparseImageFormatFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSparseImageFormatFlags): bool = cint(a) == cint(b) type VkSparseMemoryBindFlagBits* {.size: sizeof(cint).} = enum VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkSparseMemoryBindFlagBits]): VkSparseMemoryBindFlags = - for flag in flags: - result = VkSparseMemoryBindFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSparseMemoryBindFlags(uint(result) or uint(flag)) func toEnums*(number: VkSparseMemoryBindFlags): seq[VkSparseMemoryBindFlagBits] = - for value in VkSparseMemoryBindFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSparseMemoryBindFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSparseMemoryBindFlags): bool = cint(a) == cint(b) type VkPipelineStageFlagBits* {.size: sizeof(cint).} = enum @@ -2618,12 +2618,12 @@ VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0b00000001000000000000000000000000 VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0b00000010000000000000000000000000 func toBits*(flags: openArray[VkPipelineStageFlagBits]): VkPipelineStageFlags = - for flag in flags: - result = VkPipelineStageFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineStageFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineStageFlags): seq[VkPipelineStageFlagBits] = - for value in VkPipelineStageFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineStageFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineStageFlags): bool = cint(a) == cint(b) type VkCommandPoolCreateFlagBits* {.size: sizeof(cint).} = enum @@ -2631,35 +2631,35 @@ VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0b00000000000000000000000000000010 VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkCommandPoolCreateFlagBits]): VkCommandPoolCreateFlags = - for flag in flags: - result = VkCommandPoolCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkCommandPoolCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkCommandPoolCreateFlags): seq[VkCommandPoolCreateFlagBits] = - for value in VkCommandPoolCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkCommandPoolCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkCommandPoolCreateFlags): bool = cint(a) == cint(b) type VkCommandPoolResetFlagBits* {.size: sizeof(cint).} = enum VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0b00000000000000000000000000000001 VK_COMMAND_POOL_RESET_RESERVED_1_BIT_COREAVI = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkCommandPoolResetFlagBits]): VkCommandPoolResetFlags = - for flag in flags: - result = VkCommandPoolResetFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkCommandPoolResetFlags(uint(result) or uint(flag)) func toEnums*(number: VkCommandPoolResetFlags): seq[VkCommandPoolResetFlagBits] = - for value in VkCommandPoolResetFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkCommandPoolResetFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkCommandPoolResetFlags): bool = cint(a) == cint(b) type VkCommandBufferResetFlagBits* {.size: sizeof(cint).} = enum VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkCommandBufferResetFlagBits]): VkCommandBufferResetFlags = - for flag in flags: - result = VkCommandBufferResetFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkCommandBufferResetFlags(uint(result) or uint(flag)) func toEnums*(number: VkCommandBufferResetFlags): seq[VkCommandBufferResetFlagBits] = - for value in VkCommandBufferResetFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkCommandBufferResetFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkCommandBufferResetFlags): bool = cint(a) == cint(b) type VkSampleCountFlagBits* {.size: sizeof(cint).} = enum @@ -2671,35 +2671,35 @@ VK_SAMPLE_COUNT_32_BIT = 0b00000000000000000000000000100000 VK_SAMPLE_COUNT_64_BIT = 0b00000000000000000000000001000000 func toBits*(flags: openArray[VkSampleCountFlagBits]): VkSampleCountFlags = - for flag in flags: - result = VkSampleCountFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSampleCountFlags(uint(result) or uint(flag)) func toEnums*(number: VkSampleCountFlags): seq[VkSampleCountFlagBits] = - for value in VkSampleCountFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSampleCountFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSampleCountFlags): bool = cint(a) == cint(b) type VkAttachmentDescriptionFlagBits* {.size: sizeof(cint).} = enum VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkAttachmentDescriptionFlagBits]): VkAttachmentDescriptionFlags = - for flag in flags: - result = VkAttachmentDescriptionFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkAttachmentDescriptionFlags(uint(result) or uint(flag)) func toEnums*(number: VkAttachmentDescriptionFlags): seq[VkAttachmentDescriptionFlagBits] = - for value in VkAttachmentDescriptionFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkAttachmentDescriptionFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkAttachmentDescriptionFlags): bool = cint(a) == cint(b) type VkStencilFaceFlagBits* {.size: sizeof(cint).} = enum VK_STENCIL_FACE_FRONT_BIT = 0b00000000000000000000000000000001 VK_STENCIL_FACE_BACK_BIT = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkStencilFaceFlagBits]): VkStencilFaceFlags = - for flag in flags: - result = VkStencilFaceFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkStencilFaceFlags(uint(result) or uint(flag)) func toEnums*(number: VkStencilFaceFlags): seq[VkStencilFaceFlagBits] = - for value in VkStencilFaceFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkStencilFaceFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkStencilFaceFlags): bool = cint(a) == cint(b) const VK_STENCIL_FACE_FRONT_AND_BACK* = 0x00000003 @@ -2709,12 +2709,12 @@ VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 0b00000000000000000000000000000010 VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkDescriptorPoolCreateFlagBits]): VkDescriptorPoolCreateFlags = - for flag in flags: - result = VkDescriptorPoolCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkDescriptorPoolCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkDescriptorPoolCreateFlags): seq[VkDescriptorPoolCreateFlagBits] = - for value in VkDescriptorPoolCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDescriptorPoolCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDescriptorPoolCreateFlags): bool = cint(a) == cint(b) type VkDependencyFlagBits* {.size: sizeof(cint).} = enum @@ -2723,12 +2723,12 @@ VK_DEPENDENCY_DEVICE_GROUP_BIT = 0b00000000000000000000000000000100 VK_DEPENDENCY_FEEDBACK_LOOP_BIT_EXT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkDependencyFlagBits]): VkDependencyFlags = - for flag in flags: - result = VkDependencyFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkDependencyFlags(uint(result) or uint(flag)) func toEnums*(number: VkDependencyFlags): seq[VkDependencyFlagBits] = - for value in VkDependencyFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDependencyFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDependencyFlags): bool = cint(a) == cint(b) type VkSemaphoreType* {.size: sizeof(cint).} = enum @@ -2737,12 +2737,12 @@ VkSemaphoreWaitFlagBits* {.size: sizeof(cint).} = enum VK_SEMAPHORE_WAIT_ANY_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkSemaphoreWaitFlagBits]): VkSemaphoreWaitFlags = - for flag in flags: - result = VkSemaphoreWaitFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSemaphoreWaitFlags(uint(result) or uint(flag)) func toEnums*(number: VkSemaphoreWaitFlags): seq[VkSemaphoreWaitFlagBits] = - for value in VkSemaphoreWaitFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSemaphoreWaitFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSemaphoreWaitFlags): bool = cint(a) == cint(b) type VkPresentModeKHR* {.size: sizeof(cint).} = enum @@ -2775,12 +2775,12 @@ VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0b00000000000000000000000000000100 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkDisplayPlaneAlphaFlagBitsKHR]): VkDisplayPlaneAlphaFlagsKHR = - for flag in flags: - result = VkDisplayPlaneAlphaFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkDisplayPlaneAlphaFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkDisplayPlaneAlphaFlagsKHR): seq[VkDisplayPlaneAlphaFlagBitsKHR] = - for value in VkDisplayPlaneAlphaFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDisplayPlaneAlphaFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDisplayPlaneAlphaFlagsKHR): bool = cint(a) == cint(b) type VkCompositeAlphaFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -2789,12 +2789,12 @@ VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0b00000000000000000000000000000100 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkCompositeAlphaFlagBitsKHR]): VkCompositeAlphaFlagsKHR = - for flag in flags: - result = VkCompositeAlphaFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkCompositeAlphaFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkCompositeAlphaFlagsKHR): seq[VkCompositeAlphaFlagBitsKHR] = - for value in VkCompositeAlphaFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkCompositeAlphaFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkCompositeAlphaFlagsKHR): bool = cint(a) == cint(b) type VkSurfaceTransformFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -2808,23 +2808,23 @@ VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0b00000000000000000000000010000000 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0b00000000000000000000000100000000 func toBits*(flags: openArray[VkSurfaceTransformFlagBitsKHR]): VkSurfaceTransformFlagsKHR = - for flag in flags: - result = VkSurfaceTransformFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkSurfaceTransformFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkSurfaceTransformFlagsKHR): seq[VkSurfaceTransformFlagBitsKHR] = - for value in VkSurfaceTransformFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSurfaceTransformFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSurfaceTransformFlagsKHR): bool = cint(a) == cint(b) type VkSwapchainImageUsageFlagBitsANDROID* {.size: sizeof(cint).} = enum VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkSwapchainImageUsageFlagBitsANDROID]): VkSwapchainImageUsageFlagsANDROID = - for flag in flags: - result = VkSwapchainImageUsageFlagsANDROID(uint(result) or uint(flag)) + for flag in flags: + result = VkSwapchainImageUsageFlagsANDROID(uint(result) or uint(flag)) func toEnums*(number: VkSwapchainImageUsageFlagsANDROID): seq[VkSwapchainImageUsageFlagBitsANDROID] = - for value in VkSwapchainImageUsageFlagBitsANDROID.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSwapchainImageUsageFlagBitsANDROID.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSwapchainImageUsageFlagsANDROID): bool = cint(a) == cint(b) type VkTimeDomainEXT* {.size: sizeof(cint).} = enum @@ -2839,12 +2839,12 @@ VK_DEBUG_REPORT_ERROR_BIT_EXT = 0b00000000000000000000000000001000 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkDebugReportFlagBitsEXT]): VkDebugReportFlagsEXT = - for flag in flags: - result = VkDebugReportFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkDebugReportFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkDebugReportFlagsEXT): seq[VkDebugReportFlagBitsEXT] = - for value in VkDebugReportFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDebugReportFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDebugReportFlagsEXT): bool = cint(a) == cint(b) type VkDebugReportObjectTypeEXT* {.size: sizeof(cint).} = enum @@ -2902,12 +2902,12 @@ VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0b00000000000000000000000000000100 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkExternalMemoryHandleTypeFlagBitsNV]): VkExternalMemoryHandleTypeFlagsNV = - for flag in flags: - result = VkExternalMemoryHandleTypeFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalMemoryHandleTypeFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkExternalMemoryHandleTypeFlagsNV): seq[VkExternalMemoryHandleTypeFlagBitsNV] = - for value in VkExternalMemoryHandleTypeFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalMemoryHandleTypeFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalMemoryHandleTypeFlagsNV): bool = cint(a) == cint(b) type VkExternalMemoryFeatureFlagBitsNV* {.size: sizeof(cint).} = enum @@ -2915,12 +2915,12 @@ VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0b00000000000000000000000000000010 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkExternalMemoryFeatureFlagBitsNV]): VkExternalMemoryFeatureFlagsNV = - for flag in flags: - result = VkExternalMemoryFeatureFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalMemoryFeatureFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkExternalMemoryFeatureFlagsNV): seq[VkExternalMemoryFeatureFlagBitsNV] = - for value in VkExternalMemoryFeatureFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalMemoryFeatureFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalMemoryFeatureFlagsNV): bool = cint(a) == cint(b) type VkValidationCheckEXT* {.size: sizeof(cint).} = enum @@ -2952,12 +2952,12 @@ VK_SUBGROUP_FEATURE_QUAD_BIT = 0b00000000000000000000000010000000 VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0b00000000000000000000000100000000 func toBits*(flags: openArray[VkSubgroupFeatureFlagBits]): VkSubgroupFeatureFlags = - for flag in flags: - result = VkSubgroupFeatureFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSubgroupFeatureFlags(uint(result) or uint(flag)) func toEnums*(number: VkSubgroupFeatureFlags): seq[VkSubgroupFeatureFlagBits] = - for value in VkSubgroupFeatureFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSubgroupFeatureFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSubgroupFeatureFlags): bool = cint(a) == cint(b) type VkIndirectCommandsLayoutUsageFlagBitsNV* {.size: sizeof(cint).} = enum @@ -2965,23 +2965,23 @@ VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV = 0b00000000000000000000000000000010 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkIndirectCommandsLayoutUsageFlagBitsNV]): VkIndirectCommandsLayoutUsageFlagsNV = - for flag in flags: - result = VkIndirectCommandsLayoutUsageFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkIndirectCommandsLayoutUsageFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkIndirectCommandsLayoutUsageFlagsNV): seq[VkIndirectCommandsLayoutUsageFlagBitsNV] = - for value in VkIndirectCommandsLayoutUsageFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkIndirectCommandsLayoutUsageFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkIndirectCommandsLayoutUsageFlagsNV): bool = cint(a) == cint(b) type VkIndirectStateFlagBitsNV* {.size: sizeof(cint).} = enum VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkIndirectStateFlagBitsNV]): VkIndirectStateFlagsNV = - for flag in flags: - result = VkIndirectStateFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkIndirectStateFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkIndirectStateFlagsNV): seq[VkIndirectStateFlagBitsNV] = - for value in VkIndirectStateFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkIndirectStateFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkIndirectStateFlagsNV): bool = cint(a) == cint(b) type VkIndirectCommandsTokenTypeNV* {.size: sizeof(cint).} = enum @@ -2997,12 +2997,12 @@ VkPrivateDataSlotCreateFlagBits* {.size: sizeof(cint).} = enum VK_PRIVATE_DATA_SLOT_CREATE_RESERVED_0_BIT_NV = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkPrivateDataSlotCreateFlagBits]): VkPrivateDataSlotCreateFlags = - for flag in flags: - result = VkPrivateDataSlotCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPrivateDataSlotCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkPrivateDataSlotCreateFlags): seq[VkPrivateDataSlotCreateFlagBits] = - for value in VkPrivateDataSlotCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPrivateDataSlotCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPrivateDataSlotCreateFlags): bool = cint(a) == cint(b) type VkDescriptorSetLayoutCreateFlagBits* {.size: sizeof(cint).} = enum @@ -3013,12 +3013,12 @@ VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0b00000000000000000000000000010000 VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT = 0b00000000000000000000000000100000 func toBits*(flags: openArray[VkDescriptorSetLayoutCreateFlagBits]): VkDescriptorSetLayoutCreateFlags = - for flag in flags: - result = VkDescriptorSetLayoutCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkDescriptorSetLayoutCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkDescriptorSetLayoutCreateFlags): seq[VkDescriptorSetLayoutCreateFlagBits] = - for value in VkDescriptorSetLayoutCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDescriptorSetLayoutCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDescriptorSetLayoutCreateFlags): bool = cint(a) == cint(b) type VkExternalMemoryHandleTypeFlagBits* {.size: sizeof(cint).} = enum @@ -3037,12 +3037,12 @@ VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV = 0b00000000000000000001000000000000 VK_EXTERNAL_MEMORY_HANDLE_TYPE_SCI_BUF_BIT_NV = 0b00000000000000000010000000000000 func toBits*(flags: openArray[VkExternalMemoryHandleTypeFlagBits]): VkExternalMemoryHandleTypeFlags = - for flag in flags: - result = VkExternalMemoryHandleTypeFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalMemoryHandleTypeFlags(uint(result) or uint(flag)) func toEnums*(number: VkExternalMemoryHandleTypeFlags): seq[VkExternalMemoryHandleTypeFlagBits] = - for value in VkExternalMemoryHandleTypeFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalMemoryHandleTypeFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalMemoryHandleTypeFlags): bool = cint(a) == cint(b) type VkExternalMemoryFeatureFlagBits* {.size: sizeof(cint).} = enum @@ -3050,12 +3050,12 @@ VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0b00000000000000000000000000000010 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkExternalMemoryFeatureFlagBits]): VkExternalMemoryFeatureFlags = - for flag in flags: - result = VkExternalMemoryFeatureFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalMemoryFeatureFlags(uint(result) or uint(flag)) func toEnums*(number: VkExternalMemoryFeatureFlags): seq[VkExternalMemoryFeatureFlagBits] = - for value in VkExternalMemoryFeatureFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalMemoryFeatureFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalMemoryFeatureFlags): bool = cint(a) == cint(b) type VkExternalSemaphoreHandleTypeFlagBits* {.size: sizeof(cint).} = enum @@ -3067,35 +3067,35 @@ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SCI_SYNC_OBJ_BIT_NV = 0b00000000000000000000000000100000 VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA = 0b00000000000000000000000010000000 func toBits*(flags: openArray[VkExternalSemaphoreHandleTypeFlagBits]): VkExternalSemaphoreHandleTypeFlags = - for flag in flags: - result = VkExternalSemaphoreHandleTypeFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalSemaphoreHandleTypeFlags(uint(result) or uint(flag)) func toEnums*(number: VkExternalSemaphoreHandleTypeFlags): seq[VkExternalSemaphoreHandleTypeFlagBits] = - for value in VkExternalSemaphoreHandleTypeFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalSemaphoreHandleTypeFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalSemaphoreHandleTypeFlags): bool = cint(a) == cint(b) type VkExternalSemaphoreFeatureFlagBits* {.size: sizeof(cint).} = enum VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 0b00000000000000000000000000000001 VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkExternalSemaphoreFeatureFlagBits]): VkExternalSemaphoreFeatureFlags = - for flag in flags: - result = VkExternalSemaphoreFeatureFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalSemaphoreFeatureFlags(uint(result) or uint(flag)) func toEnums*(number: VkExternalSemaphoreFeatureFlags): seq[VkExternalSemaphoreFeatureFlagBits] = - for value in VkExternalSemaphoreFeatureFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalSemaphoreFeatureFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalSemaphoreFeatureFlags): bool = cint(a) == cint(b) type VkSemaphoreImportFlagBits* {.size: sizeof(cint).} = enum VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkSemaphoreImportFlagBits]): VkSemaphoreImportFlags = - for flag in flags: - result = VkSemaphoreImportFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSemaphoreImportFlags(uint(result) or uint(flag)) func toEnums*(number: VkSemaphoreImportFlags): seq[VkSemaphoreImportFlagBits] = - for value in VkSemaphoreImportFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSemaphoreImportFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSemaphoreImportFlags): bool = cint(a) == cint(b) type VkExternalFenceHandleTypeFlagBits* {.size: sizeof(cint).} = enum @@ -3106,46 +3106,46 @@ VK_EXTERNAL_FENCE_HANDLE_TYPE_SCI_SYNC_OBJ_BIT_NV = 0b00000000000000000000000000010000 VK_EXTERNAL_FENCE_HANDLE_TYPE_SCI_SYNC_FENCE_BIT_NV = 0b00000000000000000000000000100000 func toBits*(flags: openArray[VkExternalFenceHandleTypeFlagBits]): VkExternalFenceHandleTypeFlags = - for flag in flags: - result = VkExternalFenceHandleTypeFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalFenceHandleTypeFlags(uint(result) or uint(flag)) func toEnums*(number: VkExternalFenceHandleTypeFlags): seq[VkExternalFenceHandleTypeFlagBits] = - for value in VkExternalFenceHandleTypeFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalFenceHandleTypeFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalFenceHandleTypeFlags): bool = cint(a) == cint(b) type VkExternalFenceFeatureFlagBits* {.size: sizeof(cint).} = enum VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 0b00000000000000000000000000000001 VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkExternalFenceFeatureFlagBits]): VkExternalFenceFeatureFlags = - for flag in flags: - result = VkExternalFenceFeatureFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkExternalFenceFeatureFlags(uint(result) or uint(flag)) func toEnums*(number: VkExternalFenceFeatureFlags): seq[VkExternalFenceFeatureFlagBits] = - for value in VkExternalFenceFeatureFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExternalFenceFeatureFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExternalFenceFeatureFlags): bool = cint(a) == cint(b) type VkFenceImportFlagBits* {.size: sizeof(cint).} = enum VK_FENCE_IMPORT_TEMPORARY_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkFenceImportFlagBits]): VkFenceImportFlags = - for flag in flags: - result = VkFenceImportFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkFenceImportFlags(uint(result) or uint(flag)) func toEnums*(number: VkFenceImportFlags): seq[VkFenceImportFlagBits] = - for value in VkFenceImportFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkFenceImportFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkFenceImportFlags): bool = cint(a) == cint(b) type VkSurfaceCounterFlagBitsEXT* {.size: sizeof(cint).} = enum VK_SURFACE_COUNTER_VBLANK_BIT_EXT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkSurfaceCounterFlagBitsEXT]): VkSurfaceCounterFlagsEXT = - for flag in flags: - result = VkSurfaceCounterFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkSurfaceCounterFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkSurfaceCounterFlagsEXT): seq[VkSurfaceCounterFlagBitsEXT] = - for value in VkSurfaceCounterFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSurfaceCounterFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSurfaceCounterFlagsEXT): bool = cint(a) == cint(b) type VkDisplayPowerStateEXT* {.size: sizeof(cint).} = enum @@ -3162,12 +3162,12 @@ VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 0b00000000000000000000000000000100 VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkPeerMemoryFeatureFlagBits]): VkPeerMemoryFeatureFlags = - for flag in flags: - result = VkPeerMemoryFeatureFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPeerMemoryFeatureFlags(uint(result) or uint(flag)) func toEnums*(number: VkPeerMemoryFeatureFlags): seq[VkPeerMemoryFeatureFlagBits] = - for value in VkPeerMemoryFeatureFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPeerMemoryFeatureFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPeerMemoryFeatureFlags): bool = cint(a) == cint(b) type VkMemoryAllocateFlagBits* {.size: sizeof(cint).} = enum @@ -3175,12 +3175,12 @@ VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT = 0b00000000000000000000000000000010 VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkMemoryAllocateFlagBits]): VkMemoryAllocateFlags = - for flag in flags: - result = VkMemoryAllocateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkMemoryAllocateFlags(uint(result) or uint(flag)) func toEnums*(number: VkMemoryAllocateFlags): seq[VkMemoryAllocateFlagBits] = - for value in VkMemoryAllocateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkMemoryAllocateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkMemoryAllocateFlags): bool = cint(a) == cint(b) type VkDeviceGroupPresentModeFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -3189,12 +3189,12 @@ VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 0b00000000000000000000000000000100 VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkDeviceGroupPresentModeFlagBitsKHR]): VkDeviceGroupPresentModeFlagsKHR = - for flag in flags: - result = VkDeviceGroupPresentModeFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkDeviceGroupPresentModeFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkDeviceGroupPresentModeFlagsKHR): seq[VkDeviceGroupPresentModeFlagBitsKHR] = - for value in VkDeviceGroupPresentModeFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDeviceGroupPresentModeFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDeviceGroupPresentModeFlagsKHR): bool = cint(a) == cint(b) type VkSwapchainCreateFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -3204,12 +3204,12 @@ VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT = 0b00000000000000000000000000001000 VK_SWAPCHAIN_CREATE_RESERVED_4_BIT_EXT = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkSwapchainCreateFlagBitsKHR]): VkSwapchainCreateFlagsKHR = - for flag in flags: - result = VkSwapchainCreateFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkSwapchainCreateFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkSwapchainCreateFlagsKHR): seq[VkSwapchainCreateFlagBitsKHR] = - for value in VkSwapchainCreateFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSwapchainCreateFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSwapchainCreateFlagsKHR): bool = cint(a) == cint(b) type VkViewportCoordinateSwizzleNV* {.size: sizeof(cint).} = enum @@ -3234,12 +3234,12 @@ VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0b00000000000000000000000001000000 VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT = 0b00000000000000000000000010000000 func toBits*(flags: openArray[VkSubpassDescriptionFlagBits]): VkSubpassDescriptionFlags = - for flag in flags: - result = VkSubpassDescriptionFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSubpassDescriptionFlags(uint(result) or uint(flag)) func toEnums*(number: VkSubpassDescriptionFlags): seq[VkSubpassDescriptionFlagBits] = - for value in VkSubpassDescriptionFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSubpassDescriptionFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSubpassDescriptionFlags): bool = cint(a) == cint(b) type VkPointClippingBehavior* {.size: sizeof(cint).} = enum @@ -3293,12 +3293,12 @@ VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT = 0b00000000000000000000000100000000 VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT = 0b00000000000000000001000000000000 func toBits*(flags: openArray[VkDebugUtilsMessageSeverityFlagBitsEXT]): VkDebugUtilsMessageSeverityFlagsEXT = - for flag in flags: - result = VkDebugUtilsMessageSeverityFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkDebugUtilsMessageSeverityFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkDebugUtilsMessageSeverityFlagsEXT): seq[VkDebugUtilsMessageSeverityFlagBitsEXT] = - for value in VkDebugUtilsMessageSeverityFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDebugUtilsMessageSeverityFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDebugUtilsMessageSeverityFlagsEXT): bool = cint(a) == cint(b) type VkDebugUtilsMessageTypeFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -3307,12 +3307,12 @@ VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0b00000000000000000000000000000100 VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkDebugUtilsMessageTypeFlagBitsEXT]): VkDebugUtilsMessageTypeFlagsEXT = - for flag in flags: - result = VkDebugUtilsMessageTypeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkDebugUtilsMessageTypeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkDebugUtilsMessageTypeFlagsEXT): seq[VkDebugUtilsMessageTypeFlagBitsEXT] = - for value in VkDebugUtilsMessageTypeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDebugUtilsMessageTypeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDebugUtilsMessageTypeFlagsEXT): bool = cint(a) == cint(b) type VkConservativeRasterizationModeEXT* {.size: sizeof(cint).} = enum @@ -3326,12 +3326,12 @@ VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT = 0b00000000000000000000000000001000 VK_DESCRIPTOR_BINDING_RESERVED_4_BIT_QCOM = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkDescriptorBindingFlagBits]): VkDescriptorBindingFlags = - for flag in flags: - result = VkDescriptorBindingFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkDescriptorBindingFlags(uint(result) or uint(flag)) func toEnums*(number: VkDescriptorBindingFlags): seq[VkDescriptorBindingFlagBits] = - for value in VkDescriptorBindingFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDescriptorBindingFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDescriptorBindingFlags): bool = cint(a) == cint(b) type VkVendorId* {.size: sizeof(cint).} = enum @@ -3370,12 +3370,12 @@ VkConditionalRenderingFlagBitsEXT* {.size: sizeof(cint).} = enum VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkConditionalRenderingFlagBitsEXT]): VkConditionalRenderingFlagsEXT = - for flag in flags: - result = VkConditionalRenderingFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkConditionalRenderingFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkConditionalRenderingFlagsEXT): seq[VkConditionalRenderingFlagBitsEXT] = - for value in VkConditionalRenderingFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkConditionalRenderingFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkConditionalRenderingFlagsEXT): bool = cint(a) == cint(b) type VkResolveModeFlagBits* {.size: sizeof(cint).} = enum @@ -3384,12 +3384,12 @@ VK_RESOLVE_MODE_MIN_BIT = 0b00000000000000000000000000000100 VK_RESOLVE_MODE_MAX_BIT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkResolveModeFlagBits]): VkResolveModeFlags = - for flag in flags: - result = VkResolveModeFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkResolveModeFlags(uint(result) or uint(flag)) func toEnums*(number: VkResolveModeFlags): seq[VkResolveModeFlagBits] = - for value in VkResolveModeFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkResolveModeFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkResolveModeFlags): bool = cint(a) == cint(b) const VK_RESOLVE_MODE_NONE* = 0 @@ -3420,24 +3420,24 @@ VK_GEOMETRY_INSTANCE_FORCE_OPACITY_MICROMAP_2_STATE_EXT = 0b00000000000000000000000000010000 VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXT = 0b00000000000000000000000000100000 func toBits*(flags: openArray[VkGeometryInstanceFlagBitsKHR]): VkGeometryInstanceFlagsKHR = - for flag in flags: - result = VkGeometryInstanceFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkGeometryInstanceFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkGeometryInstanceFlagsKHR): seq[VkGeometryInstanceFlagBitsKHR] = - for value in VkGeometryInstanceFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkGeometryInstanceFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkGeometryInstanceFlagsKHR): bool = cint(a) == cint(b) type VkGeometryFlagBitsKHR* {.size: sizeof(cint).} = enum VK_GEOMETRY_OPAQUE_BIT_KHR = 0b00000000000000000000000000000001 VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkGeometryFlagBitsKHR]): VkGeometryFlagsKHR = - for flag in flags: - result = VkGeometryFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkGeometryFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkGeometryFlagsKHR): seq[VkGeometryFlagBitsKHR] = - for value in VkGeometryFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkGeometryFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkGeometryFlagsKHR): bool = cint(a) == cint(b) type VkBuildAccelerationStructureFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -3453,12 +3453,12 @@ VK_BUILD_ACCELERATION_STRUCTURE_RESERVED_BIT_9_NV = 0b00000000000000000000001000000000 VK_BUILD_ACCELERATION_STRUCTURE_RESERVED_BIT_10_NV = 0b00000000000000000000010000000000 func toBits*(flags: openArray[VkBuildAccelerationStructureFlagBitsKHR]): VkBuildAccelerationStructureFlagsKHR = - for flag in flags: - result = VkBuildAccelerationStructureFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkBuildAccelerationStructureFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkBuildAccelerationStructureFlagsKHR): seq[VkBuildAccelerationStructureFlagBitsKHR] = - for value in VkBuildAccelerationStructureFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkBuildAccelerationStructureFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkBuildAccelerationStructureFlagsKHR): bool = cint(a) == cint(b) type VkAccelerationStructureCreateFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -3466,12 +3466,12 @@ VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV = 0b00000000000000000000000000000100 VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkAccelerationStructureCreateFlagBitsKHR]): VkAccelerationStructureCreateFlagsKHR = - for flag in flags: - result = VkAccelerationStructureCreateFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkAccelerationStructureCreateFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkAccelerationStructureCreateFlagsKHR): seq[VkAccelerationStructureCreateFlagBitsKHR] = - for value in VkAccelerationStructureCreateFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkAccelerationStructureCreateFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkAccelerationStructureCreateFlagsKHR): bool = cint(a) == cint(b) type VkCopyAccelerationStructureModeKHR* {.size: sizeof(cint).} = enum @@ -3517,12 +3517,12 @@ VkFramebufferCreateFlagBits* {.size: sizeof(cint).} = enum VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkFramebufferCreateFlagBits]): VkFramebufferCreateFlags = - for flag in flags: - result = VkFramebufferCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkFramebufferCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkFramebufferCreateFlags): seq[VkFramebufferCreateFlagBits] = - for value in VkFramebufferCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkFramebufferCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkFramebufferCreateFlags): bool = cint(a) == cint(b) type VkScopeNV* {.size: sizeof(cint).} = enum @@ -3548,12 +3548,12 @@ VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV = 0b00000000000000000000000000000100 VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_ERROR_REPORTING_BIT_NV = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkDeviceDiagnosticsConfigFlagBitsNV]): VkDeviceDiagnosticsConfigFlagsNV = - for flag in flags: - result = VkDeviceDiagnosticsConfigFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkDeviceDiagnosticsConfigFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkDeviceDiagnosticsConfigFlagsNV): seq[VkDeviceDiagnosticsConfigFlagBitsNV] = - for value in VkDeviceDiagnosticsConfigFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDeviceDiagnosticsConfigFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDeviceDiagnosticsConfigFlagsNV): bool = cint(a) == cint(b) type VkPipelineCreationFeedbackFlagBits* {.size: sizeof(cint).} = enum @@ -3561,12 +3561,12 @@ VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT = 0b00000000000000000000000000000010 VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkPipelineCreationFeedbackFlagBits]): VkPipelineCreationFeedbackFlags = - for flag in flags: - result = VkPipelineCreationFeedbackFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineCreationFeedbackFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineCreationFeedbackFlags): seq[VkPipelineCreationFeedbackFlagBits] = - for value in VkPipelineCreationFeedbackFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineCreationFeedbackFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineCreationFeedbackFlags): bool = cint(a) == cint(b) type VkFullScreenExclusiveEXT* {.size: sizeof(cint).} = enum @@ -3581,12 +3581,12 @@ VkMemoryDecompressionMethodFlagBitsNV* {.size: 8.} = enum VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV = 0b0000000000000000000000000000000000000000000000000000000000000001 func toBits*(flags: openArray[VkMemoryDecompressionMethodFlagBitsNV]): VkMemoryDecompressionMethodFlagsNV = - for flag in flags: - result = VkMemoryDecompressionMethodFlagsNV(uint64(result) or uint64(flag)) + for flag in flags: + result = VkMemoryDecompressionMethodFlagsNV(uint64(result) or uint64(flag)) func toEnums*(number: VkMemoryDecompressionMethodFlagsNV): seq[VkMemoryDecompressionMethodFlagBitsNV] = - for value in VkMemoryDecompressionMethodFlagBitsNV.items: - if (cast[uint64](value) and uint64(number)) > 0: - result.add value + for value in VkMemoryDecompressionMethodFlagBitsNV.items: + if (cast[uint64](value) and uint64(number)) > 0: + result.add value proc `==`*(a, b: VkMemoryDecompressionMethodFlagsNV): bool = uint64(a) == uint64(b) type VkPerformanceCounterUnitKHR* {.size: sizeof(cint).} = enum @@ -3612,12 +3612,12 @@ VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR = 0b00000000000000000000000000000001 VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkPerformanceCounterDescriptionFlagBitsKHR]): VkPerformanceCounterDescriptionFlagsKHR = - for flag in flags: - result = VkPerformanceCounterDescriptionFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkPerformanceCounterDescriptionFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkPerformanceCounterDescriptionFlagsKHR): seq[VkPerformanceCounterDescriptionFlagBitsKHR] = - for value in VkPerformanceCounterDescriptionFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPerformanceCounterDescriptionFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPerformanceCounterDescriptionFlagsKHR): bool = cint(a) == cint(b) type VkPerformanceConfigurationTypeINTEL* {.size: sizeof(cint).} = enum @@ -3674,12 +3674,12 @@ VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT = 0b00000000000000000000000000100000 VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT = 0b00000000000000000000000001000000 func toBits*(flags: openArray[VkToolPurposeFlagBits]): VkToolPurposeFlags = - for flag in flags: - result = VkToolPurposeFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkToolPurposeFlags(uint(result) or uint(flag)) func toEnums*(number: VkToolPurposeFlags): seq[VkToolPurposeFlagBits] = - for value in VkToolPurposeFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkToolPurposeFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkToolPurposeFlags): bool = cint(a) == cint(b) type VkPipelineMatchControl* {.size: sizeof(cint).} = enum @@ -3766,12 +3766,12 @@ VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT = 0b0000000000000000001000000000000000000000000000000000000000000000 VK_ACCESS_2_RESERVED_46_BIT_EXT = 0b0000000000000000010000000000000000000000000000000000000000000000 func toBits*(flags: openArray[VkAccessFlagBits2]): VkAccessFlags2 = - for flag in flags: - result = VkAccessFlags2(uint64(result) or uint64(flag)) + for flag in flags: + result = VkAccessFlags2(uint64(result) or uint64(flag)) func toEnums*(number: VkAccessFlags2): seq[VkAccessFlagBits2] = - for value in VkAccessFlagBits2.items: - if (cast[uint64](value) and uint64(number)) > 0: - result.add value + for value in VkAccessFlagBits2.items: + if (cast[uint64](value) and uint64(number)) > 0: + result.add value proc `==`*(a, b: VkAccessFlags2): bool = uint64(a) == uint64(b) const VK_ACCESS_2_NONE* = 0 @@ -3819,12 +3819,12 @@ VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0b0000000000000000000000010000000000000000000000000000000000000000 VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI = 0b0000000000000000000000100000000000000000000000000000000000000000 func toBits*(flags: openArray[VkPipelineStageFlagBits2]): VkPipelineStageFlags2 = - for flag in flags: - result = VkPipelineStageFlags2(uint64(result) or uint64(flag)) + for flag in flags: + result = VkPipelineStageFlags2(uint64(result) or uint64(flag)) func toEnums*(number: VkPipelineStageFlags2): seq[VkPipelineStageFlagBits2] = - for value in VkPipelineStageFlagBits2.items: - if (cast[uint64](value) and uint64(number)) > 0: - result.add value + for value in VkPipelineStageFlagBits2.items: + if (cast[uint64](value) and uint64(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineStageFlags2): bool = uint64(a) == uint64(b) const VK_PIPELINE_STAGE_2_NONE* = 0 @@ -3832,35 +3832,35 @@ VkSubmitFlagBits* {.size: sizeof(cint).} = enum VK_SUBMIT_PROTECTED_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkSubmitFlagBits]): VkSubmitFlags = - for flag in flags: - result = VkSubmitFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkSubmitFlags(uint(result) or uint(flag)) func toEnums*(number: VkSubmitFlags): seq[VkSubmitFlagBits] = - for value in VkSubmitFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkSubmitFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkSubmitFlags): bool = cint(a) == cint(b) type VkEventCreateFlagBits* {.size: sizeof(cint).} = enum VK_EVENT_CREATE_DEVICE_ONLY_BIT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkEventCreateFlagBits]): VkEventCreateFlags = - for flag in flags: - result = VkEventCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkEventCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkEventCreateFlags): seq[VkEventCreateFlagBits] = - for value in VkEventCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkEventCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkEventCreateFlags): bool = cint(a) == cint(b) type VkPipelineLayoutCreateFlagBits* {.size: sizeof(cint).} = enum VK_PIPELINE_LAYOUT_CREATE_RESERVED_0_BIT_AMD = 0b00000000000000000000000000000001 VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkPipelineLayoutCreateFlagBits]): VkPipelineLayoutCreateFlags = - for flag in flags: - result = VkPipelineLayoutCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineLayoutCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineLayoutCreateFlags): seq[VkPipelineLayoutCreateFlagBits] = - for value in VkPipelineLayoutCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineLayoutCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineLayoutCreateFlags): bool = cint(a) == cint(b) type VkSciSyncClientTypeNV* {.size: sizeof(cint).} = enum @@ -3882,24 +3882,24 @@ VkPipelineColorBlendStateCreateFlagBits* {.size: sizeof(cint).} = enum VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkPipelineColorBlendStateCreateFlagBits]): VkPipelineColorBlendStateCreateFlags = - for flag in flags: - result = VkPipelineColorBlendStateCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineColorBlendStateCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineColorBlendStateCreateFlags): seq[VkPipelineColorBlendStateCreateFlagBits] = - for value in VkPipelineColorBlendStateCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineColorBlendStateCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineColorBlendStateCreateFlags): bool = cint(a) == cint(b) type VkPipelineDepthStencilStateCreateFlagBits* {.size: sizeof(cint).} = enum VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0b00000000000000000000000000000001 VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkPipelineDepthStencilStateCreateFlagBits]): VkPipelineDepthStencilStateCreateFlags = - for flag in flags: - result = VkPipelineDepthStencilStateCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkPipelineDepthStencilStateCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkPipelineDepthStencilStateCreateFlags): seq[VkPipelineDepthStencilStateCreateFlagBits] = - for value in VkPipelineDepthStencilStateCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPipelineDepthStencilStateCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPipelineDepthStencilStateCreateFlags): bool = cint(a) == cint(b) type VkGraphicsPipelineLibraryFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -3908,23 +3908,23 @@ VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT = 0b00000000000000000000000000000100 VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkGraphicsPipelineLibraryFlagBitsEXT]): VkGraphicsPipelineLibraryFlagsEXT = - for flag in flags: - result = VkGraphicsPipelineLibraryFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkGraphicsPipelineLibraryFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkGraphicsPipelineLibraryFlagsEXT): seq[VkGraphicsPipelineLibraryFlagBitsEXT] = - for value in VkGraphicsPipelineLibraryFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkGraphicsPipelineLibraryFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkGraphicsPipelineLibraryFlagsEXT): bool = cint(a) == cint(b) type VkDeviceAddressBindingFlagBitsEXT* {.size: sizeof(cint).} = enum VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkDeviceAddressBindingFlagBitsEXT]): VkDeviceAddressBindingFlagsEXT = - for flag in flags: - result = VkDeviceAddressBindingFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkDeviceAddressBindingFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkDeviceAddressBindingFlagsEXT): seq[VkDeviceAddressBindingFlagBitsEXT] = - for value in VkDeviceAddressBindingFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkDeviceAddressBindingFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkDeviceAddressBindingFlagsEXT): bool = cint(a) == cint(b) type VkDeviceAddressBindingTypeEXT* {.size: sizeof(cint).} = enum @@ -3935,12 +3935,12 @@ VK_PRESENT_SCALING_ASPECT_RATIO_STRETCH_BIT_EXT = 0b00000000000000000000000000000010 VK_PRESENT_SCALING_STRETCH_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkPresentScalingFlagBitsEXT]): VkPresentScalingFlagsEXT = - for flag in flags: - result = VkPresentScalingFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkPresentScalingFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkPresentScalingFlagsEXT): seq[VkPresentScalingFlagBitsEXT] = - for value in VkPresentScalingFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPresentScalingFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPresentScalingFlagsEXT): bool = cint(a) == cint(b) type VkPresentGravityFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -3948,12 +3948,12 @@ VK_PRESENT_GRAVITY_MAX_BIT_EXT = 0b00000000000000000000000000000010 VK_PRESENT_GRAVITY_CENTERED_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkPresentGravityFlagBitsEXT]): VkPresentGravityFlagsEXT = - for flag in flags: - result = VkPresentGravityFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkPresentGravityFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkPresentGravityFlagsEXT): seq[VkPresentGravityFlagBitsEXT] = - for value in VkPresentGravityFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkPresentGravityFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkPresentGravityFlagsEXT): bool = cint(a) == cint(b) type VkVideoCodecOperationFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -3962,12 +3962,12 @@ VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT = 0b00000000000000010000000000000000 VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT = 0b00000000000000100000000000000000 func toBits*(flags: openArray[VkVideoCodecOperationFlagBitsKHR]): VkVideoCodecOperationFlagsKHR = - for flag in flags: - result = VkVideoCodecOperationFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoCodecOperationFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoCodecOperationFlagsKHR): seq[VkVideoCodecOperationFlagBitsKHR] = - for value in VkVideoCodecOperationFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoCodecOperationFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoCodecOperationFlagsKHR): bool = cint(a) == cint(b) const VK_VIDEO_CODEC_OPERATION_NONE_KHR* = 0 @@ -3978,12 +3978,12 @@ VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR = 0b00000000000000000000000000000100 VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkVideoChromaSubsamplingFlagBitsKHR]): VkVideoChromaSubsamplingFlagsKHR = - for flag in flags: - result = VkVideoChromaSubsamplingFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoChromaSubsamplingFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoChromaSubsamplingFlagsKHR): seq[VkVideoChromaSubsamplingFlagBitsKHR] = - for value in VkVideoChromaSubsamplingFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoChromaSubsamplingFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoChromaSubsamplingFlagsKHR): bool = cint(a) == cint(b) const VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR* = 0 @@ -3993,12 +3993,12 @@ VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR = 0b00000000000000000000000000000100 VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkVideoComponentBitDepthFlagBitsKHR]): VkVideoComponentBitDepthFlagsKHR = - for flag in flags: - result = VkVideoComponentBitDepthFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoComponentBitDepthFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoComponentBitDepthFlagsKHR): seq[VkVideoComponentBitDepthFlagBitsKHR] = - for value in VkVideoComponentBitDepthFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoComponentBitDepthFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoComponentBitDepthFlagsKHR): bool = cint(a) == cint(b) const VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR* = 0 @@ -4007,35 +4007,35 @@ VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR = 0b00000000000000000000000000000001 VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkVideoCapabilityFlagBitsKHR]): VkVideoCapabilityFlagsKHR = - for flag in flags: - result = VkVideoCapabilityFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoCapabilityFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoCapabilityFlagsKHR): seq[VkVideoCapabilityFlagBitsKHR] = - for value in VkVideoCapabilityFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoCapabilityFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoCapabilityFlagsKHR): bool = cint(a) == cint(b) type VkVideoSessionCreateFlagBitsKHR* {.size: sizeof(cint).} = enum VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkVideoSessionCreateFlagBitsKHR]): VkVideoSessionCreateFlagsKHR = - for flag in flags: - result = VkVideoSessionCreateFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoSessionCreateFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoSessionCreateFlagsKHR): seq[VkVideoSessionCreateFlagBitsKHR] = - for value in VkVideoSessionCreateFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoSessionCreateFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoSessionCreateFlagsKHR): bool = cint(a) == cint(b) type VkVideoDecodeH264PictureLayoutFlagBitsKHR* {.size: sizeof(cint).} = enum VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR = 0b00000000000000000000000000000001 VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkVideoDecodeH264PictureLayoutFlagBitsKHR]): VkVideoDecodeH264PictureLayoutFlagsKHR = - for flag in flags: - result = VkVideoDecodeH264PictureLayoutFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoDecodeH264PictureLayoutFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoDecodeH264PictureLayoutFlagsKHR): seq[VkVideoDecodeH264PictureLayoutFlagBitsKHR] = - for value in VkVideoDecodeH264PictureLayoutFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoDecodeH264PictureLayoutFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoDecodeH264PictureLayoutFlagsKHR): bool = cint(a) == cint(b) const VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR* = 0 @@ -4045,12 +4045,12 @@ VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0b00000000000000000000000000000010 VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_LAYER_BIT_KHR = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoCodingControlFlagBitsKHR]): VkVideoCodingControlFlagsKHR = - for flag in flags: - result = VkVideoCodingControlFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoCodingControlFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoCodingControlFlagsKHR): seq[VkVideoCodingControlFlagBitsKHR] = - for value in VkVideoCodingControlFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoCodingControlFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoCodingControlFlagsKHR): bool = cint(a) == cint(b) type VkQueryResultStatusKHR* {.size: sizeof(cint).} = enum @@ -4062,12 +4062,12 @@ VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR = 0b00000000000000000000000000000010 VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoDecodeUsageFlagBitsKHR]): VkVideoDecodeUsageFlagsKHR = - for flag in flags: - result = VkVideoDecodeUsageFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoDecodeUsageFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoDecodeUsageFlagsKHR): seq[VkVideoDecodeUsageFlagBitsKHR] = - for value in VkVideoDecodeUsageFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoDecodeUsageFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoDecodeUsageFlagsKHR): bool = cint(a) == cint(b) const VK_VIDEO_DECODE_USAGE_DEFAULT_KHR* = 0 @@ -4076,12 +4076,12 @@ VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0b00000000000000000000000000000001 VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0b00000000000000000000000000000010 func toBits*(flags: openArray[VkVideoDecodeCapabilityFlagBitsKHR]): VkVideoDecodeCapabilityFlagsKHR = - for flag in flags: - result = VkVideoDecodeCapabilityFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoDecodeCapabilityFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoDecodeCapabilityFlagsKHR): seq[VkVideoDecodeCapabilityFlagBitsKHR] = - for value in VkVideoDecodeCapabilityFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoDecodeCapabilityFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoDecodeCapabilityFlagsKHR): bool = cint(a) == cint(b) type VkVideoEncodeUsageFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -4090,12 +4090,12 @@ VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0b00000000000000000000000000000100 VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkVideoEncodeUsageFlagBitsKHR]): VkVideoEncodeUsageFlagsKHR = - for flag in flags: - result = VkVideoEncodeUsageFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeUsageFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeUsageFlagsKHR): seq[VkVideoEncodeUsageFlagBitsKHR] = - for value in VkVideoEncodeUsageFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeUsageFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeUsageFlagsKHR): bool = cint(a) == cint(b) const VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR* = 0 @@ -4105,12 +4105,12 @@ VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0b00000000000000000000000000000010 VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoEncodeContentFlagBitsKHR]): VkVideoEncodeContentFlagsKHR = - for flag in flags: - result = VkVideoEncodeContentFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeContentFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeContentFlagsKHR): seq[VkVideoEncodeContentFlagBitsKHR] = - for value in VkVideoEncodeContentFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeContentFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeContentFlagsKHR): bool = cint(a) == cint(b) const VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR* = 0 @@ -4124,12 +4124,12 @@ VkVideoEncodeCapabilityFlagBitsKHR* {.size: sizeof(cint).} = enum VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkVideoEncodeCapabilityFlagBitsKHR]): VkVideoEncodeCapabilityFlagsKHR = - for flag in flags: - result = VkVideoEncodeCapabilityFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeCapabilityFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeCapabilityFlagsKHR): seq[VkVideoEncodeCapabilityFlagBitsKHR] = - for value in VkVideoEncodeCapabilityFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeCapabilityFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeCapabilityFlagsKHR): bool = cint(a) == cint(b) type VkVideoEncodeRateControlModeFlagBitsKHR* {.size: sizeof(cint).} = enum @@ -4137,12 +4137,12 @@ VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0b00000000000000000000000000000010 VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoEncodeRateControlModeFlagBitsKHR]): VkVideoEncodeRateControlModeFlagsKHR = - for flag in flags: - result = VkVideoEncodeRateControlModeFlagsKHR(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeRateControlModeFlagsKHR(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeRateControlModeFlagsKHR): seq[VkVideoEncodeRateControlModeFlagBitsKHR] = - for value in VkVideoEncodeRateControlModeFlagBitsKHR.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeRateControlModeFlagBitsKHR.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeRateControlModeFlagsKHR): bool = cint(a) == cint(b) type VkVideoEncodeH264CapabilityFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4172,12 +4172,12 @@ VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0b00000000100000000000000000000000 VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0b00000001000000000000000000000000 func toBits*(flags: openArray[VkVideoEncodeH264CapabilityFlagBitsEXT]): VkVideoEncodeH264CapabilityFlagsEXT = - for flag in flags: - result = VkVideoEncodeH264CapabilityFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH264CapabilityFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH264CapabilityFlagsEXT): seq[VkVideoEncodeH264CapabilityFlagBitsEXT] = - for value in VkVideoEncodeH264CapabilityFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH264CapabilityFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH264CapabilityFlagsEXT): bool = cint(a) == cint(b) type VkVideoEncodeH264InputModeFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4185,12 +4185,12 @@ VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT = 0b00000000000000000000000000000010 VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoEncodeH264InputModeFlagBitsEXT]): VkVideoEncodeH264InputModeFlagsEXT = - for flag in flags: - result = VkVideoEncodeH264InputModeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH264InputModeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH264InputModeFlagsEXT): seq[VkVideoEncodeH264InputModeFlagBitsEXT] = - for value in VkVideoEncodeH264InputModeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH264InputModeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH264InputModeFlagsEXT): bool = cint(a) == cint(b) type VkVideoEncodeH264OutputModeFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4198,12 +4198,12 @@ VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT = 0b00000000000000000000000000000010 VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoEncodeH264OutputModeFlagBitsEXT]): VkVideoEncodeH264OutputModeFlagsEXT = - for flag in flags: - result = VkVideoEncodeH264OutputModeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH264OutputModeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH264OutputModeFlagsEXT): seq[VkVideoEncodeH264OutputModeFlagBitsEXT] = - for value in VkVideoEncodeH264OutputModeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH264OutputModeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH264OutputModeFlagsEXT): bool = cint(a) == cint(b) type VkVideoEncodeH264RateControlStructureEXT* {.size: sizeof(cint).} = enum @@ -4217,12 +4217,12 @@ VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA = 0b00000000000000000000000000001000 VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkImageConstraintsInfoFlagBitsFUCHSIA]): VkImageConstraintsInfoFlagsFUCHSIA = - for flag in flags: - result = VkImageConstraintsInfoFlagsFUCHSIA(uint(result) or uint(flag)) + for flag in flags: + result = VkImageConstraintsInfoFlagsFUCHSIA(uint(result) or uint(flag)) func toEnums*(number: VkImageConstraintsInfoFlagsFUCHSIA): seq[VkImageConstraintsInfoFlagBitsFUCHSIA] = - for value in VkImageConstraintsInfoFlagBitsFUCHSIA.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkImageConstraintsInfoFlagBitsFUCHSIA.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkImageConstraintsInfoFlagsFUCHSIA): bool = cint(a) == cint(b) type VkFormatFeatureFlagBits2* {.size: 8.} = enum @@ -4272,12 +4272,12 @@ VK_FORMAT_FEATURE_2_RESERVED_44_BIT_EXT = 0b0000000000000000000100000000000000000000000000000000000000000000 VK_FORMAT_FEATURE_2_RESERVED_45_BIT_EXT = 0b0000000000000000001000000000000000000000000000000000000000000000 func toBits*(flags: openArray[VkFormatFeatureFlagBits2]): VkFormatFeatureFlags2 = - for flag in flags: - result = VkFormatFeatureFlags2(uint64(result) or uint64(flag)) + for flag in flags: + result = VkFormatFeatureFlags2(uint64(result) or uint64(flag)) func toEnums*(number: VkFormatFeatureFlags2): seq[VkFormatFeatureFlagBits2] = - for value in VkFormatFeatureFlagBits2.items: - if (cast[uint64](value) and uint64(number)) > 0: - result.add value + for value in VkFormatFeatureFlagBits2.items: + if (cast[uint64](value) and uint64(number)) > 0: + result.add value proc `==`*(a, b: VkFormatFeatureFlags2): bool = uint64(a) == uint64(b) type VkRenderingFlagBits* {.size: sizeof(cint).} = enum @@ -4286,12 +4286,12 @@ VK_RENDERING_RESUMING_BIT = 0b00000000000000000000000000000100 VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkRenderingFlagBits]): VkRenderingFlags = - for flag in flags: - result = VkRenderingFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkRenderingFlags(uint(result) or uint(flag)) func toEnums*(number: VkRenderingFlags): seq[VkRenderingFlagBits] = - for value in VkRenderingFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkRenderingFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkRenderingFlags): bool = cint(a) == cint(b) type VkVideoEncodeH265CapabilityFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4322,12 +4322,12 @@ VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0b00000001000000000000000000000000 VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0b00000010000000000000000000000000 func toBits*(flags: openArray[VkVideoEncodeH265CapabilityFlagBitsEXT]): VkVideoEncodeH265CapabilityFlagsEXT = - for flag in flags: - result = VkVideoEncodeH265CapabilityFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH265CapabilityFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH265CapabilityFlagsEXT): seq[VkVideoEncodeH265CapabilityFlagBitsEXT] = - for value in VkVideoEncodeH265CapabilityFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH265CapabilityFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH265CapabilityFlagsEXT): bool = cint(a) == cint(b) type VkVideoEncodeH265InputModeFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4335,12 +4335,12 @@ VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0b00000000000000000000000000000010 VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoEncodeH265InputModeFlagBitsEXT]): VkVideoEncodeH265InputModeFlagsEXT = - for flag in flags: - result = VkVideoEncodeH265InputModeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH265InputModeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH265InputModeFlagsEXT): seq[VkVideoEncodeH265InputModeFlagBitsEXT] = - for value in VkVideoEncodeH265InputModeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH265InputModeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH265InputModeFlagsEXT): bool = cint(a) == cint(b) type VkVideoEncodeH265OutputModeFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4348,12 +4348,12 @@ VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0b00000000000000000000000000000010 VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoEncodeH265OutputModeFlagBitsEXT]): VkVideoEncodeH265OutputModeFlagsEXT = - for flag in flags: - result = VkVideoEncodeH265OutputModeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH265OutputModeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH265OutputModeFlagsEXT): seq[VkVideoEncodeH265OutputModeFlagBitsEXT] = - for value in VkVideoEncodeH265OutputModeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH265OutputModeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH265OutputModeFlagsEXT): bool = cint(a) == cint(b) type VkVideoEncodeH265RateControlStructureEXT* {.size: sizeof(cint).} = enum @@ -4365,12 +4365,12 @@ VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0b00000000000000000000000000000010 VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkVideoEncodeH265CtbSizeFlagBitsEXT]): VkVideoEncodeH265CtbSizeFlagsEXT = - for flag in flags: - result = VkVideoEncodeH265CtbSizeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH265CtbSizeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH265CtbSizeFlagsEXT): seq[VkVideoEncodeH265CtbSizeFlagBitsEXT] = - for value in VkVideoEncodeH265CtbSizeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH265CtbSizeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH265CtbSizeFlagsEXT): bool = cint(a) == cint(b) type VkVideoEncodeH265TransformBlockSizeFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4379,12 +4379,12 @@ VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0b00000000000000000000000000000100 VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkVideoEncodeH265TransformBlockSizeFlagBitsEXT]): VkVideoEncodeH265TransformBlockSizeFlagsEXT = - for flag in flags: - result = VkVideoEncodeH265TransformBlockSizeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkVideoEncodeH265TransformBlockSizeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkVideoEncodeH265TransformBlockSizeFlagsEXT): seq[VkVideoEncodeH265TransformBlockSizeFlagBitsEXT] = - for value in VkVideoEncodeH265TransformBlockSizeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkVideoEncodeH265TransformBlockSizeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkVideoEncodeH265TransformBlockSizeFlagsEXT): bool = cint(a) == cint(b) type VkExportMetalObjectTypeFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4395,23 +4395,23 @@ VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = 0b00000000000000000000000000010000 VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = 0b00000000000000000000000000100000 func toBits*(flags: openArray[VkExportMetalObjectTypeFlagBitsEXT]): VkExportMetalObjectTypeFlagsEXT = - for flag in flags: - result = VkExportMetalObjectTypeFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkExportMetalObjectTypeFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkExportMetalObjectTypeFlagsEXT): seq[VkExportMetalObjectTypeFlagBitsEXT] = - for value in VkExportMetalObjectTypeFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkExportMetalObjectTypeFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkExportMetalObjectTypeFlagsEXT): bool = cint(a) == cint(b) type VkInstanceCreateFlagBits* {.size: sizeof(cint).} = enum VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkInstanceCreateFlagBits]): VkInstanceCreateFlags = - for flag in flags: - result = VkInstanceCreateFlags(uint(result) or uint(flag)) + for flag in flags: + result = VkInstanceCreateFlags(uint(result) or uint(flag)) func toEnums*(number: VkInstanceCreateFlags): seq[VkInstanceCreateFlagBits] = - for value in VkInstanceCreateFlagBits.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkInstanceCreateFlagBits.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkInstanceCreateFlags): bool = cint(a) == cint(b) type VkImageCompressionFlagBitsEXT* {.size: sizeof(cint).} = enum @@ -4419,12 +4419,12 @@ VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT = 0b00000000000000000000000000000010 VK_IMAGE_COMPRESSION_DISABLED_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkImageCompressionFlagBitsEXT]): VkImageCompressionFlagsEXT = - for flag in flags: - result = VkImageCompressionFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkImageCompressionFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkImageCompressionFlagsEXT): seq[VkImageCompressionFlagBitsEXT] = - for value in VkImageCompressionFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkImageCompressionFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkImageCompressionFlagsEXT): bool = cint(a) == cint(b) const VK_IMAGE_COMPRESSION_DEFAULT_EXT* = 0 @@ -4455,12 +4455,12 @@ VK_IMAGE_COMPRESSION_FIXED_RATE_23BPC_BIT_EXT = 0b00000000010000000000000000000000 VK_IMAGE_COMPRESSION_FIXED_RATE_24BPC_BIT_EXT = 0b00000000100000000000000000000000 func toBits*(flags: openArray[VkImageCompressionFixedRateFlagBitsEXT]): VkImageCompressionFixedRateFlagsEXT = - for flag in flags: - result = VkImageCompressionFixedRateFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkImageCompressionFixedRateFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkImageCompressionFixedRateFlagsEXT): seq[VkImageCompressionFixedRateFlagBitsEXT] = - for value in VkImageCompressionFixedRateFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkImageCompressionFixedRateFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkImageCompressionFixedRateFlagsEXT): bool = cint(a) == cint(b) const VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT* = 0 @@ -4481,12 +4481,12 @@ VK_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV = 0b00000000000000000000000000000100 VK_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV = 0b00000000000000000000000000001000 func toBits*(flags: openArray[VkOpticalFlowGridSizeFlagBitsNV]): VkOpticalFlowGridSizeFlagsNV = - for flag in flags: - result = VkOpticalFlowGridSizeFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkOpticalFlowGridSizeFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkOpticalFlowGridSizeFlagsNV): seq[VkOpticalFlowGridSizeFlagBitsNV] = - for value in VkOpticalFlowGridSizeFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkOpticalFlowGridSizeFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkOpticalFlowGridSizeFlagsNV): bool = cint(a) == cint(b) const VK_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV* = 0 @@ -4498,12 +4498,12 @@ VK_OPTICAL_FLOW_USAGE_COST_BIT_NV = 0b00000000000000000000000000001000 VK_OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkOpticalFlowUsageFlagBitsNV]): VkOpticalFlowUsageFlagsNV = - for flag in flags: - result = VkOpticalFlowUsageFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkOpticalFlowUsageFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkOpticalFlowUsageFlagsNV): seq[VkOpticalFlowUsageFlagBitsNV] = - for value in VkOpticalFlowUsageFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkOpticalFlowUsageFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkOpticalFlowUsageFlagsNV): bool = cint(a) == cint(b) const VK_OPTICAL_FLOW_USAGE_UNKNOWN_NV* = 0 @@ -4530,23 +4530,23 @@ VK_OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV = 0b00000000000000000000000000001000 VK_OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV = 0b00000000000000000000000000010000 func toBits*(flags: openArray[VkOpticalFlowSessionCreateFlagBitsNV]): VkOpticalFlowSessionCreateFlagsNV = - for flag in flags: - result = VkOpticalFlowSessionCreateFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkOpticalFlowSessionCreateFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkOpticalFlowSessionCreateFlagsNV): seq[VkOpticalFlowSessionCreateFlagBitsNV] = - for value in VkOpticalFlowSessionCreateFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkOpticalFlowSessionCreateFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkOpticalFlowSessionCreateFlagsNV): bool = cint(a) == cint(b) type VkOpticalFlowExecuteFlagBitsNV* {.size: sizeof(cint).} = enum VK_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkOpticalFlowExecuteFlagBitsNV]): VkOpticalFlowExecuteFlagsNV = - for flag in flags: - result = VkOpticalFlowExecuteFlagsNV(uint(result) or uint(flag)) + for flag in flags: + result = VkOpticalFlowExecuteFlagsNV(uint(result) or uint(flag)) func toEnums*(number: VkOpticalFlowExecuteFlagsNV): seq[VkOpticalFlowExecuteFlagBitsNV] = - for value in VkOpticalFlowExecuteFlagBitsNV.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkOpticalFlowExecuteFlagBitsNV.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkOpticalFlowExecuteFlagsNV): bool = cint(a) == cint(b) type VkMicromapTypeEXT* {.size: sizeof(cint).} = enum @@ -4556,23 +4556,23 @@ VK_BUILD_MICROMAP_PREFER_FAST_BUILD_BIT_EXT = 0b00000000000000000000000000000010 VK_BUILD_MICROMAP_ALLOW_COMPACTION_BIT_EXT = 0b00000000000000000000000000000100 func toBits*(flags: openArray[VkBuildMicromapFlagBitsEXT]): VkBuildMicromapFlagsEXT = - for flag in flags: - result = VkBuildMicromapFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkBuildMicromapFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkBuildMicromapFlagsEXT): seq[VkBuildMicromapFlagBitsEXT] = - for value in VkBuildMicromapFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkBuildMicromapFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkBuildMicromapFlagsEXT): bool = cint(a) == cint(b) type VkMicromapCreateFlagBitsEXT* {.size: sizeof(cint).} = enum VK_MICROMAP_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000000001 func toBits*(flags: openArray[VkMicromapCreateFlagBitsEXT]): VkMicromapCreateFlagsEXT = - for flag in flags: - result = VkMicromapCreateFlagsEXT(uint(result) or uint(flag)) + for flag in flags: + result = VkMicromapCreateFlagsEXT(uint(result) or uint(flag)) func toEnums*(number: VkMicromapCreateFlagsEXT): seq[VkMicromapCreateFlagBitsEXT] = - for value in VkMicromapCreateFlagBitsEXT.items: - if (value.ord and cint(number)) > 0: - result.add value + for value in VkMicromapCreateFlagBitsEXT.items: + if (value.ord and cint(number)) > 0: + result.add value proc `==`*(a, b: VkMicromapCreateFlagsEXT): bool = cint(a) == cint(b) type VkCopyMicromapModeEXT* {.size: sizeof(cint).} = enum
--- a/semicongine/events.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/events.nim Sat Feb 17 16:37:24 2024 +0700 @@ -13,7 +13,7 @@ A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z Tab, CapsLock, ShiftL, ShiftR, CtrlL, CtrlR, SuperL, SuperR, AltL, AltR, Space, Enter, Backspace - LetterRow1Extra1, LetterRow1Extra2 # open bracket, close brackt, backslash + LetterRow1Extra1, LetterRow1Extra2 # open bracket, close brackt, backslash LetterRow2Extra1, LetterRow2Extra2, LetterRow2Extra3 # semicolon, quote LetterRow3Extra1, LetterRow3Extra2, LetterRow3Extra3 # comma, period, slash Up, Down, Left, Right
--- a/semicongine/mesh.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/mesh.nim Sat Feb 17 16:37:24 2024 +0700 @@ -18,9 +18,9 @@ type MeshIndexType* = enum None - Tiny # up to 2^8 vertices # TODO: need to check and enable support for this + Tiny # up to 2^8 vertices # TODO: need to check and enable support for this Small # up to 2^16 vertices - Big # up to 2^32 vertices + Big # up to 2^32 vertices MeshObject* = object name*: string vertexCount*: int @@ -94,17 +94,17 @@ proc initVertexAttribute*[T](mesh: var MeshObject, attribute: string, value: seq[T]) = assert not mesh.vertexData.contains(attribute) and not mesh.instanceData.contains(attribute) - mesh.vertexData[attribute] = initDataList(thetype=getDataType[T]()) + mesh.vertexData[attribute] = initDataList(thetype = getDataType[T]()) mesh.vertexData[attribute].setLen(mesh.vertexCount) mesh.vertexData[attribute] = value # `=`(mesh.vertexData[attribute], value) proc initVertexAttribute*[T](mesh: var MeshObject, attribute: string, value: T) = initVertexAttribute(mesh, attribute, newSeqWith(mesh.vertexCount, value)) proc initVertexAttribute*[T](mesh: var MeshObject, attribute: string) = - initVertexAttribute(mesh=mesh, attribute=attribute, value=default(T)) + initVertexAttribute(mesh = mesh, attribute = attribute, value = default(T)) proc initVertexAttribute*(mesh: var MeshObject, attribute: string, datatype: DataType) = assert not mesh.vertexData.contains(attribute) and not mesh.instanceData.contains(attribute) - mesh.vertexData[attribute] = initDataList(thetype=datatype) + mesh.vertexData[attribute] = initDataList(thetype = datatype) mesh.vertexData[attribute].setLen(mesh.vertexCount) proc initVertexAttribute*(mesh: var MeshObject, attribute: string, data: DataList) = assert not mesh.vertexData.contains(attribute) and not mesh.instanceData.contains(attribute) @@ -113,16 +113,16 @@ proc initInstanceAttribute*[T](mesh: var MeshObject, attribute: string, value: seq[T]) = assert not mesh.vertexData.contains(attribute) and not mesh.instanceData.contains(attribute) - mesh.instanceData[attribute] = initDataList(thetype=getDataType[T]()) + mesh.instanceData[attribute] = initDataList(thetype = getDataType[T]()) mesh.instanceData[attribute].setLen(mesh.instanceCount) mesh.instanceData[attribute] = value proc initInstanceAttribute*[T](mesh: var MeshObject, attribute: string, value: T) = initInstanceAttribute(mesh, attribute, newSeqWith(mesh.instanceCount, value)) proc initInstanceAttribute*[T](mesh: var MeshObject, attribute: string) = - initInstanceAttribute(mesh=mesh, attribute=attribute, value=default(T)) + initInstanceAttribute(mesh = mesh, attribute = attribute, value = default(T)) proc initInstanceAttribute*(mesh: var MeshObject, attribute: string, datatype: DataType) = assert not mesh.vertexData.contains(attribute) and not mesh.instanceData.contains(attribute) - mesh.instanceData[attribute] = initDataList(thetype=datatype) + mesh.instanceData[attribute] = initDataList(thetype = datatype) mesh.instanceData[attribute].setLen(mesh.instanceCount) proc initInstanceAttribute*(mesh: var MeshObject, attribute: string, data: DataList) = assert not mesh.vertexData.contains(attribute) and not mesh.instanceData.contains(attribute) @@ -131,13 +131,13 @@ proc newMesh*( positions: openArray[Vec3f], indices: openArray[array[3, uint32|uint16|uint8]], - colors: openArray[Vec4f]=[], - uvs: openArray[Vec2f]=[], - transform: Mat4=Unit4F32, - instanceTransforms: openArray[Mat4]=[Unit4F32], - material=EMPTY_MATERIAL.initMaterialData(), - autoResize=true, - name: string="" + colors: openArray[Vec4f] = [], + uvs: openArray[Vec2f] = [], + transform: Mat4 = Unit4F32, + instanceTransforms: openArray[Mat4] = [Unit4F32], + material = EMPTY_MATERIAL.initMaterialData(), + autoResize = true, + name: string = "" ): Mesh = assert colors.len == 0 or colors.len == positions.len assert uvs.len == 0 or uvs.len == positions.len @@ -164,7 +164,7 @@ material: material ) - result[].initVertexAttribute(DEFAULT_POSITION_ATTRIBUTE , positions.toSeq) + result[].initVertexAttribute(DEFAULT_POSITION_ATTRIBUTE, positions.toSeq) if colors.len > 0: result[].initVertexAttribute("color", colors.toSeq) if uvs.len > 0: result[].initVertexAttribute("uv", uvs.toSeq) @@ -187,22 +187,22 @@ proc newMesh*( positions: openArray[Vec3f], - colors: openArray[Vec4f]=[], - uvs: openArray[Vec2f]=[], - transform: Mat4=Unit4F32, - instanceTransforms: openArray[Mat4]=[Unit4F32], - material=EMPTY_MATERIAL.initMaterialData(), - name: string="", + colors: openArray[Vec4f] = [], + uvs: openArray[Vec2f] = [], + transform: Mat4 = Unit4F32, + instanceTransforms: openArray[Mat4] = [Unit4F32], + material = EMPTY_MATERIAL.initMaterialData(), + name: string = "", ): Mesh = newMesh( - positions=positions, - indices=newSeq[array[3, uint16]](), - colors=colors, - uvs=uvs, - transform=transform, - instanceTransforms=instanceTransforms, - material=material, - name=name, + positions = positions, + indices = newSeq[array[3, uint16]](), + colors = colors, + uvs = uvs, + transform = transform, + instanceTransforms = instanceTransforms, + material = material, + name = name, ) func attributeSize*(mesh: MeshObject, attribute: string): int = @@ -385,16 +385,16 @@ else: raise newException(Exception, &"Attribute {attribute} is not defined for mesh {mesh}") -proc applyTransformToVertices*(mesh: var MeshObject, positionAttribute=DEFAULT_POSITION_ATTRIBUTE) = +proc applyTransformToVertices*(mesh: var MeshObject, positionAttribute = DEFAULT_POSITION_ATTRIBUTE) = for i in 0 ..< mesh.vertexData[positionAttribute].len: mesh.vertexData[positionAttribute][i] = mesh.transform * mesh.vertexData[positionAttribute][i, Vec3f] mesh.transform = Unit4 -func getCollisionPoints*(mesh: MeshObject, positionAttribute=DEFAULT_POSITION_ATTRIBUTE): seq[Vec3f] = +func getCollisionPoints*(mesh: MeshObject, positionAttribute = DEFAULT_POSITION_ATTRIBUTE): seq[Vec3f] = for p in mesh[positionAttribute, Vec3f][]: result.add mesh.transform * p -func getCollider*(mesh: MeshObject, positionAttribute=DEFAULT_POSITION_ATTRIBUTE): Collider = +func getCollider*(mesh: MeshObject, positionAttribute = DEFAULT_POSITION_ATTRIBUTE): Collider = return mesh.getCollisionPoints(positionAttribute).calculateCollider(Points) proc asNonIndexedMesh*(mesh: MeshObject): MeshObject = @@ -443,7 +443,7 @@ # GENERATORS ============================================================================ -proc rect*(width=1'f32, height=1'f32, color="ffffffff", material=EMPTY_MATERIAL.initMaterialData()): Mesh = +proc rect*(width = 1'f32, height = 1'f32, color = "ffffffff", material = EMPTY_MATERIAL.initMaterialData()): Mesh = result = Mesh( vertexCount: 4, instanceTransforms: @[Unit4F32], @@ -457,14 +457,14 @@ let half_w = width / 2 half_h = height / 2 - pos = @[newVec3f(-half_w, -half_h), newVec3f( half_w, -half_h), newVec3f( half_w, half_h), newVec3f(-half_w, half_h)] + pos = @[newVec3f(-half_w, -half_h), newVec3f(half_w, -half_h), newVec3f(half_w, half_h), newVec3f(-half_w, half_h)] c = toRGBA(color) result[].initVertexAttribute(DEFAULT_POSITION_ATTRIBUTE, pos) result[].initVertexAttribute("color", @[c, c, c, c]) result[].initVertexAttribute("uv", @[newVec2f(0, 0), newVec2f(1, 0), newVec2f(1, 1), newVec2f(0, 1)]) -proc tri*(width=1'f32, height=1'f32, color="ffffffff", material=EMPTY_MATERIAL.initMaterialData()): Mesh = +proc tri*(width = 1'f32, height = 1'f32, color = "ffffffff", material = EMPTY_MATERIAL.initMaterialData()): Mesh = result = Mesh( vertexCount: 3, instanceTransforms: @[Unit4F32], @@ -477,10 +477,10 @@ half_h = height / 2 colorVec = toRGBA(color) - result[].initVertexAttribute(DEFAULT_POSITION_ATTRIBUTE, @[newVec3f(0, -half_h), newVec3f( half_w, half_h), newVec3f(-half_w, half_h)]) + result[].initVertexAttribute(DEFAULT_POSITION_ATTRIBUTE, @[newVec3f(0, -half_h), newVec3f(half_w, half_h), newVec3f(-half_w, half_h)]) result[].initVertexAttribute("color", @[colorVec, colorVec, colorVec]) -proc circle*(width=1'f32, height=1'f32, nSegments=12, color="ffffffff", material=EMPTY_MATERIAL.initMaterialData()): Mesh = +proc circle*(width = 1'f32, height = 1'f32, nSegments = 12, color = "ffffffff", material = EMPTY_MATERIAL.initMaterialData()): Mesh = assert nSegments >= 3 result = Mesh( vertexCount: 3 + nSegments, @@ -507,8 +507,8 @@ result[].initVertexAttribute(DEFAULT_POSITION_ATTRIBUTE, pos) result[].initVertexAttribute("color", col) -proc grid*(columns, rows: uint16, cellSize=1.0'f32, color="ffffffff", material=EMPTY_MATERIAL.initMaterialData()): Mesh = - +proc grid*(columns, rows: uint16, cellSize = 1.0'f32, color = "ffffffff", material = EMPTY_MATERIAL.initMaterialData()): Mesh = + result = Mesh( vertexCount: int((rows + 1) * (columns + 1)), instanceTransforms: @[Unit4F32], @@ -547,7 +547,7 @@ transform*: Mat4 = Unit4F32 children*: seq[MeshTree] -func toStringRec*(tree: MeshTree, theindent=0): seq[string] = +func toStringRec*(tree: MeshTree, theindent = 0): seq[string] = if tree.mesh.isNil: result.add "*" else: @@ -567,7 +567,7 @@ result.add current.mesh queue.add current.children -proc updateTransforms*(tree: MeshTree, parentTransform=Unit4F32) = +proc updateTransforms*(tree: MeshTree, parentTransform = Unit4F32) = let currentTransform = parentTransform * tree.transform if not tree.mesh.isNil: tree.mesh.transform = currentTransform
--- a/semicongine/resources/audio.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/resources/audio.nim Sat Feb 17 16:37:24 2024 +0700 @@ -59,7 +59,7 @@ while not stream.atEnd(): result[].add stream.readSample(header.encoding, int(header.channels)) -{.compile: currentSourcePath.parentDir() & "/stb_vorbis.c" .} +{.compile: currentSourcePath.parentDir() & "/stb_vorbis.c".} proc stb_vorbis_decode_memory(mem: pointer, len: cint, channels: ptr cint, sample_rate: ptr cint, output: ptr ptr cshort): cint {.importc.} proc free(p: pointer) {.importc.}
--- a/semicongine/resources/image.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/resources/image.nim Sat Feb 17 16:37:24 2024 +0700 @@ -24,20 +24,20 @@ colorPlanes: uint16 bitsPerPixel: uint16 compression: uint32 - imageDataSize: uint32 # unused - resolutionX: int32 # unused - resolutionY: int32 # unused - nColors: uint32 # unused - nImportantColors: uint32 # unused + imageDataSize: uint32 # unused + resolutionX: int32 # unused + resolutionY: int32 # unused + nColors: uint32 # unused + nImportantColors: uint32 # unused bitMaskRed: uint32 bitMaskGreen: uint32 bitMaskBlue: uint32 bitMaskAlpha: uint32 - colorSpace: array[4, char] # not used yet + colorSpace: array[4, char] # not used yet colorSpaceEndpoints: array[36, uint8] # unused - gammaRed: uint32 # not used yet - gammaGreen: uint32 # not used yet - gammaBlue: uint32 # not used yet + gammaRed: uint32 # not used yet + gammaGreen: uint32 # not used yet + gammaBlue: uint32 # not used yet proc readBMP*(stream: Stream): Image[RGBAPixel] = var @@ -101,12 +101,12 @@ # determine whether we read top-to-bottom or bottom-to-top var row_mult: int = (if dibHeader.height < 0: row else: dibHeader.height - row - 1) - data[row_mult * dibHeader.width + col]= pixel + data[row_mult * dibHeader.width + col] = pixel stream.setPosition(stream.getPosition() + padding) - result = newImage(width=dibHeader.width, height=abs(dibHeader.height), imagedata=data) + result = newImage(width = dibHeader.width, height = abs(dibHeader.height), imagedata = data) -{.compile: currentSourcePath.parentDir() & "/lodepng.c" .} +{.compile: currentSourcePath.parentDir() & "/lodepng.c".} proc lodepng_decode32(out_data: ptr cstring, w: ptr cuint, h: ptr cuint, in_data: cstring, insize: csize_t): cuint {.importc.} proc lodepng_encode_memory(out_data: ptr cstring, outsize: ptr csize_t, image: cstring, w: cuint, h: cuint, colorType: cint, bitdepth: cuint): cuint {.importc.} @@ -118,7 +118,7 @@ var w, h: cuint var data: cstring - if lodepng_decode32(out_data=addr data, w=addr w, h=addr h, in_data=cstring(indata), insize=csize_t(indata.len)) != 0: + if lodepng_decode32(out_data = addr data, w = addr w, h = addr h, in_data = cstring(indata), insize = csize_t(indata.len)) != 0: raise newException(Exception, "An error occured while loading PNG file") let imagesize = w * h * 4 @@ -127,7 +127,7 @@ free(data) - result = newImage(width=int(w), height=int(h), imagedata=imagedata) + result = newImage(width = int(w), height = int(h), imagedata = imagedata) proc toPNG*[T: Pixel](image: Image[T]): seq[uint8] = when T is GrayPixel: @@ -135,7 +135,7 @@ else: let pngType = 6 # hardcoded in lodepng.h var - pngData: cstring + pngData: cstring pngSize: csize_t for y in 0 ..< image.height: for x in 0 ..< image.width: @@ -159,7 +159,7 @@ free(pngData) proc writePNG*[T: Pixel](image: Image[T], filename: string) = - let f = filename.open(mode=fmWrite) + let f = filename.open(mode = fmWrite) let data = image.toPNG() let written = f.writeBytes(data, 0, data.len) assert written == data.len, &"There was an error while saving '{filename}': only {written} of {data.len} bytes were written"
--- a/semicongine/settings.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/settings.nim Sat Feb 17 16:37:24 2024 +0700 @@ -32,7 +32,7 @@ joinPath(configRoot(), namespace & "." & CONFIGEXTENSION) iterator walkConfigNamespaces(): string = - for file in walkDirRec(dir=configRoot(), relative=true, checkDir=true): + for file in walkDirRec(dir = configRoot(), relative = true, checkDir = true): if file.endsWith("." & CONFIGEXTENSION): yield file[0 ..< ^(CONFIGEXTENSION.len + 1)]
--- a/semicongine/vulkan/buffer.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/buffer.nim Sat Feb 17 16:37:24 2024 +0700 @@ -46,9 +46,9 @@ let requirements = buffer.requirements() let memoryType = requirements.memoryTypes.selectBestMemoryType( - requireMappable=requireMappable, - preferVRAM=preferVRAM, - preferAutoFlush=preferAutoFlush + requireMappable = requireMappable, + preferVRAM = preferVRAM, + preferAutoFlush = preferAutoFlush ) debug "Allocating memory for buffer: ", buffer.size, " bytes of type ", memoryType @@ -71,7 +71,7 @@ usage: openArray[VkBufferUsageFlagBits], requireMappable: bool, preferVRAM: bool, - preferAutoFlush=true, + preferAutoFlush = true, ): Buffer = assert device.vk.valid assert size > 0 @@ -90,15 +90,15 @@ ) checkVkResult vkCreateBuffer( - device=device.vk, - pCreateInfo=addr createInfo, - pAllocator=nil, - pBuffer=addr result.vk + device = device.vk, + pCreateInfo = addr createInfo, + pAllocator = nil, + pBuffer = addr result.vk ) - result.allocateMemory(requireMappable=requireMappable, preferVRAM=preferVRAM, preferAutoFlush=preferAutoFlush) + result.allocateMemory(requireMappable = requireMappable, preferVRAM = preferVRAM, preferAutoFlush = preferAutoFlush) -proc copy*(src, dst: Buffer, dstOffset=0) = +proc copy*(src, dst: Buffer, dstOffset = 0) = assert src.device.vk.valid assert dst.device.vk.valid assert src.device == dst.device @@ -126,21 +126,21 @@ ) buffer.vk.reset -proc setData*(dst: Buffer, src: pointer, size: int, bufferOffset=0) = +proc setData*(dst: Buffer, src: pointer, size: int, bufferOffset = 0) = assert bufferOffset + size <= dst.size if dst.memory.canMap: copyMem(cast[pointer](cast[int](dst.memory.data) + bufferOffset), src, size) if dst.memory.needsFlushing: dst.memory.flush() else: # use staging buffer, slower but required if memory is not host visible - var stagingBuffer = dst.device.createBuffer(size, [VK_BUFFER_USAGE_TRANSFER_SRC_BIT], requireMappable=true, preferVRAM=false, preferAutoFlush=true) + var stagingBuffer = dst.device.createBuffer(size, [VK_BUFFER_USAGE_TRANSFER_SRC_BIT], requireMappable = true, preferVRAM = false, preferAutoFlush = true) setData(stagingBuffer, src, size, 0) stagingBuffer.copy(dst, bufferOffset) stagingBuffer.destroy() -proc setData*[T: seq](dst: Buffer, src: ptr T, offset=0'u64) = - dst.setData(src, sizeof(get(genericParams(T), 0)) * src[].len, offset=offset) +proc setData*[T: seq](dst: Buffer, src: ptr T, offset = 0'u64) = + dst.setData(src, sizeof(get(genericParams(T), 0)) * src[].len, offset = offset) -proc setData*[T](dst: Buffer, src: ptr T, offset=0'u64) = - dst.setData(src, sizeof(T), offset=offset) +proc setData*[T](dst: Buffer, src: ptr T, offset = 0'u64) = + dst.setData(src, sizeof(T), offset = offset)
--- a/semicongine/vulkan/descriptor.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/descriptor.nim Sat Feb 17 16:37:24 2024 +0700 @@ -28,10 +28,10 @@ device: Device vk*: VkDescriptorSetLayout descriptors*: seq[Descriptor] - DescriptorPool* = object # required for allocation of DescriptorSet + DescriptorPool* = object # required for allocation of DescriptorSet device: Device vk*: VkDescriptorPool - maxSets*: int # maximum number of allocatable descriptor sets + maxSets*: int # maximum number of allocatable descriptor sets counts*: seq[(VkDescriptorType, int)] # maximum number for each descriptor type to allocate const DESCRIPTOR_TYPE_MAP = { @@ -121,7 +121,7 @@ for descriptorSet in descriptorSets: result.add DescriptorSet(vk: descriptorSet, layout: layout) -proc writeDescriptorSet*(descriptorSet: DescriptorSet, bindingBase=0'u32) = +proc writeDescriptorSet*(descriptorSet: DescriptorSet, bindingBase = 0'u32) = # assumes descriptors of the descriptorSet are arranged interleaved in buffer assert descriptorSet.layout.device.vk.valid assert descriptorSet.layout.vk.valid @@ -131,7 +131,7 @@ var bufferInfos: seq[VkDescriptorBufferInfo] var i = bindingBase - # need to keep this sequence out of the loop, otherwise it will be + # need to keep this sequence out of the loop, otherwise it will be # gc-ed before the final update call and pointers are invalid :( var imgInfos: seq[seq[VkDescriptorImageInfo]] for descriptor in descriptorSet.layout.descriptors:
--- a/semicongine/vulkan/device.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/device.nim Sat Feb 17 16:37:24 2024 +0700 @@ -51,7 +51,7 @@ var queueList = deviceQueues.values.toSeq var uniformBufferLayoutFeature = VkPhysicalDeviceUniformBufferStandardLayoutFeatures( - stype:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES, + stype: VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES, uniformBufferStandardLayout: true, ) var features2 = VkPhysicalDeviceFeatures2( @@ -72,10 +72,10 @@ ) checkVkResult vkCreateDevice( - physicalDevice=physicalDevice.vk, - pCreateInfo=addr createInfo, - pAllocator=nil, - pDevice=addr result.vk + physicalDevice = physicalDevice.vk, + pCreateInfo = addr createInfo, + pAllocator = nil, + pDevice = addr result.vk ) deallocCStringArray(enabledLayersC) deallocCStringArray(enabledExtensionsC)
--- a/semicongine/vulkan/drawable.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/drawable.nim Sat Feb 17 16:37:24 2024 +0700 @@ -8,9 +8,9 @@ type Drawable* = object name*: string - elementCount*: int # number of vertices or indices + 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 + instanceCount*: int # number of instance case indexed*: bool of true: indexType*: VkIndexType @@ -25,35 +25,35 @@ &"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 + debug "Draw ", drawable - var buffers: seq[VkBuffer] - var offsets: seq[VkDeviceSize] + var buffers: seq[VkBuffer] + var offsets: seq[VkDeviceSize] - for (name, performanceHint, offset) in drawable.bufferOffsets[pipeline]: - buffers.add vertexBuffers[performanceHint].vk - offsets.add VkDeviceSize(offset) + for (name, performanceHint, offset) in drawable.bufferOffsets[pipeline]: + buffers.add vertexBuffers[performanceHint].vk + offsets.add VkDeviceSize(offset) - commandBuffer.vkCmdBindVertexBuffers( - firstBinding=0'u32, - bindingCount=uint32(buffers.len), - pBuffers=buffers.toCPointer(), - pOffsets=offsets.toCPointer() + commandBuffer.vkCmdBindVertexBuffers( + firstBinding = 0'u32, + bindingCount = uint32(buffers.len), + pBuffers = buffers.toCPointer(), + pOffsets = offsets.toCPointer() + ) + if drawable.indexed: + commandBuffer.vkCmdBindIndexBuffer(indexBuffer.vk, VkDeviceSize(drawable.indexBufferOffset), drawable.indexType) + commandBuffer.vkCmdDrawIndexed( + indexCount = uint32(drawable.elementCount), + instanceCount = uint32(drawable.instanceCount), + firstIndex = 0, + vertexOffset = 0, + firstInstance = 0 ) - if drawable.indexed: - commandBuffer.vkCmdBindIndexBuffer(indexBuffer.vk, VkDeviceSize(drawable.indexBufferOffset), drawable.indexType) - commandBuffer.vkCmdDrawIndexed( - indexCount=uint32(drawable.elementCount), - instanceCount=uint32(drawable.instanceCount), - firstIndex=0, - vertexOffset=0, - firstInstance=0 - ) - else: - commandBuffer.vkCmdDraw( - vertexCount=uint32(drawable.elementCount), - instanceCount=uint32(drawable.instanceCount), - firstVertex=0, - firstInstance=0 - ) + else: + commandBuffer.vkCmdDraw( + vertexCount = uint32(drawable.elementCount), + instanceCount = uint32(drawable.instanceCount), + firstVertex = 0, + firstInstance = 0 + )
--- a/semicongine/vulkan/image.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/image.nim Sat Feb 17 16:37:24 2024 +0700 @@ -14,7 +14,7 @@ VulkanImage* = object device*: Device vk*: VkImage - width*: int # pixel + width*: int # pixel height*: int # pixel depth*: PixelDepth format*: VkFormat @@ -60,9 +60,9 @@ let requirements = image.requirements() let memoryType = requirements.memoryTypes.selectBestMemoryType( - requireMappable=requireMappable, - preferVRAM=preferVRAM, - preferAutoFlush=preferAutoFlush + requireMappable = requireMappable, + preferVRAM = preferVRAM, + preferAutoFlush = preferAutoFlush ) debug "Allocating memory for image: ", image.width, "x", image.height, "x", image.depth, ", ", requirements.size, " bytes of type ", memoryType @@ -103,10 +103,10 @@ sourceStage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT destinationStage = VK_PIPELINE_STAGE_TRANSFER_BIT elif oldLayout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL and newLayout == VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: - barrier.srcAccessMask = toBits [VK_ACCESS_TRANSFER_WRITE_BIT] - barrier.dstAccessMask = toBits [VK_ACCESS_SHADER_READ_BIT] - sourceStage = VK_PIPELINE_STAGE_TRANSFER_BIT - destinationStage = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT + barrier.srcAccessMask = toBits [VK_ACCESS_TRANSFER_WRITE_BIT] + barrier.dstAccessMask = toBits [VK_ACCESS_SHADER_READ_BIT] + sourceStage = VK_PIPELINE_STAGE_TRANSFER_BIT + destinationStage = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT else: raise newException(Exception, "Unsupported layout transition!") @@ -179,11 +179,11 @@ samples: VK_SAMPLE_COUNT_1_BIT, ) checkVkResult device.vk.vkCreateImage(addr imageInfo, nil, addr result.vk) - result.allocateMemory(requireMappable=false, preferVRAM=true, preferAutoFlush=false) + result.allocateMemory(requireMappable = false, preferVRAM = true, preferAutoFlush = false) result.transitionImageLayout(VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) - var stagingBuffer = device.createBuffer(size=size, usage=[VK_BUFFER_USAGE_TRANSFER_SRC_BIT], requireMappable=true, preferVRAM=false, preferAutoFlush=true) - stagingBuffer.setData(src=data, size=size) + var stagingBuffer = device.createBuffer(size = size, usage = [VK_BUFFER_USAGE_TRANSFER_SRC_BIT], requireMappable = true, preferVRAM = false, preferAutoFlush = true) + stagingBuffer.setData(src = data, size = size) stagingBuffer.copy(result) result.transitionImageLayout(VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) stagingBuffer.destroy() @@ -238,11 +238,11 @@ proc createImageView*( image: VulkanImage, - imageviewtype=VK_IMAGE_VIEW_TYPE_2D, - baseMipLevel=0'u32, - levelCount=1'u32, - baseArrayLayer=0'u32, - layerCount=1'u32 + imageviewtype = VK_IMAGE_VIEW_TYPE_2D, + baseMipLevel = 0'u32, + levelCount = 1'u32, + baseArrayLayer = 0'u32, + layerCount = 1'u32 ): ImageView = assert image.device.vk.valid assert image.vk.valid @@ -282,9 +282,9 @@ proc uploadTexture*(device: Device, texture: Texture): VulkanTexture = assert device.vk.valid if texture.isGrayscale: - result.image = createImage(device=device, width=texture.grayImage.width, height=texture.grayImage.height, depth=1, data=addr texture.grayImage.imagedata[0]) + result.image = createImage(device = device, width = texture.grayImage.width, height = texture.grayImage.height, depth = 1, data = addr texture.grayImage.imagedata[0]) else: - result.image = createImage(device=device, width=texture.colorImage.width, height=texture.colorImage.height, depth=4, data=addr texture.colorImage.imagedata[0][0]) + result.image = createImage(device = device, width = texture.colorImage.width, height = texture.colorImage.height, depth = 4, data = addr texture.colorImage.imagedata[0][0]) result.imageView = result.image.createImageView() result.sampler = result.image.device.createSampler(texture.sampler)
--- a/semicongine/vulkan/instance.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/instance.nim Sat Feb 17 16:37:24 2024 +0700 @@ -117,7 +117,7 @@ instance: Instance, severityLevels: openArray[VkDebugUtilsMessageSeverityFlagBitsEXT] = @[], types: openArray[VkDebugUtilsMessageTypeFlagBitsEXT] = @[], - callback: DebugCallback=defaultDebugCallback + callback: DebugCallback = defaultDebugCallback ): Debugger = assert instance.vk.valid result.instance = instance
--- a/semicongine/vulkan/memory.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/memory.nim Sat Feb 17 16:37:24 2024 +0700 @@ -91,15 +91,15 @@ if result.canMap: checkVkResult result.device.vk.vkMapMemory( - memory=result.vk, - offset=VkDeviceSize(0), - size=VkDeviceSize(result.size), - flags=VkMemoryMapFlags(0), # unused up to Vulkan 1.3 - ppData=addr(result.data) + memory = result.vk, + offset = VkDeviceSize(0), + size = VkDeviceSize(result.size), + flags = VkMemoryMapFlags(0), # unused up to Vulkan 1.3 + ppData = addr(result.data) ) # flush host -> device -proc flush*(memory: DeviceMemory, offset=0'u64, size=0'u64) = +proc flush*(memory: DeviceMemory, offset = 0'u64, size = 0'u64) = assert memory.device.vk.valid assert memory.vk.valid assert memory.needsFlushing @@ -113,10 +113,10 @@ offset: VkDeviceSize(offset), size: VkDeviceSize(size) ) - checkVkResult memory.device.vk.vkFlushMappedMemoryRanges(memoryRangeCount=1, pMemoryRanges=addr(flushrange)) + checkVkResult memory.device.vk.vkFlushMappedMemoryRanges(memoryRangeCount = 1, pMemoryRanges = addr(flushrange)) # flush device -> host -proc invalidate*(memory: DeviceMemory, offset=0'u64, size=0'u64) = +proc invalidate*(memory: DeviceMemory, offset = 0'u64, size = 0'u64) = assert memory.device.vk.valid assert memory.vk.valid assert memory.needsFlushing @@ -130,7 +130,7 @@ offset: VkDeviceSize(offset), size: VkDeviceSize(size) ) - checkVkResult memory.device.vk.vkInvalidateMappedMemoryRanges(memoryRangeCount=1, pMemoryRanges=addr(flushrange)) + checkVkResult memory.device.vk.vkInvalidateMappedMemoryRanges(memoryRangeCount = 1, pMemoryRanges = addr(flushrange)) proc free*(memory: var DeviceMemory) = assert memory.device.vk.valid
--- a/semicongine/vulkan/physicaldevice.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/physicaldevice.nim Sat Feb 17 16:37:24 2024 +0700 @@ -88,7 +88,7 @@ var nQueuefamilies: uint32 vkGetPhysicalDeviceQueueFamilyProperties(device.vk, addr nQueuefamilies, nil) var queuFamilies = newSeq[VkQueueFamilyProperties](nQueuefamilies) - vkGetPhysicalDeviceQueueFamilyProperties(device.vk, addr nQueuefamilies , queuFamilies.toCPointer) + vkGetPhysicalDeviceQueueFamilyProperties(device.vk, addr nQueuefamilies, queuFamilies.toCPointer) for i in 0 ..< nQueuefamilies: result.add QueueFamily( device: device,
--- a/semicongine/vulkan/pipeline.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/pipeline.nim Sat Feb 17 16:37:24 2024 +0700 @@ -32,7 +32,7 @@ assert buffers.len == 0 or buffers.len == inFlightFrames # need to guard against this in case we have no uniforms, then we also create no buffers result = descriptorPool.allocateDescriptorSet(pipeline.descriptorSetLayout, inFlightFrames) - + for i in 0 ..< inFlightFrames: var offset = 0 # first descriptor is always uniform for globals, match should be better somehow @@ -55,14 +55,14 @@ descriptor.imageviews.add emptyTexture.imageView descriptor.samplers.add emptyTexture.sampler -proc createPipeline*(device: Device, renderPass: VkRenderPass, shaderConfiguration: ShaderConfiguration, inFlightFrames: int, subpass = 0'u32, backFaceCulling=true): ShaderPipeline = +proc createPipeline*(device: Device, renderPass: VkRenderPass, shaderConfiguration: ShaderConfiguration, inFlightFrames: int, subpass = 0'u32, backFaceCulling = true): ShaderPipeline = assert renderPass.valid assert device.vk.valid result.device = device result.shaderModules = device.createShaderModules(shaderConfiguration) result.shaderConfiguration = shaderConfiguration - + var descriptors: seq[Descriptor] if result.shaderConfiguration.uniforms.len > 0: descriptors.add Descriptor( @@ -94,7 +94,7 @@ setLayoutCount: uint32(descriptorSetLayouts.len), pSetLayouts: descriptorSetLayouts.toCPointer, # pushConstantRangeCount: uint32(pushConstants.len), - # pPushConstantRanges: pushConstants.toCPointer, + # pPushConstantRanges: pushConstants.toCPointer, ) checkVkResult vkCreatePipelineLayout(device.vk, addr(pipelineLayoutInfo), nil, addr(result.layout))
--- a/semicongine/vulkan/platform/sci.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/platform/sci.nim Sat Feb 17 16:37:24 2024 +0700 @@ -89,4 +89,4 @@ NvSciSyncObj *{.header: "nvscisync.h".} = object NvSciSyncFence *{.header: "nvscisync.h".} = object NvSciBufAttrList *{.header: "nvscibuf.h".} = object - NvSciBufObj *{.header: "nvscibuf.h".} = object \ No newline at end of file + NvSciBufObj *{.header: "nvscibuf.h".} = object
--- a/semicongine/vulkan/renderpass.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/renderpass.nim Sat Feb 17 16:37:24 2024 +0700 @@ -63,9 +63,9 @@ proc simpleForwardRenderPass*( device: Device, shaders: openArray[(MaterialType, ShaderConfiguration)], - inFlightFrames=2, - clearColor=Vec4f([0.8'f32, 0.8'f32, 0.8'f32, 1'f32]), - backFaceCulling=true, + inFlightFrames = 2, + clearColor = Vec4f([0.8'f32, 0.8'f32, 0.8'f32, 1'f32]), + backFaceCulling = true, ): RenderPass = assert device.vk.valid for (_, shaderconfig) in shaders: @@ -97,9 +97,9 @@ dstStageMask: toBits [VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT], dstAccessMask: toBits [VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT], )] - result = device.createRenderPass(attachments=attachments, subpasses=subpasses, dependencies=dependencies) + result = device.createRenderPass(attachments = attachments, subpasses = subpasses, dependencies = dependencies) for (materialtype, shaderconfig) in shaders: - result.subpasses[0].shaderPipelines.add (materialtype, device.createPipeline(result.vk, shaderconfig, inFlightFrames, 0, backFaceCulling=backFaceCulling)) + result.subpasses[0].shaderPipelines.add (materialtype, device.createPipeline(result.vk, shaderconfig, inFlightFrames, 0, backFaceCulling = backFaceCulling)) proc beginRenderCommands*(commandBuffer: VkCommandBuffer, renderpass: RenderPass, framebuffer: Framebuffer) = @@ -144,8 +144,8 @@ checkVkResult commandBuffer.vkResetCommandBuffer(VkCommandBufferResetFlags(0)) checkVkResult commandBuffer.vkBeginCommandBuffer(addr(beginInfo)) commandBuffer.vkCmdBeginRenderPass(addr(renderPassInfo), VK_SUBPASS_CONTENTS_INLINE) - commandBuffer.vkCmdSetViewport(firstViewport=0, viewportCount=1, addr(viewport)) - commandBuffer.vkCmdSetScissor(firstScissor=0, scissorCount=1, addr(scissor)) + commandBuffer.vkCmdSetViewport(firstViewport = 0, viewportCount = 1, addr(viewport)) + commandBuffer.vkCmdSetScissor(firstScissor = 0, scissorCount = 1, addr(scissor)) proc endRenderCommands*(commandBuffer: VkCommandBuffer) = commandBuffer.vkCmdEndRenderPass()
--- a/semicongine/vulkan/shader.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/shader.nim Sat Feb 17 16:37:24 2024 +0700 @@ -84,19 +84,19 @@ proc compileGlslCode*( stage: VkShaderStageFlagBits, - inputs: openArray[ShaderAttribute]=[], - uniforms: openArray[ShaderAttribute]=[], - samplers: openArray[ShaderAttribute]=[], - outputs: openArray[ShaderAttribute]=[], - version=DEFAULT_SHADER_VERSION , - entrypoint=DEFAULT_SHADER_ENTRYPOINT , + inputs: openArray[ShaderAttribute] = [], + uniforms: openArray[ShaderAttribute] = [], + samplers: openArray[ShaderAttribute] = [], + outputs: openArray[ShaderAttribute] = [], + version = DEFAULT_SHADER_VERSION, + entrypoint = DEFAULT_SHADER_ENTRYPOINT, main: string ): seq[uint32] {.compileTime.} = let code = @[&"#version {version}", "#extension GL_EXT_scalar_block_layout : require", ""] & (if inputs.len > 0: inputs.glslInput() & @[""] else: @[]) & - (if uniforms.len > 0: uniforms.glslUniforms(binding=0) & @[""] else: @[]) & - (if samplers.len > 0: samplers.glslSamplers(basebinding=if uniforms.len > 0: 1 else: 0) & @[""] else: @[]) & + (if uniforms.len > 0: uniforms.glslUniforms(binding = 0) & @[""] else: @[]) & + (if samplers.len > 0: samplers.glslSamplers(basebinding = if uniforms.len > 0: 1 else: 0) & @[""] else: @[]) & (if outputs.len > 0: outputs.glslOutput() & @[""] else: @[]) & @[&"void {entrypoint}(){{"] & main & @@ -104,32 +104,32 @@ compileGlslToSPIRV(stage, code.join("\n"), entrypoint) proc createShaderConfiguration*( - inputs: openArray[ShaderAttribute]=[], - intermediates: openArray[ShaderAttribute]=[], - outputs: openArray[ShaderAttribute]=[], - uniforms: openArray[ShaderAttribute]=[], - samplers: openArray[ShaderAttribute]=[], - version=DEFAULT_SHADER_VERSION , - entrypoint=DEFAULT_SHADER_ENTRYPOINT , + inputs: openArray[ShaderAttribute] = [], + intermediates: openArray[ShaderAttribute] = [], + outputs: openArray[ShaderAttribute] = [], + uniforms: openArray[ShaderAttribute] = [], + samplers: openArray[ShaderAttribute] = [], + version = DEFAULT_SHADER_VERSION, + entrypoint = DEFAULT_SHADER_ENTRYPOINT, vertexCode: string, fragmentCode: string, ): ShaderConfiguration {.compileTime.} = ShaderConfiguration( vertexBinary: compileGlslCode( - stage=VK_SHADER_STAGE_VERTEX_BIT, - inputs=inputs, - outputs=intermediates, - uniforms=uniforms, - samplers=samplers, - main=vertexCode, + stage = VK_SHADER_STAGE_VERTEX_BIT, + inputs = inputs, + outputs = intermediates, + uniforms = uniforms, + samplers = samplers, + main = vertexCode, ), fragmentBinary: compileGlslCode( - stage=VK_SHADER_STAGE_FRAGMENT_BIT, - inputs=intermediates, - outputs=outputs, - uniforms=uniforms, - samplers=samplers, - main=fragmentCode, + stage = VK_SHADER_STAGE_FRAGMENT_BIT, + inputs = intermediates, + outputs = outputs, + uniforms = uniforms, + samplers = samplers, + main = fragmentCode, ), entrypoint: entrypoint, inputs: @inputs, @@ -172,7 +172,7 @@ shaderConfiguration: ShaderConfiguration, bindings: var seq[VkVertexInputBindingDescription], attributes: var seq[VkVertexInputAttributeDescription], - baseBinding=0'u32 + baseBinding = 0'u32 ): VkPipelineVertexInputStateCreateInfo = var location = 0'u32 var binding = baseBinding @@ -189,7 +189,7 @@ binding: binding, location: location, format: attribute.thetype.getVkFormat, - offset: uint32(i * attribute.size(perDescriptor=true)), + offset: uint32(i * attribute.size(perDescriptor = true)), ) location += uint32(attribute.thetype.nLocationSlots) inc binding
--- a/semicongine/vulkan/swapchain.nim Sat Feb 17 16:31:54 2024 +0700 +++ b/semicongine/vulkan/swapchain.nim Sat Feb 17 16:37:24 2024 +0700 @@ -39,10 +39,10 @@ renderPass: VkRenderPass, surfaceFormat: VkSurfaceFormatKHR, queueFamily: QueueFamily, - desiredNumberOfImages=3'u32, - preferedPresentMode: VkPresentModeKHR=VK_PRESENT_MODE_MAILBOX_KHR, - inFlightFrames=2, - oldSwapchain=VkSwapchainKHR(0) + desiredNumberOfImages = 3'u32, + preferedPresentMode: VkPresentModeKHR = VK_PRESENT_MODE_MAILBOX_KHR, + inFlightFrames = 2, + oldSwapchain = VkSwapchainKHR(0) ): Option[Swapchain] = assert device.vk.valid assert device.physicalDevice.vk.valid @@ -221,11 +221,11 @@ assert swapchain.vk.valid assert swapchain.device.vk.valid result = createSwapchain( - device=swapchain.device, - renderPass=swapchain.renderPass, - surfaceFormat=swapchain.surfaceFormat, - queueFamily=swapchain.queueFamily, - desiredNumberOfImages=swapchain.imageCount, - inFlightFrames=swapchain.inFlightFrames, - oldSwapchain=swapchain.vk, + device = swapchain.device, + renderPass = swapchain.renderPass, + surfaceFormat = swapchain.surfaceFormat, + queueFamily = swapchain.queueFamily, + desiredNumberOfImages = swapchain.imageCount, + inFlightFrames = swapchain.inFlightFrames, + oldSwapchain = swapchain.vk, )