SlideShare a Scribd company logo
Introduction to DirectX
     Programming
     Direct3D Pipeline
Contents
• GPU programming model
• Introduction to DirectX
  – Direct3D
  – DXGI
  – HLSL
  – COM essentials
• Direct3D pipeline
GPU Architecture
• Well-suited for data-parallel computations
• Lower requirement for sophisticated flow control
CPU-GPU Relationship
• GPU: coprocessor with its own memory

            CPU                               GPU


 Core   Core      Core   Core
                                PCIe x16
                                   2.0
                                (8 GB/s)
                                                    (~150 GB/s)
 IMC (~30 GB/s)
                                           GPU Memory
        Main Memory
Programming with GPU
• Various APIs and technologies
  – Graphics programming
  – General-purpose GPU programming

                     Applications



        DirectX   OpenGL      CUDA    OpenCL



                        GPU
Introduction to DirectX
• Set of low-level APIs for creating high-
  performance multimedia applications, on
  Microsoft platforms (Windows, Xbox, …)
• Components
         2-D and 3-D graphics          Direct3D
                Sound           XAudio2, X3DAudio, XACT
                Input                   XInput


• DirectX SDK (Software Development Kit)
  – Libraries, header files, utilities, sample codes and docs
Direct3D
• API for rendering 2-D and 3-D graphics
• Hardware acceleration if available
• Advanced graphics capabilities
  – Graphics pipeline, z-buffering, anti-aliasing, alpha
    blending, mipmapping, …

• Abstractions
  – Pipeline stages, device, resource, swap chain, …

• API as set of COM-compliant objects
DXGI
• DirectX Graphics Infrastructure
  – Manages low-level tasks independent of DirectX
    graphics runtime
  – Common framework for future graphics components
• Supported tasks
  –   Enumerating adapters
  –   Managing swap chain
  –   Handling window resizing
  –   Choosing DXGI output and size
  –   Debugging in full-screen mode
Adapter
• Abstraction of hardware/software capability used
  by graphics applications
  – Hardware: video card, …
  – Software: Direct3D reference device, …
Swap Chain
• Encapsulates two or more buffers used for
  rendering and display
• Front buffer
  – Presented to display device
• Back buffer
  – Render target
• Presents back buffer by swapping two buffers
• Properties
  – Size of render area, display refresh rate, display mode,
    surface format, …
HLSL
• High Level Shading Language for DirectX
• For writing codes for programmable shaders in
  Direct3D pipeline
• Implements series of shader models

Shader Model     Shader Profiles                                                  Direct3D support
Shader model 1   vs_1_1                                                           Direct3D 9
Shader model 2   ps_2_0, ps_2_x, vs_2_0, vs_2_x
Shader model 3   ps_3_0, vs_3_0
Shader model 4   gs_4_0, ps_4_0, vs_4_0, gs_4_1, ps_4_1, vs_4_1                   Direct3D 10
Shader model 5   cs_4_0, cs_4_1, cs_5_0, ds_5_0, gs_5_0, hs_5_0, ps_5_0, vs_5_0   Direct3D 11
Compiling HLSL
• Shader profile
  – Target for compiling shader

a. Compile at runtime
  – D3DX11CompileFromFile function to compile from
    HLSL file
  – D3DCompile function to compile HLSL code in
    memory

b. Compile offline
  – FXC: shader-compiler tool (effect-compiler tool)
COM Essentials
• Component Object Model
  –   Binary standard
  –   Platform-independent
  –   Distributed
  –   Object-oriented

• COM-based technologies
  – OLE
  – ActiveX
  – Many components in Windows
COM Interfaces
• Object exposes set of interfaces
• Interface consists of group of related methods
• Application (client) use object through interfaces

                         Applications


                      IMyInterfaceA     IMyInterfaceB

                          IUnknown


                         COM Object
IUnknown Interface
• Every object implements IUnknown interface
Method                  Description
QueryInterface          Retrieves pointers to the supported interfaces on object
AddRef                  Increments reference count for interface on object
Release                 Decrements reference count for interface on object


COM in C++                                          // unknwn.h

Interface                Abstract class             class IUnknown
                                                    {
Interface method         Pure virtual function      public:
                                                        virtual HRESULT QueryInterface (
Interface inheritance    Class derivation                   /* [in] */ REFIID riid,
                          – Interface inheritance           /* [out] */ void** ppvObject ) = 0;
                          – No code reuse               virtual ULONG AddRef() = 0;
                                                        virtual ULONG Release() = 0;
Interface pointer        Pointer to class           };
Using COM Objects
Users                        Developers
• Initialize COM library     • Publish interfaces
• Create object and obtain       – Documents describing behavior of
                                   interface methods
  pointer of interface
• Use interface methods      • Provide interface
• Release object               implementation (in binary form)


Example in C++
 IMyInterface* my;           bool CreateMyObject(IMyInterface** pp);
 CreateMyObject(&my);
                             class IMyInterface
 HRESULT hr;                 {
 hr = my->MyMethod(i);       public:
                                 virtual HRESULT MyMethod(int i) = 0;
 my->Release();              };
GUID
• Globally unique identifier
   – Unique reference number used as identifier
   – Implements universally unique identifier (UUID)
     standard
   – Represented by 32-character hexademical string
     (e.g., {21EC2020-3AEA-1069-A2DD-08002B30309D})
   – Usually stored as 128-bit integer

• Interface identifier (IID)
• Class identifier (CLSID)
Error Handling in COM
• HRESULT
  – 32-bit value used to            Internal structure
    describe the status
    after operation
                                  Return value/code              Description
                                  0x00000000 S_OK                Operation successful
                                  0x80004001 E_NOIMPL            Not implemented
                                  0x80004002 E_NOINTERFACE       Interface not supported
                                  0x80004004 E_ABORT             Operation aborted
                                  0x80004005 E_FAIL              Unspecified failure
                                  0x80070057 E_INVALIDARG        One or more arguments are invalid


                     Macro               Description
                     SUCCEEDED(hr)       TRUE if hr represents success status value; otherwise, FALSE
                     FAILED(hr)          TRUE if hr represents falied status value; otherwise, FALSE
Direct3D Return Codes
HRESULT                        Description
S_OK                           No error occurred.

S_FALSE                        Alternate success value, indicating a successful but nonstandard
                               completion (the precise meaning depends on context).
E_FAIL                         Attempted to create a device with the debug layer enabled and the layer
                               is not installed.
E_OUTOFMEMORY                  Direct3D could not allocate sufficient memory to complete the call.

E_INVALIDARG                   An invalid parameter was passed to the returning function.

D3DERR_INVALIDCALL             The method call is invalid. For example, a method's parameter may not
                               be a valid pointer.
D3D11_ERROR_FILE_NOT_FOUND     The file was not found.

D3D11_ERROR_TOO_MANY_UNIQUE_   There are too many unique instances of a particular type of state object.
STATE_OBJECTS
D3D11_ERROR_TOO_MANY_UNIQUE_   There are too many unique instances of a particular type of view object.
VIEW_OBJECTS

                                                                                        (not exhaustive)
Direct3D Pipeline
• Stages
    – Configured using API
• Shader stages
    – Programmable using HLSL

Stage             Abbr.   Description
Input-assembler   IA      Supplies data to pipeline
Vertex-shader     VS      Processes vertices
Rasterizer        RS      Converts vector data into pixels
Pixel-shader      PS      Generates per-pixel data
Output-merger     OM      Generates final pipeline result


                                                             (Note: Some stages are omitted for simplicity)
Input-Assembler Stage
• Primitive
  – Composed of one or more vertices
  – Point, line and triangle
  – Primitive types (or topologies)
     • Point list, line list, line strip, triangle list, triangle strip, …

• Reads input data from user-filled buffers and
  assembles data into primitives
• Attaches system-generated values
  – VertexID, PrimitiveID, InstanceID, …
Shader Stages
• Vertex/hull/domain/geometry/pixel-shader and
  compute-shader
• Built on common shader core
• Programmable with HLSL
 Classification                 Methods
 Creating shader object         ID3D11Device::Create[Vertex]Shader
 Setting shader to use          ID3D11DeviceContext::[VS]SetShader
 Setting up each shader stage   ID3D11DeviceContext::[VS]SetConstantBuffers
                                ID3D11DeviceContext::[VS]SetShaderResources
                                ID3D11DeviceContext::[VS]SetSamplers
                                ID3D11DeviceContext::CSSetUnorderedAccessViews
                                Note: [VS] means one of VS, HS, DS, GS, PS and CS, and
                                      [Vertex] one of Vertex, Hull, Domain, Geometry, Pixel and Compute
Vertex-Shader Stage
• Processes each vertex of primitives from IA
  – Performs per-vertex operations (transformations,
    skinning, morphing, per-vertex lighting, …)
• Single input vertex, single output vertex
  – Each vertex data can contain up to 16 vectors
  – Always run on all vertices
• Some texture methods available
  – Load, Sample, SampleCmpLevelZero, SampleGrad, …
• Mandatory stage
Rasterizer Stage
• Converts each primitive into pixels
  – Interpolating per-vertex values across primitive
• Performed operations
  – Clipping vertices to view frustum
  – Culling out back faces
  – Performing divide by z to provide perspective
    (input vertex positions assumed to be in
    homogeneous clip-space)
  – Mapping primitives to 2-D viewport
  – Determining how to invoke pixel shader
Pixel-Shader Stage
• Enables rich shading techniques and more
  – Per-pixel lighting, post-processing, ray-casting, …
• Processes each pixel from rasterizer stage
  – Interpolated per-pixel values as input
• Generated output
  – One or more colors (to be written to render targets)
  – Optional depth value
    (replacing the one interpolated by rasterizer)
• All texture methods available
Output-Merger Stage
• Generates final rendered pixel color
• Combines relevant information
   – Pipeline state, pixel data from PS, contents of render
     targets, contents of depth/stencil buffers, …

• Final step in pipeline
   – Determines visibility of pixels (depth-stencil testing)
   – Blends final pixel colors

More Related Content

PPT
Spdas2 vlsibput
PDF
VHDL- gate level modelling
PPTX
Data types and Operators Continued
PDF
Basics of building a blackfin application
PPT
Assembler
PDF
Verilog
ODP
VHDL Packages, Coding Styles for Arithmetic Operations and VHDL-200x Additions
PDF
Verilog tutorial
Spdas2 vlsibput
VHDL- gate level modelling
Data types and Operators Continued
Basics of building a blackfin application
Assembler
Verilog
VHDL Packages, Coding Styles for Arithmetic Operations and VHDL-200x Additions
Verilog tutorial

What's hot (20)

PDF
Basic structures in vhdl
PDF
Vhdl 1 ppg
PDF
VHDL- data types
PDF
iOS 101 - Xcode, Objective-C, iOS APIs
PDF
Object Oriented Programming using C++ - Part 2
PDF
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...
PDF
Vhdl introduction
PPTX
Basics of Vhdl
PPT
Assembler
PPT
Assembler
PDF
C# for beginners
PPT
Introduction toc sharp
PDF
Introduction to VHDL
PPTX
How to design Programs using VHDL
PPT
Introduction to-csharp
PPTX
Vhdl basic unit-2
PPT
Crash course in verilog
PPTX
Introduction to Objective - C
Basic structures in vhdl
Vhdl 1 ppg
VHDL- data types
iOS 101 - Xcode, Objective-C, iOS APIs
Object Oriented Programming using C++ - Part 2
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...
Vhdl introduction
Basics of Vhdl
Assembler
Assembler
C# for beginners
Introduction toc sharp
Introduction to VHDL
How to design Programs using VHDL
Introduction to-csharp
Vhdl basic unit-2
Crash course in verilog
Introduction to Objective - C
Ad

Similar to 02 direct3 d_pipeline (20)

PDF
3 boyd direct3_d12 (1)
PDF
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
PDF
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
PPTX
NvFX GTC 2013
PDF
The Next Mainstream Programming Language: A Game Developer's Perspective
PPTX
Graphics Libraries
PPTX
arduinoedit.pptx
PDF
Unmanaged Parallelization via P/Invoke
PPTX
Android RenderScript
PDF
Gdc 14 bringing unreal engine 4 to open_gl
PDF
Rider - Taking ReSharper out of Process
PPT
Introduction to parallel computing using CUDA
PPTX
Shape12 6
PDF
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
PPTX
RenderScript
PPTX
The next generation of GPU APIs for Game Engines
PPTX
Track c-High speed transaction-based hw-sw coverification -eve
PPTX
Madeo - a CAD Tool for reconfigurable Hardware
PPTX
VHDL_VIKAS.pptx
PPT
Game development
3 boyd direct3_d12 (1)
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
NvFX GTC 2013
The Next Mainstream Programming Language: A Game Developer's Perspective
Graphics Libraries
arduinoedit.pptx
Unmanaged Parallelization via P/Invoke
Android RenderScript
Gdc 14 bringing unreal engine 4 to open_gl
Rider - Taking ReSharper out of Process
Introduction to parallel computing using CUDA
Shape12 6
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
RenderScript
The next generation of GPU APIs for Game Engines
Track c-High speed transaction-based hw-sw coverification -eve
Madeo - a CAD Tool for reconfigurable Hardware
VHDL_VIKAS.pptx
Game development
Ad

Recently uploaded (20)

PDF
Pre independence Education in Inndia.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
RMMM.pdf make it easy to upload and study
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
master seminar digital applications in india
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Pharma ospi slides which help in ospi learning
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Sports Quiz easy sports quiz sports quiz
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Pre independence Education in Inndia.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
human mycosis Human fungal infections are called human mycosis..pptx
Cell Structure & Organelles in detailed.
RMMM.pdf make it easy to upload and study
TR - Agricultural Crops Production NC III.pdf
master seminar digital applications in india
PPH.pptx obstetrics and gynecology in nursing
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
102 student loan defaulters named and shamed – Is someone you know on the list?
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Pharma ospi slides which help in ospi learning
FourierSeries-QuestionsWithAnswers(Part-A).pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Cell Types and Its function , kingdom of life
Sports Quiz easy sports quiz sports quiz
STATICS OF THE RIGID BODIES Hibbelers.pdf
Insiders guide to clinical Medicine.pdf
Final Presentation General Medicine 03-08-2024.pptx

02 direct3 d_pipeline

  • 1. Introduction to DirectX Programming Direct3D Pipeline
  • 2. Contents • GPU programming model • Introduction to DirectX – Direct3D – DXGI – HLSL – COM essentials • Direct3D pipeline
  • 3. GPU Architecture • Well-suited for data-parallel computations • Lower requirement for sophisticated flow control
  • 4. CPU-GPU Relationship • GPU: coprocessor with its own memory CPU GPU Core Core Core Core PCIe x16 2.0 (8 GB/s) (~150 GB/s) IMC (~30 GB/s) GPU Memory Main Memory
  • 5. Programming with GPU • Various APIs and technologies – Graphics programming – General-purpose GPU programming Applications DirectX OpenGL CUDA OpenCL GPU
  • 6. Introduction to DirectX • Set of low-level APIs for creating high- performance multimedia applications, on Microsoft platforms (Windows, Xbox, …) • Components 2-D and 3-D graphics Direct3D Sound XAudio2, X3DAudio, XACT Input XInput • DirectX SDK (Software Development Kit) – Libraries, header files, utilities, sample codes and docs
  • 7. Direct3D • API for rendering 2-D and 3-D graphics • Hardware acceleration if available • Advanced graphics capabilities – Graphics pipeline, z-buffering, anti-aliasing, alpha blending, mipmapping, … • Abstractions – Pipeline stages, device, resource, swap chain, … • API as set of COM-compliant objects
  • 8. DXGI • DirectX Graphics Infrastructure – Manages low-level tasks independent of DirectX graphics runtime – Common framework for future graphics components • Supported tasks – Enumerating adapters – Managing swap chain – Handling window resizing – Choosing DXGI output and size – Debugging in full-screen mode
  • 9. Adapter • Abstraction of hardware/software capability used by graphics applications – Hardware: video card, … – Software: Direct3D reference device, …
  • 10. Swap Chain • Encapsulates two or more buffers used for rendering and display • Front buffer – Presented to display device • Back buffer – Render target • Presents back buffer by swapping two buffers • Properties – Size of render area, display refresh rate, display mode, surface format, …
  • 11. HLSL • High Level Shading Language for DirectX • For writing codes for programmable shaders in Direct3D pipeline • Implements series of shader models Shader Model Shader Profiles Direct3D support Shader model 1 vs_1_1 Direct3D 9 Shader model 2 ps_2_0, ps_2_x, vs_2_0, vs_2_x Shader model 3 ps_3_0, vs_3_0 Shader model 4 gs_4_0, ps_4_0, vs_4_0, gs_4_1, ps_4_1, vs_4_1 Direct3D 10 Shader model 5 cs_4_0, cs_4_1, cs_5_0, ds_5_0, gs_5_0, hs_5_0, ps_5_0, vs_5_0 Direct3D 11
  • 12. Compiling HLSL • Shader profile – Target for compiling shader a. Compile at runtime – D3DX11CompileFromFile function to compile from HLSL file – D3DCompile function to compile HLSL code in memory b. Compile offline – FXC: shader-compiler tool (effect-compiler tool)
  • 13. COM Essentials • Component Object Model – Binary standard – Platform-independent – Distributed – Object-oriented • COM-based technologies – OLE – ActiveX – Many components in Windows
  • 14. COM Interfaces • Object exposes set of interfaces • Interface consists of group of related methods • Application (client) use object through interfaces Applications IMyInterfaceA IMyInterfaceB IUnknown COM Object
  • 15. IUnknown Interface • Every object implements IUnknown interface Method Description QueryInterface Retrieves pointers to the supported interfaces on object AddRef Increments reference count for interface on object Release Decrements reference count for interface on object COM in C++ // unknwn.h Interface Abstract class class IUnknown { Interface method Pure virtual function public: virtual HRESULT QueryInterface ( Interface inheritance Class derivation /* [in] */ REFIID riid, – Interface inheritance /* [out] */ void** ppvObject ) = 0; – No code reuse virtual ULONG AddRef() = 0; virtual ULONG Release() = 0; Interface pointer Pointer to class };
  • 16. Using COM Objects Users Developers • Initialize COM library • Publish interfaces • Create object and obtain – Documents describing behavior of interface methods pointer of interface • Use interface methods • Provide interface • Release object implementation (in binary form) Example in C++ IMyInterface* my; bool CreateMyObject(IMyInterface** pp); CreateMyObject(&my); class IMyInterface HRESULT hr; { hr = my->MyMethod(i); public: virtual HRESULT MyMethod(int i) = 0; my->Release(); };
  • 17. GUID • Globally unique identifier – Unique reference number used as identifier – Implements universally unique identifier (UUID) standard – Represented by 32-character hexademical string (e.g., {21EC2020-3AEA-1069-A2DD-08002B30309D}) – Usually stored as 128-bit integer • Interface identifier (IID) • Class identifier (CLSID)
  • 18. Error Handling in COM • HRESULT – 32-bit value used to Internal structure describe the status after operation Return value/code Description 0x00000000 S_OK Operation successful 0x80004001 E_NOIMPL Not implemented 0x80004002 E_NOINTERFACE Interface not supported 0x80004004 E_ABORT Operation aborted 0x80004005 E_FAIL Unspecified failure 0x80070057 E_INVALIDARG One or more arguments are invalid Macro Description SUCCEEDED(hr) TRUE if hr represents success status value; otherwise, FALSE FAILED(hr) TRUE if hr represents falied status value; otherwise, FALSE
  • 19. Direct3D Return Codes HRESULT Description S_OK No error occurred. S_FALSE Alternate success value, indicating a successful but nonstandard completion (the precise meaning depends on context). E_FAIL Attempted to create a device with the debug layer enabled and the layer is not installed. E_OUTOFMEMORY Direct3D could not allocate sufficient memory to complete the call. E_INVALIDARG An invalid parameter was passed to the returning function. D3DERR_INVALIDCALL The method call is invalid. For example, a method's parameter may not be a valid pointer. D3D11_ERROR_FILE_NOT_FOUND The file was not found. D3D11_ERROR_TOO_MANY_UNIQUE_ There are too many unique instances of a particular type of state object. STATE_OBJECTS D3D11_ERROR_TOO_MANY_UNIQUE_ There are too many unique instances of a particular type of view object. VIEW_OBJECTS (not exhaustive)
  • 20. Direct3D Pipeline • Stages – Configured using API • Shader stages – Programmable using HLSL Stage Abbr. Description Input-assembler IA Supplies data to pipeline Vertex-shader VS Processes vertices Rasterizer RS Converts vector data into pixels Pixel-shader PS Generates per-pixel data Output-merger OM Generates final pipeline result (Note: Some stages are omitted for simplicity)
  • 21. Input-Assembler Stage • Primitive – Composed of one or more vertices – Point, line and triangle – Primitive types (or topologies) • Point list, line list, line strip, triangle list, triangle strip, … • Reads input data from user-filled buffers and assembles data into primitives • Attaches system-generated values – VertexID, PrimitiveID, InstanceID, …
  • 22. Shader Stages • Vertex/hull/domain/geometry/pixel-shader and compute-shader • Built on common shader core • Programmable with HLSL Classification Methods Creating shader object ID3D11Device::Create[Vertex]Shader Setting shader to use ID3D11DeviceContext::[VS]SetShader Setting up each shader stage ID3D11DeviceContext::[VS]SetConstantBuffers ID3D11DeviceContext::[VS]SetShaderResources ID3D11DeviceContext::[VS]SetSamplers ID3D11DeviceContext::CSSetUnorderedAccessViews Note: [VS] means one of VS, HS, DS, GS, PS and CS, and [Vertex] one of Vertex, Hull, Domain, Geometry, Pixel and Compute
  • 23. Vertex-Shader Stage • Processes each vertex of primitives from IA – Performs per-vertex operations (transformations, skinning, morphing, per-vertex lighting, …) • Single input vertex, single output vertex – Each vertex data can contain up to 16 vectors – Always run on all vertices • Some texture methods available – Load, Sample, SampleCmpLevelZero, SampleGrad, … • Mandatory stage
  • 24. Rasterizer Stage • Converts each primitive into pixels – Interpolating per-vertex values across primitive • Performed operations – Clipping vertices to view frustum – Culling out back faces – Performing divide by z to provide perspective (input vertex positions assumed to be in homogeneous clip-space) – Mapping primitives to 2-D viewport – Determining how to invoke pixel shader
  • 25. Pixel-Shader Stage • Enables rich shading techniques and more – Per-pixel lighting, post-processing, ray-casting, … • Processes each pixel from rasterizer stage – Interpolated per-pixel values as input • Generated output – One or more colors (to be written to render targets) – Optional depth value (replacing the one interpolated by rasterizer) • All texture methods available
  • 26. Output-Merger Stage • Generates final rendered pixel color • Combines relevant information – Pipeline state, pixel data from PS, contents of render targets, contents of depth/stencil buffers, … • Final step in pipeline – Determines visibility of pixels (depth-stencil testing) – Blends final pixel colors