@@ -63,20 +63,21 @@ public extension Compute{
6363 c. buffers. append ( buf)
6464 return c
6565 }
66- func buffer< T> ( _ container: MTLBufferContainer < T > , offset: Int = 0 , argument: MetalBufferArgument ) -> Compute {
66+ func buffer< T> ( _ container: MTLBufferContainer < T > , offset: Int = 0 , argument: MetalBufferArgument , fitThreads : Bool = false ) -> Compute {
6767 var c = self
6868 var argument = argument
6969 argument. index = checkBufferIndex ( c: & c, index: argument. index)
7070 c. kernelArguments. append ( . buffer( argument) )
7171 let buf = Buffer ( container: container, offset: offset, index: argument. index!)
7272 c. buffers. append ( buf)
73+ c. gridFit = . buffer( argument. index!)
7374 return c
7475 }
7576 func buffer< T> ( _ container: MTLBufferContainer < T > , offset: Int = 0 ,
76- space: String = " constant " , type: String ? = nil , name: String ? = nil ) -> Compute {
77+ space: String = " constant " , type: String ? = nil , name: String ? = nil , fitThreads : Bool = false ) -> Compute {
7778
7879 let argument = try ! MetalBufferArgument ( container, space: space, type: type, name: name)
79- return self . buffer ( container, offset: offset, argument: argument)
80+ return self . buffer ( container, offset: offset, argument: argument, fitThreads : fitThreads )
8081 }
8182 func bytes< T> ( _ binding: Binding < T > , index: Int ) -> Compute {
8283 var c = self
0 commit comments