3 ms·
Surprisingly, resource binding is the key to performance both on CPU and GPU. The method of binding resources to some "slots" (registers/handles/etc) while bein
by pandaman 10y ago
Surprisingly, resource binding is the key to performance both on CPU and GPU. The method of binding resources to some "slots" (registers/handles/etc) while being easy to understand is not present in modern hardware. There used to be actual registers for textures/samplers/buffers (well, I don't recall if there had been any hardware with buffers, but there had been just float4 regs to get non-texture data into the shaders) but not any more.
Emulating these in software is expensive as you are essentially running a multi-process application, where every process gets parameters from the global state. You can either run it sequentially (very slow) or make a copy of the state for each process (generally slow, but there are tricks like fragmenting the state and only copying the changed fragments).
I suspect the reason the DX12/Vulkan games are not showing much improvement in performance is that they share most of the code with the legacy DX11/OpenGL and keep emulating the global state for the new API.