This project is used to study DX11 The whole picture of render pipeline includes: | Part | Name | Description | Mandatory | Once / Repeat At | API Used | Sample | | ------ | ------ | ------ | ------ | ------ | ------ | ------ | | 1.1 | CreateDeviceAndSwapChain | Standard API to create 3 objects:
**ID3D11Device**
**ID3D11DeviceContext**
**IDXGISwapChain** | Yes | Once | D3D11CreateDeviceAndSwapChain() | ------ | | 1.2 | DefineRenderTargetView | Get back buffer from swapchain, then create target view using back buffer | Yes | Once | IDXGISwapChain->CreateRenderTargetView() | ------ | | 1.3 | DefineDepthStencilView | Do this if depth testing or stencil testing required | No | Once | ID3D11Device->CreateDepthStencilState()
ID3D11DeviceContext->OMSetDepthStencilState()
ID3D11Device->CreateTexture2D()
ID3D11Device->CreateDepthStencilView() | ------ | | 1.4 | DefineRenderTarget | Set render target view(and depth stencil) view as render target | Yes | Once | ID3D11DeviceContext->OMSetRenderTargets() | ------ | | 2.1 | ClearRenderTargetView | Sets all the elements in a render target to one value | Yes | Frame | ID3D11DeviceContext->ClearRenderTargetView() | ------ | | 2.2 | ClearDepthStencilView | Clears the depth-stencil resource.
Do this if depth testing or stencil testing required | No | Frame | ID3D11DeviceContext->ClearDepthStencilView() | ------ | | 2.3 | DefineVertexBuffer | Define vertices array and create vertex buffer | Yes | Graphic object | ID3D11Device->CreateBuffer()
ID3D11DeviceContext->IASetVertexBuffers() | ------ | | 2.4 | DefineIndexBuffer | Define indices array and create index buffer | Yes | Graphic object | ID3D11Device->CreateBuffer()
ID3D11DeviceContext->IASetIndexBuffer() | ------ | | 2.5 | DefineTransConstBuffer | Define transformation array and create buffer, then bind it to vertex buffer | Yes | Graphic object | ID3D11Device->CreateBuffer()
ID3D11DeviceContext->VSSetConstantBuffers() | ------ | | 2.6 | DefineColorConstBuffer | Define color array and create buffer, then bind it to vertex buffer | Yes | Graphic object | ID3D11Device->CreateBuffer()
ID3D11DeviceContext->PSSetConstantBuffers() | ------ | | 2.7 | DefineVertexShader | Create vertex shader and bind it to device | Yes | Graphic object | ID3D11Device->CreateVertexShader()
ID3D11DeviceContext->VSSetShader() | ------ | | 2.8 | DefinePixelShader | Create pixel shader and bind it to device | Yes | Graphic object | ID3D11Device->CreatePixelShader()
ID3D11DeviceContext->PSSetShader() | ------ | | 2.9 | DefineInputLayout | Create an input-layout object to describe the input-buffer data for the input-assembler stage | Yes | Graphic object | ID3D11Device->CreateInputLayout()
ID3D11DeviceContext->IASetInputLayout() | ------ | | 2.10 | DefinePrimitiveTopology | Bind information about the primitive type, and data order that describes input data for the input assembler stage | Yes | Graphic object | ID3D11DeviceContext->IASetPrimitiveTopology() | ------ | | 2.11 | DefineViewPorts | Bind an array of viewports to the rasterizer stage of the pipeline | Yes | Graphic object | ID3D11DeviceContext->RSSetViewports() | ------ | | 2.12 | DrawPrimitive | Draw primitives | Yes | Graphic object | ID3D11DeviceContext->DrawIndexed() | ------ | | 3 | Present | Presents a rendered image to the user | Yes | Frame | IDXGISwapChain->Present method() | ------ |