IT lexicon › Programming › Resource barrier

Resource barrier

Programming På svenska → Updated: 2026-10-26

The instruction in modern graphics APIs that announces when a resource changes use — without it, the GPU reads half-written textures.

A GPU pipelines work deeply and caches aggressively. When the same texture is first written as a render target and then read in a shader moments later, the driver has to know about the change so it can flush the cache and insert the right dependency between the stages. That notice is a resource barrier: an explicit transition from one state to another, sometimes including a change of image layout.

Older APIs like OpenGL and Direct3D 11 handled this implicitly, and often conservatively. Vulkan and Direct3D 12 pushed the responsibility onto the developer in exchange for less overhead. Misplaced barriers are a classic source of both corrupted graphics and needless stalls. Do not confuse one with a CPU memory fence — a related idea at a different level.

← Back to the lexicon