Skip to content

Graphics and GPU rendering

Scope: engine-independent GPU rendering and shaders for games and other real-time 3D applications, on native platforms and on the web with WebGL and WebGPU. Engine-specific rendering rules are in Unity: rendering and shaders, Godot: rendering and shaders, Unreal Engine: rendering and shaders and GameMaker: rendering and shaders. Frame-time budgets (GAMEDEV-12) and other engine-independent game rules are in Game development, and store, thermal and download-size rules for phones are in Mobile games.

Entries are sorted by score from 1 to 10 (criteria): 9โ€“10 start here or strongly recommended, 6โ€“8 recommended, 1โ€“5 further reading or conditional.

Adopted references

No single guide covers every GPU. Use the guide for each GPU family you target as its baseline; much of each vendor's advice applies to the others too.

Key rules

Choosing the renderer

  • 8 GFX-1 Choose the graphics API or engine render pipeline, and the oldest hardware you will support, at the start of the project, and record the choice and the options you rejected in an ADR. Switching later means reworking shaders, materials and lighting; the ADR rules are ADR-1 and ADR-3 in Decisions. Prefer each platform's current API: Vulkan on Android, where OpenGL ES no longer gets new features, and Metal on Apple platforms, where OpenGL ES is deprecated. (Unity, Choose a render pipeline, Godot, Overview of renderers, Android, Use Vulkan for graphics, Apple, OpenGL ES)

Budgets and bottlenecks

Shaders and pipelines

Draw calls and overdraw

Tile-based GPUs

Assets

Web

How to enforce

Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.

  • 6 Vulkan Best Practices validation (Khronos): part of the Khronos validation layer. It checks the app at run time, so turn it on while automated tests render frames. It warns, for example, about pipelines created without a cache, attachments loaded with LOAD_OP_LOAD or stored needlessly, attachments that should be transient, many small draw calls, and the same pipeline bound twice in a command buffer. Some checks run only when the vendor-specific checks for Arm, AMD, NVIDIA or Imagination GPUs are turned on. Partly checks GFX-5, GFX-10 and GFX-12.
  • 6 glslang and spirv-val (Khronos): the reference GLSL and ESSL compiler and the SPIR-V validator. Run them on every shader in CI. Checks GFX-7 for GLSL, ESSL and SPIR-V.
  • 6 DirectX Shader Compiler (Microsoft): compiles HLSL to validated DXIL for Direct3D 12, or to SPIR-V for Vulkan. Run dxc on every shader and variant in CI. glslang's HLSL front end was deprecated in April 2026. Checks GFX-7 for HLSL.
  • 5 naga (wgpu): naga shader.wgsl validates a WGSL shader, and it can also translate shaders between WGSL, SPIR-V, GLSL, HLSL and MSL. Checks GFX-7 for WGSL.
  • 5 Mali Offline Compiler (Arm): estimates each shader's cycle cost on a chosen Mali GPU, and reports register use and the share of 16-bit arithmetic. With --format json, a CI script can fail shaders that exceed a cycle budget. Partly checks GFX-2 and GFX-9.

Tutorials and further reading

  • 7 Vulkan Samples: performance (Khronos): runnable samples with live profiling for render passes, subpasses, pipeline caches, pipeline barriers, descriptor management and texture compression.
  • 6 Vulkan Guide (Khronos): a guide to Vulkan concepts, tools and porting from OpenGL, Direct3D and Metal.
  • 6 Your first WebGPU app (Google Codelabs): a step-by-step introduction to WebGPU rendering and compute shaders.