a crash course on programmable graphics hardware l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
A Crash Course on Programmable Graphics Hardware PowerPoint Presentation
Download Presentation
A Crash Course on Programmable Graphics Hardware

Loading in 2 Seconds...

play fullscreen
1 / 36

A Crash Course on Programmable Graphics Hardware - PowerPoint PPT Presentation


  • 128 Views
  • Uploaded on

A Crash Course on Programmable Graphics Hardware. Li-Yi Wei 2005 at Tsinghua University, Beijing. Why do we need graphics hardware?. The evolution of graphics hardware. SGI Origin 3400. NVIDIA Geforce 7800. 7 years of graphics accelenation.com/?doc=123&page=1. General & flexible

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'A Crash Course on Programmable Graphics Hardware' - layne


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
a crash course on programmable graphics hardware

A Crash Course on Programmable Graphics Hardware

Li-Yi Wei

2005

at Tsinghua University, Beijing

the evolution of graphics hardware
The evolution of graphics hardware

SGI Origin 3400

NVIDIA Geforce 7800

slide4
7 years of graphics
  • accelenation.com/?doc=123&page=1
ray tracing
General & flexible

Intuitive

Global illumination

Hard to accelerate

Ray tracing
polygonal graphics pipeline
Local computation

Easy to accelerate

Not general

Unintuitive

Polygonal graphics pipeline
graphics hierarchy
Layered approach

Like network layers

Encapsulation

Easy programming

Driver optimization

Driver workaround

Driver simulation

Protection

Hardware error check

Graphics hierarchy
overview
Overview
  • Graphics pipeline
    • Only high level overview (so you can program), not necessarily real hardware
  • GPU programming
application
Mostly on CPU

High level work

User interface

Control

Simulation

Physics

Artificial intelligence

Application
slide11
Gatekeeper of GPU

Command processing

Error checking

State management

Context switch

Host
geometry
Vertex processor

Primitive assembly

Clip & cull

Viewport transform

Geometry
vertex processor
Vertex Processor
  • Process one vertex at one time
    • No information on other vertices
  • Programmable
  • Transformation
  • Lighting
transformation
Transformation
  • Global to eye coordinate system
lighting
Lighting
  • Diffuse
  • Specular
transform light on vertex processor
Transform & Light on Vertex Processor
  • A sequence of assembly instructions
  • (more on this later)
primitive assembly
Primitive Assembly
  • Assemble individual vertices into triangle (or line or point)
  • Performance implication
    • A triangle is ready only when all 3 vertices are
    • Vertex coherence & caching
clipping culling
Clipping & Culling
  • Backface culling
    • Remove triangles facing away from view
    • Eliminate ½ of the triangles in theory
  • Clipping against view frustum
    • Triangles may become quadrilaterals
viewport transform
Viewport transform
  • From floating point range [-1, 1] x [-1, 1] to integer range [0, height-1] x [0, width-1]
rasterization
Convert primitives (triangles, lines) into pixels

Barycentric coordinate

Attribute interpolation

Rasterization
attribute interpolation
Attribute interpolation
  • Interpolation
  • Barycentric
fragment processor
Fragment: corresponds to a single pixel and includes color, depth, and sometimes texture-coordinate values.

Compute color and depth for each pixel

Most interesting part of GPU

Fragment processor
texture
Optional

(though hard to avoid)

Cache data

Hide latency from FB

Sampling/filtering

I told you this last time

Texture
rop raster operation
Write to framebuffer

Comparison

Z, stencil, alpha, window

ROP (Raster Operation)
framebuffer
Storing buffers and textures

Connect to display

Characteristics

Size

Bandwidth

Latency

Framebuffer
conceptual programming model
Inputs (read-only)

Attributes

Constants

Textures

Registers (read-write)

Used by shader

Outputs (write-only)

Attributes

Conceptual programming model
simple example
Simple example
  • HPOS: position
  • COL0: diffuse color
  • MOV o[HPOS], v[HPOS];
  • MOV o[COL0], v[COL0];
more complex example
More complex example
  • o[COL0] = v[COL0] + constant*v[HPOS];
  • MOV o[HPOS], v[HPOS];
  • MOV R0, v[COL0];
  • MAD R0, v[HPOS], c[0], R0;
  • MOV o[COL0], R0;
high level shading language
High-level shading language
  • Writing assembly is
    • Painful
    • Not portable
    • Not optimize-able
  • High level shading language solves these
    • Cg, HLSL
applications
Applications
  • Too many of them for me to describe here
  • The only way to learn is try to program
    • Useless for you even if I try to describe
  • Look at developer website
    • NVIDIA, ATI, GPGPU
homework
Homework
  • Try to program GPU!
    • Even without NVIDIA GPU, you can download the emulator
  • Stanford course on graphics hardware
    • http://www.graphics.stanford.edu/courses/cs448a-01-fall/
  • History of graphics hardware
    • 7 years of graphics
    • accelenation.com/?doc=123&page=1