Display list
This section may stray from the topic of the article. (January 2024) |
A display list, also called a command list in Direct3D 12 and a command buffer in Vulkan, is a series of graphics commands or instructions that are run when the list is executed.[1] Systems that make use of display list functionality are called retained mode systems, while systems that do not are as opposed to immediate mode systems. In OpenGL, display lists are useful to redraw the same geometry or apply a set of state changes multiple times.[2][3] This benefit is also used with Direct3D 12's bundle command lists. In Direct3D 12 and Vulkan, display lists are regularly used for per-frame recording and execution.
Origins in vector displays
The vector monitors or calligraphic displays of the 1960s and 1970s used electron beam deflection to draw line segments, points, and sometimes curves directly on a CRT screen. Because the image would immediately fade, it needed to be redrawn many times a second (storage tube CRTs retained the image until blanked, but they were unsuitable for interactive graphics). To refresh the display, a dedicated CPU called a Display Processor or Display Processing Unit (DPU) was used, which had a memory buffer for a "display list", "display file", or "display program" containing line segment coordinates and other information. Advanced Display Processors also supported control flow instructions, which were useful for drawing repetitive graphics such as text, and some could perform coordinate transformations such as 3D projection.[4][5]
Home computer display list functionality
One of the earliest systems with a true display list was the Atari 8-bit computers. The display list (actually called so in Atari terminology) is a series of instructions for ANTIC, the video co-processor used in these machines. This program, stored in the computer's memory and executed by ANTIC in real-time, can specify blank lines, any of six text modes and eight graphics modes, which sections of the screen can be horizontally or vertically fine-scrolled, and trigger Display List Interrupts (called raster interrupts or HBI on other systems).[6]
Usage in OpenGL
To delimit a display list, the glNewList and glEndList functions are used, and to execute the list, the glCallList function is used. Almost all rendering commands that occur between the function calls are stored in the display list. Commands that affect the client state are not stored in display lists.[7] Display lists are named with an integer value, and creating a display list with the same name as one already created overrides the first.[8]
The glNewList function expects two arguments: an integer representing the name of the list, and an enumeration for the compilation mode. The two modes include GL_COMPILE_AND_EXECUTE, which compiles and immediately executes, and GL_COMPILE, which only compiles the list.[9]
Display lists enable the use of the retained mode rendering pattern, which is a system in which graphics commands are recorded (retained) to execute in succession at a later time. This is contrary to immediate mode, where graphics commands are immediately executed on client calls.[10]
Usage in Direct3D 12
Command lists are created using the ID3D12Device::CreateCommandList function.[11] Command lists may be created in several types: direct, bundle, compute, copy, video decode, video process, and video encoding. Direct command lists specify that a command list the GPU can execute, and doesn't inherit any GPU state.[12] Bundles, are best used for storing and executing small sets of commands any number of times. This is used differently than regular command lists, where commands stored in a command list are typically executed only once.[11] Compute command lists are used for general computations, with a common use being calculating mipmaps.[13] A copy command list is strictly for copying and the video decode and video process command lists are for video decoding and processing respectively.[12]
Upon creation, command lists are in the recording state. Command lists may be re-used by calling the ID3D12GraphicsCommandList::Reset function. After recording commands, the command list must be transitioned out of the recording state by calling ID3D12GraphicsCommandList::Close. The command list is then executed by calling ID3D12CommandQueue::ExecuteCommandLists.[11]
See also
Further reading
- White, Steven; Danielsson, David; Jenks, Alma; Satran, Michael (2023-03-08). "Design Philosophy of Command Queues and Command Lists - Win32 apps". learn.microsoft.com. Retrieved 2024-01-26.
References
- ↑ "Chapter 7 - OpenGL Programming Guide". Addison-Wesely. https://www.glprogramming.com/red/chapter07.html. Retrieved 18 November 2018.
- ↑ OpenGL programming guide: the official guide to learning OpenGL, version 1.1 (2nd ed.). Addison Wesley. 1997. ISBN 978-0201461381.
- ↑ Mark Segal, Kurt Akeley, The Design of the OpenGL Graphics Interface. http://www.graphics.stanford.edu/courses/cs448a-01-fall/design_opengl.pdf
- ↑ Dersch, Josh (10 May 2013). "An introduction to the Imlac PDS-1". https://rottedbits.blogspot.com/2013/05/an-introduction-to-imlac-pds-1.html.
- ↑ Foley, James D.; Van Dam, Andries (1982). Fundamentals of Interactive Computer Graphics. Addison-Wesley Publishing Company, Inc.. pp. 19, 93-94, 394, 400-404. ISBN 0-201-14468-9.
- ↑ Small, David; Small, Sandy; Blank, George (1983). The Creative Atari. Creative Computing Press. ISBN 978-0-916688-34-9.
- ↑ Martz, Paul (2006). OpenGL Distilled (1st ed.). Addison-Wesley Professional PTG. ISBN 9780132701785. https://books.google.com/books?id=ckpNmNlLE_sC&q=display+list&pg=PR7. Retrieved 28 December 2023.
- ↑ Wright, Richard S.; Haemel, Nicholas; Sellers, Graham; Lipchak, Benjamin (2010). OpenGL SuperBible: Comprehensive Tutorial and Reference (5th ed.). Addison-Wesley Professional. ISBN 978-0-321-71261-5. https://dl.acm.org/doi/10.5555/1895026.
- ↑ White, Steve (2021-03-09). "glNewList function (Gl.h) - Win32 apps" (in en-us). https://learn.microsoft.com/en-us/windows/win32/opengl/glnewlist.
- ↑ Quinn Radich (May 30, 2018). "Retained Mode Versus Immediate Mode". Win32 apps. Microsoft. https://docs.microsoft.com/en-us/windows/win32/learnwin32/retained-mode-versus-immediate-mode.
- ↑ 11.0 11.1 11.2 White, Steven; Jenks, Alma; badasahog; Coulter, David; Kelly, John; Kinross, Austin; Wenzel, Maira; Jacobs, Mike et al. (2021-12-30). "Creating and recording command lists and bundles - Win32 apps" (in en-us). https://learn.microsoft.com/en-us/windows/win32/direct3d12/recording-command-lists-and-bundles.
- ↑ 12.0 12.1 White, Steve (2023-02-14). "D3D12_COMMAND_LIST_TYPE (d3d12.h) - Win32 apps" (in en-us). https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_command_list_type.
- ↑ Loggini, Riccardo (2020-10-31). "Compute Shaders in D3D12" (in en-US). https://logins.github.io/graphics/2020/10/31/D3D12ComputeShaders.html.
