# HG changeset patch # User sam # Date 1726071968 -25200 # Node ID 7b8a6b5e9a4648fb3663ef4cb1bfdbfa90a1b6c1 # Parent 6646270a6032eb20dfaf7b637e5b034592b04a21 add: more generic way to index gpu array diff -r 6646270a6032 -r 7b8a6b5e9a46 semicongine/rendering.nim --- a/semicongine/rendering.nim Sat Sep 07 22:56:10 2024 +0700 +++ b/semicongine/rendering.nim Wed Sep 11 23:26:08 2024 +0700 @@ -178,10 +178,10 @@ proc `=copy`[T](dest: var Pipeline[T], source: Pipeline[T]) {.error.} proc `=copy`[T](dest: var DescriptorSetData[T], source: DescriptorSetData[T]) {.error.} -proc `[]`*[T, S](a: GPUArray[T, S], i: int): T = +proc `[]`*[T, S](a: GPUArray[T, S], i: SomeInteger): T = a.data[i] -proc `[]=`*[T, S](a: var GPUArray[T, S], i: int, value: T) = +proc `[]=`*[T, S](a: var GPUArray[T, S], i: SomeInteger, value: T) = a.data[i] = value template forDescriptorFields(