Hardware accelerated rendering

Graphics rendering can generally be thought of as the process of turning some data into a visual representation of the data.

A little bit of history
Early computer graphics applications like [https://en.wikipedia.org/wiki/Spacewar! Spacewar! (1962)], Sketchpad (1963) and Pong (1972) used vector graphics and rendered them to CRT displays. The computers driving the displays would continuously execute a set of drawing instructions which would steer the beam of the cathode-ray tube.[citation needed] [is it?] [Explain why we need raster graphics].

[Explain bitmaps]. [Explain framebuffers]. The advent of high-density semiconductor-based memory enabled the development of SuperPaint (1972/1973), a program capable of video editing and computer animation.

[Mention early fixed-pipeline hardware in consoles, arcade machines and computer expansion cards].

[Mention early re-programmable pipelines in graphics hardware].

[Beginnings of OpenGL].

[Problems with OpenGL].

[Vulkan and maybe AMD's Mantle].

[DirectX and Metal might need to fit in here somewhere, too].

[Maybe also WebGPU].

A Breif Comparison of the Various 3D Graphics APIs
OpenGL

The oldest of the bunch. Deprecated by Apple on their platforms in 2018 in favor of Metal.

DirectX < 12

Microsoft's OpenGL.

WebGPU

The result of the "WebGL Next" initiative. A simplified version of Vulkan intended for use on the web. Native implementations, wgpu-native and dawn, also exist.

Metal

Apple's low-level 3D graphics API. Object-oriented. Supported on macOS and iOS. Similar to Vulkan.

DirectX 12

Microsoft's latest and greatest 3D graphics API. Supported on Windows 10 and the Xbox One and later. DirectX 12 Ultimate will make the API more portable between Windows and the Xbox. Uses COM, which can be frustrating to work with in Rust. Similar to Vulkan.

Vulkan

Derived from AMDs Mantle. Exposes a C-based interface. Practically every structure defined by the specification is prefixed with both a  and   field. It helps make the API extensible, but it requires the use of  on the Rust side of things.

General Concepts
While the concepts outlined below should be mostly relevant for all of the modern 3D graphics APIs, the technical terms and explanations will mostly be drawing from how Vulkan does things.

Vertex
An application-defined primitive which is fed into and processed by the graphics pipeline.

A vertex often contains a position, but it does not have to do so.

Buffers
A buffer, in the context of 3D graphics APIs, refers to contiguous sections of memory which live on the GPU.

These buffers can be mapped into CPU-accessible memory for the purposes of uploading and downloading data to and from the GPU.


 * Vertex Buffer: Array of vertices that lives in the GPU's memory.
 * Index Buffer: Array of indices into the vertex buffer.
 * Uniform Buffer: Stores uniform values.
 * Storage Buffer: Generic buffer which can be read and written to by the graphics pipeline. Also supports dynamic resizing.
 * Command Buffer: A list of actions the GPU should execute, i.e. run this pipeline, copy from this buffer to that buffer, etc.
 * Indirect Buffer: ???

Primitive Topology
The primitive topology describes how the your vertices are processed by the Input Assembler.

This section of the Vulkan specification has some nice illustration of what the different topologies do (you'll probably need to scroll down to see them).

Indexed Rendering
Indexed rendering works by having an Index Buffer which stores indices into the vertex buffer.

Using indexed rendering can massively decrease the memory consumption of your application if you have lots of identical vertices.

Instanced Rendering
Instanced rendering is a way to render the same object multiple times in a scene.

Per-instance data is provided by a specially configured vertex buffer.

Uniform
A uniform is a piece of data which doesn't change on a per-vertex or per-instance basis.

Push Constant
A push constant is a bit like a uniform value.

It's quicker to update but there's a strict size limit as a result.

Shaders
Shaders are small programs which run directly on the GPU as a part of the graphics pipeline.

Vertex Shader
Runs on a per-vertex basis. This is where you transform, rotate and scale your 3D models in world space. This is also where you perform perspective projection.

Fragment Shader
Runs on a per-fragment basis. This is where the color of the fragments are decided. This is misleadingly called the pixel shader in Direct3D.

Brief history of graphics rendering in Rust
[glium, glutin?, glow, surfman?]

gfx-rs
gfx-rs is perhaps the most notable effort within graphics rendering in Rust. It was created because of a need for a cross-platform high-performance rendering library for WebRender, a GPU-based 2D rendering engine intended for use in Firefox and Servo.[citation needed] It eventually took the form of the gfx crate, which today can be found on the pre-ll branch on the gfx repository. The gfx repository's main branch is today home to the gfx-hal crate and its various backends.

wgpu
The gfx project eventually gave rise to wgpu, an implementation of the experimental WebGPU API. There's also a rust wrapper around the native WebGPU API called wgpu-rs. The naming of these projects can be confusing for some, since wgpu-rs's crate name is wgpu. The wgpu repository contains two crates called wgpu-core and wgpu-types.

[Where does rendy fit into all of this? Parts of rendy (rendy-memory and rendy-descriptor) were previously used internally by wgpu in some capacity.]

WebGPU

 * https://github.com/sotrh/learn-wgpu

Vulkan

 * https://vulkan-tutorial.com/