Working with libdrm, buffer allocation
In the first blog of libdrm, we went through the
repainting loop using the libdrm. Now we move on to the topic of
framebuffers. A framebuffer is a piece of memory (could be on main memory or on
GPU) for repainting every frame. It is like a canvas, represents what you would
finally see on screen. Framebuffer is already a familiar concept to rendering
programmers, in OpenGL, We have GL_FRAMEBUFFER_0
for presenting the
surface, additional framebuffers for roles like G-Buffer and
post-processing. In GPU programming, framebuffer is also a broader concept,
“abstraction of a collection of attachments”, the underlining attachments
corresponds to actual pieces of memory we talk about here.