The RADV Vulkan Driver Is Shy Of 40,000 Lines Of Code
It remains to be seen how exactly the situation will play out with the existing open-source RADV Vulkan driver that's in the Mesa tree and AMD's to-be-opened "Radeon Open Vulkan" driver that is the company's official Vulkan driver. At least though Vulkan drivers are lighter and less maintenance than OpenGL drivers.
For those curious about the size of the RADV Vulkan driver, when checking out Mesa Git this morning, the src/amd/vulkan directory comes in at 36,253 lines of code.
So there's about 36k lines of RADV-specific Vulkan driver code, but there's also some common code utilized. When it comes to the AMD common code as well as its addrlib, that adds in another 77,659 lines of code shared between the Radeon OpenGL and Vulkan drivers.
Meanwhile, in Gallium3D space the RadeonSI directory is at 39,797 lines of code but another 17,025 lines of code in the common Radeon Gallium directory that hosts the VCN bits, some R600 shared bits, etc.
That's also not counting the AMDGPU LLVM back-end living within the LLVM tree, any of the other common Vulkan/WSI code shared with Intel's ANV driver, etc. That common Vulkan code within Mesa is another ~11k lines of code. There's also obviously the AMDGPU DRM driver in kernel space that makes up the open-source Radeon graphics driver stack and represents the largest component of the stack.
But for those curious how the RADV burden itself is, it's roughly less than 40,000 lines of code for delivering this performant, nearly full featured Vulkan 1.0 driver. It will be interesting to see the code size of the to-be-opened Vulkan driver, but almost certainly much larger in size since it lives within its own code-base and thus not any code sharing between any other Vulkan/OpenGL drivers as in the case of Mesa. We'll see though in the weeks/months ahead what Radeon Vulkan driver will reign supreme.