<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj" -->

---
title: A Faster Merge Sort For Mesa 26.3 Vulkan Drivers To...
description: Valve&#x27;s Natalie Vock developed a custom merge-sort algorithm to replace the shared radix sort used by RADV, ANV, Turnip, and Lavapipe Mesa Vulkan drivers for...
canonical: https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A Faster Merge Sort For Mesa 26.3 Vulkan Drivers To Benefit Ray-Tracing | daily.dev
og:description: Valve&#x27;s Natalie Vock developed a custom merge-sort algorithm to replace the shared radix sort used by RADV, ANV, Turnip, and Lavapipe Mesa Vulkan drivers for...
og:url: https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj
og:image: https://api.daily.dev/og/posts/wZcmsd0hj.png
og:image:alt: A Faster Merge Sort For Mesa 26.3 Vulkan Drivers To Benefit Ray-Tracing
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A Faster Merge Sort For Mesa 26.3 Vulkan Drivers To Benefit Ray-Tracing

**[Phoronix](https://daily.dev/sources/phoronix)** · 2 min read · 0 upvotes · 0 comments

## Summary

Valve's Natalie Vock developed a custom merge-sort algorithm to replace the shared radix sort used by RADV, ANV, Turnip, and Lavapipe Mesa Vulkan drivers for sorting Morton code keys used in BVH construction for ray-tracing. The new sort operates within a single dispatch without intermediate barriers, avoids VRAM roundtrips for small problems (under 512 elements on RADV with a subgroup size of 64), and is faster and more VRAM-efficient for small BVHs, though slightly worse for larger problem sizes. After three months of review, the code merged into Mesa 26.3, benefiting all open-source Vulkan drivers.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.phoronix.com/news/Mesa-Vulkan-Faster-Sorting>

## Questions this post answers

### What sorting algorithm change did Mesa 26.3 make for Vulkan ray-tracing BVH construction?

Mesa 26.3 replaced the shared radix sort used by RADV, ANV, Turnip, and Lavapipe drivers with a custom merge-sort for Morton code keys used in BVH construction. Written by Natalie Vock of Valve's Linux graphics team, the merge-sort runs within a single dispatch with no intermediate barriers and skips VRAM roundtrips entirely for problems under 512 elements on RADV with a 64-wide subgroup, improving speed and VRAM efficiency for small BVHs.

_Vulkan and Linux GPU driver developers can follow low-level graphics optimizations like this via daily.dev._

### Which Mesa Vulkan drivers benefit from the new Morton code sorting implementation?

The new merge-sort benefits all Mesa Vulkan drivers that previously shared the same radix sort routine for Morton code keys: RADV (Radeon), ANV (Intel), Turnip (Adreno), and Lavapipe. Since the sort was a shared piece of code across these drivers, the improvement to BVH construction performance applies uniformly across AMD, Intel, Qualcomm, and the software Vulkan implementation.

_Developers tracking open-source GPU driver improvements can follow this progress through daily.dev._

## Similar posts on daily.dev

- [Marek Olšák At Valve Lands RADV Code That Can "Double Performance" With Some VRS Cases](https://daily.dev/posts/marek-ol-k-at-valve-lands-radv-code-that-can-double-performance-with-some-vrs-cases-21gz16lua) · Phoronix · 0 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#game-development](https://daily.dev/tags/game-development), [#gpu](https://daily.dev/tags/gpu), [#vulkan](https://daily.dev/tags/vulkan), [#mesa](https://daily.dev/tags/mesa)

[View this post on daily.dev](https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A Faster Merge Sort For Mesa 26.3 Vulkan Drivers To Benefit Ray-Tracing","url":"https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj"},"datePublished":"2026-08-31T10:12:27.759Z","dateModified":"2026-08-31T10:13:07.004Z","description":"Valve's Natalie Vock developed a custom merge-sort algorithm to replace the shared radix sort used by RADV, ANV, Turnip, and Lavapipe Mesa Vulkan drivers for...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4e230ba58d5890854a06779c80b8404f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4e230ba58d5890854a06779c80b8404f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Phoronix","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Phoronix","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6a26ba379dd64932830aa0c9803dd7ee","url":"https://daily.dev/sources/phoronix"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux,game-development,gpu,vulkan,mesa","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Phoronix","item":"https://daily.dev/sources/phoronix"},{"@type":"ListItem","position":3,"name":"A Faster Merge Sort For Mesa 26.3 Vulkan Drivers To Benefit Ray-Tracing"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a-faster-merge-sort-for-mesa-26-3-vulkan-drivers-to-benefit-ray-tracing-wzcmsd0hj#faq","mainEntity":[{"@type":"Question","name":"What sorting algorithm change did Mesa 26.3 make for Vulkan ray-tracing BVH construction?","acceptedAnswer":{"@type":"Answer","text":"Mesa 26.3 replaced the shared radix sort used by RADV, ANV, Turnip, and Lavapipe drivers with a custom merge-sort for Morton code keys used in BVH construction. Written by Natalie Vock of Valve's Linux graphics team, the merge-sort runs within a single dispatch with no intermediate barriers and skips VRAM roundtrips entirely for problems under 512 elements on RADV with a 64-wide subgroup, improving speed and VRAM efficiency for small BVHs. Vulkan and Linux GPU driver developers can follow low-level graphics optimizations like this via daily.dev."}},{"@type":"Question","name":"Which Mesa Vulkan drivers benefit from the new Morton code sorting implementation?","acceptedAnswer":{"@type":"Answer","text":"The new merge-sort benefits all Mesa Vulkan drivers that previously shared the same radix sort routine for Morton code keys: RADV (Radeon), ANV (Intel), Turnip (Adreno), and Lavapipe. Since the sort was a shared piece of code across these drivers, the improvement to BVH construction performance applies uniformly across AMD, Intel, Qualcomm, and the software Vulkan implementation. Developers tracking open-source GPU driver improvements can follow this progress through daily.dev."}}]}
```

