From 063eb03c20e467c2841c53aaf1f005503ece9c89 Mon Sep 17 00:00:00 2001 From: y-jan137 Date: Wed, 29 Apr 2026 09:10:29 +0300 Subject: Replace selection sort with bitonic sort --- Sources/PixelSort.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Sources/PixelSort.swift') diff --git a/Sources/PixelSort.swift b/Sources/PixelSort.swift index 7fc1ce2..139bcca 100644 --- a/Sources/PixelSort.swift +++ b/Sources/PixelSort.swift @@ -179,7 +179,7 @@ struct PixelSort: ParsableCommand { prepareIndirectArgsPipeline.arguments.indirectArgs = .buffer(indirectArgsBuffer) try compute.run(pipeline: prepareIndirectArgsPipeline, width: 1, height: 1) - // Sort each span into sortedTex (one thread per span) + // Sort each span into sortedTex (one threadgroup per span, bitonic sort) try compute.task(label: "pixelSort") { task in try task.run { dispatch in let enc = dispatch.commandEncoder @@ -192,7 +192,7 @@ struct PixelSort: ParsableCommand { enc.dispatchThreadgroups( indirectBuffer: indirectArgsBuffer, indirectBufferOffset: 0, - threadsPerThreadgroup: MTLSize(width: 1, height: 1, depth: 1) + threadsPerThreadgroup: MTLSize(width: 1024, height: 1, depth: 1) ) } } -- cgit v1.2.3