OpenGL OpenGL Extensions and Modern OpenGL 2 — Questions and Answers
Question 1: What does the ARB suffix in an OpenGL extension name indicate?
- The extension is vendor-specific to AMD/ATI
- The extension has been reviewed and approved by the OpenGL Architecture Review Board (Correct answer)
- The extension is experimental and unstable
- The extension is only for mobile GPUs
Correct answer: The extension has been reviewed and approved by the OpenGL Architecture Review Board
ARB extensions are cross-vendor and vetted by the Architecture Review Board; they often become core features in future OpenGL versions.
Question 2: What feature does OpenGL 4.3's GL_ARB_compute_shader extension add?
- Tessellation control shaders
- General-purpose compute shaders dispatched outside the draw pipeline (Correct answer)
- Geometry shader instancing
- Sparse texture support
Correct answer: General-purpose compute shaders dispatched outside the draw pipeline
ARB_compute_shader introduced compute shaders to OpenGL, enabling GPGPU workloads dispatched with glDispatchCompute.
Question 3: What is a sync object (glFenceSync) used for in OpenGL?
- Synchronising texture uploads between CPUs
- Inserting a fence into the command stream to detect when the GPU has completed prior commands (Correct answer)
- Locking a buffer against CPU writes
- Synchronising multi-threaded shader compilation
Correct answer: Inserting a fence into the command stream to detect when the GPU has completed prior commands
glFenceSync inserts a fence; the application can then wait (glClientWaitSync) or poll until the GPU has passed that point.
Question 4: What does the OpenGL function glMemoryBarrier do?
- Blocks the CPU until the GPU is idle
- Ensures that memory writes by shaders are visible to subsequent operations as specified by the barrier bits (Correct answer)
- Allocates a new GPU memory page
- Prevents cache eviction of textures
Correct answer: Ensures that memory writes by shaders are visible to subsequent operations as specified by the barrier bits
glMemoryBarrier(barriers) enforces ordering guarantees for incoherent memory accesses such as image load/store and SSBO writes.
Question 5: What does sparse texture support (ARB_sparse_texture) allow in OpenGL?
- Compresses textures with fewer bits per pixel
- Allocates only the mipmap tiles that are actually needed, saving GPU memory (Correct answer)
- Streams textures from disk in the background
- Shares texture memory between OpenGL and Vulkan
Correct answer: Allocates only the mipmap tiles that are actually needed, saving GPU memory
Sparse textures let the application commit and de-commit individual mipmap tiles, enabling virtual texturing of huge datasets.
Question 6: Which OpenGL extension allows applications to write to textures using imageLoad/imageStore GLSL functions?
- ARB_texture_storage
- ARB_shader_image_load_store (Correct answer)
- ARB_bindless_texture
- ARB_buffer_storage
Correct answer: ARB_shader_image_load_store
ARB_shader_image_load_store exposes image units that can be bound read/write, allowing shaders to perform scatter writes to textures.
What does the ARB suffix in an OpenGL extension name indicate?