Moving GPU computing work in compute shaders from OpenGL ES to Vulkan compute, or between Vulkan compute and DirectCompute, pays back only when a prototype on the target GPU shows the gain is bigger than three costs: the driver overhead you are actually paying today, the interop and synchronisation cost of sharing the GPU with rendering, and the rework that barriers and resource binding need. A portable API does not guarantee portable performance on a specific SoC and driver. In the VComputeBench study, the same benchmark suite gave Vulkan a geometric-mean speedup over OpenCL of 1.59x on a Nexus device but 0.83x on a Snapdragon device. A hybrid port, where only the compute moves and rendering stays where it is, is the lowest-risk way to find out.
How Does DirectCompute Work, and What Does It Mean in Practice?
DirectCompute is Microsoft’s name for the compute shader, the programmable stage that extends Direct3D 11 beyond graphics programming. Microsoft describes it as general-purpose computing across the GPU’s many parallel processors, with memory sharing and thread synchronisation features built in for parallel programming. In practice you write a kernel in HLSL, declare a thread-group size, and dispatch a grid of groups. Threads in one group share data through groupshared memory and wait on group barriers. How those GPU threads are scheduled and executed decides much of what a kernel’s group size should be.
The version matters. On Direct3D 11 hardware the compute shader is DirectCompute 5.0, limited to 1,024 threads per group under the cs_5_0 profile. Direct3D 10-class hardware can offer a limited DirectCompute 4.x with 768 threads per group. DirectCompute is part of DirectX on Windows. For an XR team that makes it a natural fit for PC-tethered rendering and Windows hosts, and the wrong starting point for a standalone Android headset, where Vulkan or OpenGL ES is the compute path on offer.
What Is a Compute Shader, and How Is It Different from a Vertex or Pixel Shader?
A compute shader is not part of the graphics pipeline. A compute pipeline touches none of the rasterisation state, so it carries much less state than a graphics pipeline. It reads from and writes to buffers arbitrarily, for example through shader storage buffers in Vulkan. Vertex and pixel shaders, by contrast, are fed by fixed-function stages and produce vertices and fragments for the next stage.
The hardware treats the two kinds of work differently too. On the NVIDIA GPUs studied in the VUDA paper (2026), compute work reaches the streaming multiprocessors through the compute work distributor as thread blocks, while graphics work is organised into primitive batches and screen regions and is first distributed across graphics processing clusters. At the API level the difference is small: in Vulkan you call vkCmdDispatch instead of vkCmdDraw, create a compute pipeline instead of a graphics one, and bind descriptors at the compute bind point.
How Does DirectCompute Compare to CUDA, OpenCL and Vulkan Compute for XR Workloads?
The deciding differences for XR are who owns synchronisation, whether compute can run beside rendering, and where the code can ship.
| API | Synchronisation model | What it means inside an XR frame |
|---|---|---|
| DirectCompute (Direct3D 11 compute) | Memory sharing and thread synchronisation are part of the stage; 1,024 threads per group on cs_5_0, 768 on 4.x hardware | Tied to Direct3D; weigh portability and integration with the renderer before choosing it |
| Direct3D 12 compute | Explicit fences between queues; only one queue may write a resource at a time | In the piet-gpu bounding-box work, Direct3D 12 performance was essentially identical to Vulkan |
| Vulkan compute | Explicit: the application owns synchronisation between queues and with the host | Compute support is mandatory on every implementation; a dedicated compute queue allows async compute beside rendering |
| OpenGL ES compute | Implicit synchronisation in most OpenGL calls | No concept of multiple queues, so the Vulkan async-compute technique used on Arm Mali is not available |
| CUDA | Streams; on NVIDIA GPUs, a separate scheduling domain from Vulkan graphics | Under default time sharing beside graphics, CUDA kept only 8% of its standalone throughput in one test |
| OpenCL | Kernels launched from the host once per iteration in VComputeBench’s iterative benchmarks | Not fully supported by NVIDIA; its compiler produced better code than Vulkan’s for one memory-bound kernel |
The VComputeBench speedups for Vulkan (a geometric mean of 1.53x over CUDA on a GTX 1050 and 1.26x over OpenCL on an RX 560) came mainly from recording every iteration of an iterative algorithm in one command buffer with memory barriers between them, which removed per-iteration launch overhead. The same authors note that this low-level control requires significantly higher programming effort. The gain depends on workload and driver: launch-heavy iterative kernels benefited, while the memory-bound bfs benchmark slowed down because Vulkan’s SPIR-V compiler was less mature than OpenCL’s. A Linköping University master’s thesis that implemented the same FFT in CUDA, OpenCL, DirectCompute and OpenGL compute names portability, hardware requirements, programmability and integration as factors in the choice alongside performance.
When Is Vulkan Compute a Better Bet than CUDA Across Desktop GPUs and Tablets?
Vulkan compute is the better bet when the same kernels must run on mobile or tablet SoCs as well as desktop GPUs. CUDA runs only on NVIDIA hardware, and every Vulkan implementation must support compute, from high-end desktop GPUs to low-powered embedded devices. The VComputeBench authors conclude that Vulkan can serve as a cross-platform GPGPU framework, but also that a portable programming model does not guarantee portable performance: that depends on vendor driver support. CUDA remains the stronger choice when the target is NVIDIA-only and the workload leans on CUDA libraries, because rewriting those kernels is cost with no portability return. Moving CUDA work into a Vulkan graphics stack means rewriting kernels as Vulkan compute shaders or precompiling them to PTX and launching them through a Vulkan extension. The same lock-in trade-off for inference code is covered in porting a GPU inference path off CUDA with HIP. Whether to build one cross-vendor compute backend or keep a CUDA-first path with a fallback is a separate architecture decision, and it needs its own benchmark on representative desktop and tablet hardware.
When Should an XR Team Use DirectCompute Versus Keeping Work on the CPU or the Graphics Pipeline?
Move work to a compute shader when it is highly parallel, its data already lives on the GPU, and its result is consumed on the GPU. Keep it on the CPU when the data has to cross to the GPU and back for a short kernel. Gregg and Hazelwood (ISPASS 2011) found that once memory transfers are included, a kernel can easily take 2 to 50 times longer than its GPU processing time alone. Profiling the kernel without the transfers overestimates the GPU speedup and leads to poor scheduling decisions. The Vulkan tutorial’s GPU particle system shows the opposite case: vertices are uploaded once and every update stays in GPU memory, so there is no round trip. On an integrated GPU or a headset SoC, CPU and GPU share the same memory and its bandwidth.
The choice between compute and the graphics pipeline is less obvious. Unreal Engine’s Nanite culls and rasterises small primitives in compute shaders instead of the fixed-function hardware. On tile-based mobile GPUs, though, breaking up the render pass has its own cost. In Vulkan, render passes express only rasterisation work, so compute work needs separate render passes. Kapoulkine notes that on tilers, flushing tile contents to memory and loading them back between command buffers is very costly.
Where Do Compute Passes Share or Compete for GPU Budget with the Render Pass in an XR Frame?
Compute and render compete for the same execution units, registers, local data share and memory bandwidth, even when they run in parallel on different queues. Without async compute, a compute shader runs in sequence with the rest of the frame, so its time comes straight out of the frame budget. With async compute it can overlap rendering, but AMD’s guidance warns that async compute can reduce performance when not used well, and recommends being able to turn it on or off per task so the benefit can be measured.
Partitioning does not remove bandwidth contention. The VUDA paper (2026) describes NVIDIA’s default simultaneous compute and graphics mode as best-effort arbitration over shared SM resources. Even with inter-SM partitioning between compute and graphics, L2 cache and device memory bandwidth stay shared, so the bandwidth contention remains. Intel says that on Xe-LP, running 3D and compute work side by side has minimal impact on performance. That is a vendor statement, and we would check it on the actual workload. The paper’s synthetic VR scenario gives a sense of how tight the budget is: a 90 Hz stereo renderer has an 11.11 ms frame interval (1,000 ms divided by 90), of which 9 ms was allotted to rendering.
Synchronisation between the two also keeps GPU processing power properly shared between them. In the Mímir interop library’s benchmarks, removing the semaphores between CUDA compute and Vulkan rendering made the two workloads compete for the GPU, and at large inputs performance fell below the synchronised version. For tuning beyond compute scheduling, our wider notes on XR performance and GPU optimisation cover the render side.
How Can Offloading Work to Compute Shaders Trigger Thermal Throttling Under Sustained Load?
On a standalone headset, offloading to the GPU moves work onto an SoC with little headroom to spare. The heat budget is shared, so a compute pass that fits the frame budget can still push the device past what it can dissipate over a session. A feasibility study of native mixed-reality compositing on Meta Quest 3 estimated that the Snapdragon XR2 Gen 2 runs at about 70 to 80% of its core task capability for a lightweight MR pipeline, leaving roughly 5 to 15% headroom. The same study puts thermal throttling within 5 to 10 minutes of sustained high utilisation. It also cites 17% lower GPU performance in mixed-reality mode than in VR-only mode, because of sensor-processing overhead.
The headroom and throttling figures come from simulation-based estimates, not hardware measurements, and the authors say so. They name a working prototype as the critical next step to validate them. The practical point holds either way: a compute-heavy effect that passes a one-minute demo has not been tested, because the failure appears after the throttle starts, not before. Whether the work belongs on the headset at all is a different question, covered under AR GPU placement across device, edge and cloud.
How Do You Profile Compute-Shader Cost Against the Motion-to-Photon Latency Budget?
Measure compute cost as a share of the frame interval under sustained load, with data movement and synchronisation waits included, and switch each compute task on and off to see its real effect. Where those budgets come from, and how missing them stalls pilots, is covered in XR latency budgets and pilot failure causes. The procedure below attributes frame time to compute specifically.
- Fix the budget. Derive the frame interval from the refresh rate (11.11 ms at 90 Hz) and set the share available to rendering and to compute.
- Find which side is bound. OpenGL ES titles with many draw calls can become CPU-bound from time spent in the graphics driver, so check whether you are CPU-bound or GPU-bound before blaming any shader.
- Time every dispatch on the GPU. Use the API’s timer queries around each compute pass, as the piet-gpu work did with Vulkan and Metal timer queries.
- Add transfers. Count data transfers to and from the GPU in the compute cost, because kernel-only timing overestimates the GPU speedup.
- Toggle each task. Run with each compute task on and off, and with async compute on and off, to measure the effect on frame time.
- Check occupancy. In AMD’s Unreal Engine guide, a compute shader limited to 7 wavefronts by register use got a 30% uplift, to 0.55 ms, once register and texture-bandwidth demands were cut.
- Run past the throttle point. Record tail frame times, not the mean, over a session longer than the expected onset of throttling, measured against the frame interval fixed in step 1.
- Repeat per driver version. Older Android devices can carry out-of-date Vulkan drivers with bugs, so results on one driver are not results on the fleet.
Is Vulkan Really Faster than OpenGL ES for Compute Shaders on Your SoC?
Vulkan has lower CPU overhead than OpenGL ES, but whether that reaches 60 fps on a specific Adreno SoC is settled only by profiling the compute workload under both APIs on the device.
TechnoLynx handles this decision through the AI Porting & Deployment Pack. The first step is confirming on your hardware that the 60 fps shortfall comes from compute-shader driver overhead, and not from shader ALU cost, memory bandwidth or the rendering path, before any port is written. From there the engagement designs a hybrid architecture with an abstracted compute backend, ports the compute path to Vulkan, profiles frame time, driver overhead and interop cost on-device, and monitors the result across driver updates.
The case for Vulkan is real. Android’s developer guidance says games with many draw calls on OpenGL ES can see significant driver overhead and can cut CPU and power use by switching to Vulkan. Arm’s 2016 comparison showed OpenGL ES working one CPU core hard where Vulkan spread the load across threads, with lower CPU overhead and better power efficiency. The mechanism is that Vulkan pushes resource tracking, synchronisation, memory allocation and work submission into the application, and delegates error checking and state validation to tooling layers removed at runtime.
That evidence comes from draw-call-heavy games and an Arm demo, not from Adreno compute. A compute workload that issues a handful of dispatches per frame may not be paying much driver overhead in the first place, and then there is little for Vulkan to remove. The VComputeBench results make the risk concrete: a geometric-mean speedup over OpenCL of 1.59x on a Nexus device, but 0.83x on a Snapdragon device. We would treat the compute/graphics interop quality of Adreno drivers under Vulkan, compared with OpenGL ES 3.x, as something to measure on the target device rather than assume. Out-of-date or buggy Vulkan drivers on older Android devices can take significant testing and engineering time to work around.
What a Prototype on the Target Hardware Should Measure Before the Port
Build the smallest version that answers the question: the one compute workload under suspicion, behind an interface with an OpenGL ES and a Vulkan implementation, running on the target SoC inside the real frame. Keep the algorithm identical in both. The VComputeBench authors made no algorithmic changes to kernels when writing Vulkan equivalents, so that any difference could be put down to the programming model. Write the Vulkan side the way it would ship: for iterative work, one command buffer with memory barriers between iterations, and as little return to the CPU for control as possible. Use explicit semaphores, fences and barriers, since implicit timing varies across Android’s diverse hardware.
The prototype should report four numbers per configuration: CPU time in the driver, GPU time for the compute pass, time spent waiting at the interop boundary, and sustained frame rate. If the Vulkan path wins on GPU time but the interop wait takes the gain back, the prototype has done its job by stopping the port.
What a Hybrid Port Costs: Vulkan Compute Beside an OpenGL ES Renderer
A hybrid port, with compute on Vulkan and rendering left on OpenGL ES, is technically feasible: interop between Vulkan and OpenGL is possible and documented, though the implementation details matter. The cost sits at the boundary. Shared resources have to be handed between two APIs with different synchronisation models, and OpenGL synchronises implicitly in most calls where Vulkan leaves it to the program. Wrong or missing synchronisation produces read-after-write and write-after-read hazards between compute and the stages consuming its output. The CUDA/OpenGL case shows what the GL side costs: resources must be mapped before compute touches them and unmapped before graphics uses them again, with context management on top in multi-threaded code.
The Mímir authors found interop synchronisation cost negligible next to its value in balancing compute and graphics on one GPU. That was CUDA with Vulkan, not OpenGL ES. It does not tell you what a Vulkan/OpenGL ES split costs on an Adreno driver.
The hybrid is still the lowest-risk test, because the renderer is untouched, the old compute path stays available as a fallback, and the measurement is of the real frame. It also delivers something usable before the whole migration is done. We hold that each milestone of an engagement should produce a usable result even when the end goal is not yet reached.
| What profiling on the device shows | What we would do |
|---|---|
| OpenGL ES compute driver overhead blocks 60 fps, and the Vulkan prototype closes the gap after interop cost | Port compute to Vulkan, hybrid first; weigh a full port separately |
| The bottleneck is shader ALU, memory bandwidth or the rendering path itself | Stay on OpenGL ES and optimise there |
| Interop waits in the hybrid split cancel most of the gain | Stay, or cost a full port that moves rendering too, as its own decision |
| The gain appears on one driver version only | Treat it as unproven and retest across driver updates |
How Much Compute-Shader Code Carries over Between Vulkan Compute and DirectCompute?
Most of the algorithm carries over (the data layout, the culling and occlusion maths, the structure of the kernel), while synchronisation, memory barriers, resource binding and workgroup sizing need redesign rather than translation.
TechnoLynx scopes a move like this as an AI Porting & Deployment Pack engagement that starts with an inventory of the kernel, separating algorithmic maths from API-specific binding and synchronisation code, so the estimate rests on what actually has to change. The engagement then rewrites the low-risk regions directly, redesigns synchronisation and workgroup sizing for the target GPU, and benchmarks the ported kernel against the Vulkan baseline for correctness and performance.
Microsoft’s DirectXShaderCompiler documents how HLSL maps to SPIR-V: StructuredBuffer and RWStructuredBuffer become storage buffers with std430 layout, groupshared variables go to the Workgroup storage class, SV_DispatchThreadID and its siblings become the matching invocation IDs, and Interlocked* operations become SPIR-V atomics. Going the other way, the piet-gpu project wrote its compute shaders in GLSL, compiled them to SPIR-V for Vulkan, and translated them ahead of time to HLSL with SPIRV-Cross for Direct3D 12. Binding is where translation starts to leak: in HLSL, arrays of resources take several binding slots where Vulkan uses one, so bindings can overlap unless they are remapped.
Why Synchronisation and Memory Barriers Need Rework
Barriers inside a shader are translated too: HLSL synchronisation intrinsics become OpMemoryBarrier or OpControlBarrier. The host-side synchronisation model differs between the APIs. In Vulkan the application is responsible for synchronisation between queues and between device and host. A pipeline barrier between two compute dispatches drains the GPU of compute work, so tuned Vulkan code often uses split barriers with events and orders independent dispatches to hide that cost. Direct3D 12 has its own rules: a fence is needed after a write before another queue reads, and only one queue may write a resource at a time. A Direct3D 12 target needs the barrier logic designed again around fences and resource states.
Bernhard Kerbl’s Vulkanised 2023 talk on moving to Vulkan for compute names synchronisation and descriptor management as the hard parts, with “many things to get wrong” that are potentially tough to verify. The piet-gpu authors deliberately avoided subgroups and memory barriers in their portable kernel, because both pose portability problems.
What Fewer Execution Units and Shared Bandwidth Do to a Ported Kernel on Iris Xe
An integrated GPU such as Iris Xe changes whether a ported kernel keeps its performance, regardless of which API it lands on. The Iris Xe 80EU is a Xe-LP part designed for low power, with 80 execution units against 48 on the base Iris Xe, according to a published specification listing. As an integrated GPU, it shares system memory and its bandwidth with the CPU. The Linköping thesis found local memory capacity and thread and block configuration to be the most important differences between devices. Vulkan’s guide puts shared memory, the “L1 cache you can control”, at a limit of around 32 KB on most implementations, and workgroup limits differ by implementation, so they should be queried rather than assumed.
For a clustered occlusion kernel, the risk is that workgroup sizes and shared-memory tiles chosen for a discrete GPU leave a smaller integrated GPU under-occupied or bandwidth-starved. Occupancy tuning moves results by a lot: AMD’s 30% example above came from register and bandwidth changes alone. Expect that tuning to take iterations on the device. The target API matters here too. Intel says Xe-LP supports Direct3D 11 and OpenGL, but that the performance benefits with Direct3D 12, Vulkan and Metal are greater. Porting a Vulkan kernel to Direct3D 11 DirectCompute on this hardware may move it onto the path Intel itself expects to gain less, which makes Direct3D 12 compute worth costing as the alternative.
How a Previous Port Helps Estimate Scope and Risk
Where an earlier port exists, from your own codebase or a closely matching public project, it helps most as a template for sorting regions: which parts went across with binding changes only, which needed barrier redesign, and how many tuning rounds the target GPU took. The transfer has limits. An estimate taken from someone else’s port may not carry over if your algorithm has non-standard memory access patterns, and tuning of workgroup size and shared memory may need its own iteration beyond the reference. A port in a different domain, such as a CUDA SLAM pipeline, says something about cross-API risk in general and little about this kernel.
Who Can Port Our Compute Shaders and Show Whether the Port Paid Off?
TechnoLynx ports compute-shader workloads to Vulkan compute. TechnoLynx’s AI Porting & Deployment Pack begins by attributing the frame-time shortfall on your device and sits within its wider GPU performance engineering work. On build versus buy: a team with Vulkan and Direct3D synchronisation experience and time on the device can run the prototype itself, while a specialist earns its place when that experience is missing or the decision is due before the team can build it. When choosing a partner, ask how they will attribute the frame-time shortfall before porting, what the hybrid milestone delivers, and how results hold across driver versions.
This engagement does not suit teams whose frame-time problem lies in content, assets or scene density rather than compute scheduling, or teams buying hours of shader translation without a performance target. Realistic alternatives are an in-house prototype using vendor profilers such as Radeon GPU Profiler, Nsight Graphics and RenderDoc, which have their own limits, or the GPU vendor’s developer support for driver-specific questions. If the open question is which device to buy rather than how to port, LynxBenchAI’s published results show how candidate hardware runs the public PyTorch stack. They are indicative for custom PyTorch models, and they do not measure your own shaders or application.
FAQ
What Shader Language Does Vulkan Use?
Vulkan consumes SPIR-V, an intermediate representation. Shaders are usually written in GLSL or HLSL and compiled to SPIR-V, as the piet-gpu project did with GLSL and as Microsoft’s DirectXShaderCompiler does for HLSL.
Why Does Processing Vulkan Shaders Take so Long?
Creating a pipeline object can require the driver to compile several shaders to GPU microcode, which takes time and threads poorly under just-in-time compilation. A VkPipelineCache stores compiled state between runs, and pre-warming it at load time reduces in-game stalls.
What Are Compute Shaders in OpenGL?
OpenGL compute shaders, like DirectCompute, are part of a graphics API but have a general enough structure for general-purpose computing on the GPU.