Status – Week 252 Victor Moya. Summary Command Processor. Command Processor. Memory Controller. Memory Controller. Streamer. Streamer. Rasterizer. Rasterizer.

Slides:



Advertisements
Similar presentations
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Advertisements

Graphics Pipeline.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Status – Week 250 Victor Moya. Summary Current State. Current State. Next Tasks. Next Tasks. Future Work. Future Work. Creditos investigación. Creditos.
Status – Week 249 Victor Moya. Summary MemoryController. MemoryController. Streamer. Streamer. TraceDriver. TraceDriver. Statistics. Statistics.
OpenGL Curves & Surfaces. Where u varies in some domain (say [0,1]). A Bezier surface patch is a vector-valued function of two variables Evaluators A.
Status – Week 259 Victor Moya. Summary OpenGL Traces. OpenGL Traces. DirectX Traces. DirectX Traces. Proxy CPU. Proxy CPU. Command Processor. Command.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Chapter.
Status – Week 247 Victor Moya. Summary Streamer. Streamer. TraceDriver. TraceDriver. bGPU bGPU Signal Traffic Analyzer. Signal Traffic Analyzer.
Status – Week 243 Victor Moya. Summary Current status. Current status. Tests. Tests. XBox documentation. XBox documentation. Post Vertex Shader geometry.
OpenGL and Projections
Status – Week 231 Victor Moya. Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization.
Status – Week 242 Victor Moya. Summary Current status. Current status. Tests. Tests. XBox documentation. XBox documentation. Post Vertex Shader geometry.
Status – Week 277 Victor Moya.
GPU Simulator Victor Moya. Summary Rendering pipeline for 3D graphics. Rendering pipeline for 3D graphics. Graphic Processors. Graphic Processors. GPU.
Status – Week 248 Victor Moya. Summary Streamer. Streamer. TraceDriver. TraceDriver. bGPU bGPU Signal Traffic Analyzer. Signal Traffic Analyzer. How to.
Status – Week 255 Victor Moya. Summary Command Processor. Command Processor. Memory Controller. Memory Controller. Streamer. Streamer. Vertex buffers.
Status – Week 254 Victor Moya. Summary Command Processor. Command Processor. Memory Controller. Memory Controller. Streamer. Streamer. Vertex buffers.
Status – Week 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
The programmable pipeline Lecture 10 Slide Courtesy to Dr. Suresh Venkatasubramanian.
OpenGL (II). How to Draw a 3-D object on Screen?
Status – Week 260 Victor Moya. Summary shSim. shSim. GPU design. GPU design. Future Work. Future Work. Rumors and News. Rumors and News. Imagine. Imagine.
Status – Week 245 Victor Moya. Summary Streamer Streamer Creditos investigación. Creditos investigación.
Buffer Objects Kurt Akeley, NVIDIA Corporation. Outline Background Buffer Objects Vertex Arrays Examples.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Computer Graphics 3 Lecture 3: OpenGL Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
Korea University Korea University Computer Graphics Laboratory Computer Graphics Laboratory Jung Lee, Chapter 13.
2002 by Jim X. Chen: 1 So far, we only concerned with the rendering of geometric data. Two other important classes of data:
Interactive Computer Graphics CS 418 – Spring 2015 Mesh Rendering, Transformation, Camera Viewing and Projection in OpenGL TA: Zhicheng Yan Sushma S Kini.
Ch 2 Graphics Programming page 1 CSC 367 Coordinate Systems (2.1.2) Device coordinates, or screen coordinates (pixels) put limitations on programmers and.
Modeling with OpenGL Practice with OpenGL transformations.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
OpenGL Selection. Three Selection Methods Color coding (OpenGL) Selection mode (OpenGL) Selection ray (generic)
Review of OpenGL Basics
OpenGL Shader Language Vertex and Fragment Shading Programs.
1 3D API OPENGL ES v1.0 Owned by Silicon Graphics (SGL) Control was then transferred to Khronos Group Introduction.
Draw a Simple Object. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture blending.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 OpenGL Transformations.
Viewing and Transformation. Pixel pipeline Vertex pipeline Course Map Transformation & Lighting Primitive assembly Viewport culling & clipping Texture.
OpenGL-ES 3.0 And Beyond Boston Photo credit :Johnson Cameraface OpenGL Basics.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
OpenGL: The Open Graphics Language Introduction By Ricardo Veguilla.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Lecture.
 Learn some important functions and process in OpenGL ES  Draw some triangles on the screen  Do some transformation on each triangle in each frame.
Chap 3 Viewing and Transformation
Ray Tracing using Programmable Graphics Hardware
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
Mesh Skinning Sébastien Dominé. Agenda Introduction to Mesh Skinning 2 matrix skinning 4 matrix skinning with lighting Complex skinning for character.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The GPU.
Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 GPU.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
- Introduction - Graphics Pipeline
Draw a Simple Object.
Graphics on GPU © David Kirk/NVIDIA and Wen-mei W. Hwu,
Chapter 6 GPU, Shaders, and Shading Languages
CS451Real-time Rendering Pipeline
OpenGL (Open Graphics Library) Mr. B.A.Swamy Assistant Professor Dept of CSE.
Day 05 Shader Basics.
Programming with OpenGL Part 3: Shaders
CS 480/680 Computer Graphics GLSL Overview.
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

Status – Week 252 Victor Moya

Summary Command Processor. Command Processor. Memory Controller. Memory Controller. Streamer. Streamer. Rasterizer. Rasterizer. Vertex buffers in OpenGL. Vertex buffers in OpenGL. ARB_vertex_buffer_object. ARB_vertex_buffer_object. TraceDriver. TraceDriver.

Command Processor Memory Controller Streamer Vertex Shader CommProcMemoryWrite CommProcMemoryRead StreamerMemoryReq StreamerMemoryReadStreamerCrontrol StreamerState ShaderStateShaderCommand

Vertex Shader Command Processor CommShaderCommand CommShaderState Rasterizer (Fake) ShaderOutput ConsumerState RasterizerCommand RasterizerState

Memory Controller MemoryModule Rasterizer (Fake) RastMemoryRead RastMemoryRequest

Command Processor Stores all GPU state (debug?). Stores all GPU state (debug?). Receives data from AGP and sends it to the Memory Controller. Receives data from AGP and sends it to the Memory Controller. Receives state changes and sends them to the GPU units. Receives state changes and sends them to the GPU units. Receives commands and issues them to the GPU units. Receives commands and issues them to the GPU units.

Command Processor Missing some comunication code with the other units (shaders, rasterizer). Missing some comunication code with the other units (shaders, rasterizer). Missing commands to other units. Missing commands to other units. Missing code for some states. Missing code for some states. Missing AGP_READ and AGP_REG_READ (not useful right now). Missing AGP_READ and AGP_REG_READ (not useful right now).

Memory Controller Access to memory modules => Signal. Access to memory modules => Signal. To decide: number of transactions in process at the same time. To decide: number of transactions in process at the same time. Currently only one transaction at a time. Currently only one transaction at a time. Support multiple modules and multiple banks per module. Support multiple modules and multiple banks per module.

Streamer Two modes: Two modes: Streaming mode. Streaming mode. Index based streaming mode. Index based streaming mode. Streaming mode: Streaming mode: 1) get data for each active attribute. 1) get data for each active attribute. 2) store vertex input data in the FIFO. 2) store vertex input data in the FIFO. 3) send vertex input to a vertex shader. 3) send vertex input to a vertex shader. 4) repeat until end. 4) repeat until end.

Streamer Index based streaming mode: Index based streaming mode: 1) get index data. 1) get index data. 2) get vertex attribute data using index information. 2) get vertex attribute data using index information. 3) store vertex input in FIFO. 3) store vertex input in FIFO. 4) send vertex input to vertex shader. 4) send vertex input to vertex shader. 5) repeat until end. 5) repeat until end.

Streamer Accessing to attribute data in stream mode: Accessing to attribute data in stream mode: Direct access. Direct access. Double buffer (pipelined: read first, process first/read second, read first/process second). Double buffer (pipelined: read first, process first/read second, read first/process second). Accessing to attribute data in index mode: Accessing to attribute data in index mode: Attribute buffer could work like a cache? Attribute buffer could work like a cache? Number of attributes per ‘cache line’. Number of attributes per ‘cache line’. Replacement policy. Replacement policy.

Streamer from Memory Controller Attribute Buffers (16?) Vertex Input Vertex FIFO to Vertex Shader Index Buffer

Rasterizer Fake rasterizer. Fake rasterizer. Emulates: Emulates: Division by w. Division by w. Clipping. Clipping. Culling. Culling. Rasterization. Rasterization. Fragment and texturing. Fragment and texturing. OpenGL/GLUT wrapper. OpenGL/GLUT wrapper.

Rasterizer Setup OpenGL/GLUT: Setup OpenGL/GLUT: Window size and format. Window size and format. Rasterization settings: Rasterization settings: Projection mode. Projection mode. Clip planes. Clip planes. Textures. Textures. … Stores transformed vertexs. Stores transformed vertexs. Draws transformed vertexs (OpenGL). Draws transformed vertexs (OpenGL). Framebuffer swap. Framebuffer swap.

Vertex Arrays in OpenGL Array definition functions: Array definition functions: VertexPointer(int size, enum type, sizei stride, void *pointer). VertexPointer(int size, enum type, sizei stride, void *pointer). NormalPointer(enum type, sizei stride, void *pointer). NormalPointer(enum type, sizei stride, void *pointer). ColorPointer(int size, enum type, sizei stride, void *pointer). ColorPointer(int size, enum type, sizei stride, void *pointer). SecondaryColorPointer(int size, enum type, sizei stride, void *pointer). SecondaryColorPointer(int size, enum type, sizei stride, void *pointer). IndexPointer(enum type, sizei stride, void *pointer). IndexPointer(enum type, sizei stride, void *pointer). FogCoordPointer(enum type, sizei stride, void *pointer). FogCoordPointer(enum type, sizei stride, void *pointer). TexCoordPointer(int size, enum type, sizei stride, void *pointer). TexCoordPointer(int size, enum type, sizei stride, void *pointer). EdgeFlagPointer(sizei stride, void *pointer). EdgeFlagPointer(sizei stride, void *pointer). VertexAttribPointerARB(uint index, int size, enum type, boolean normalized, sizei stride, const void *pointer). VertexAttribPointerARB(uint index, int size, enum type, boolean normalized, sizei stride, const void *pointer). InterleavedArrays(enum format, sizei stride, void *pointer). InterleavedArrays(enum format, sizei stride, void *pointer).

Vertex Arrays in OpenGL Array drawing functions: Array drawing functions: DrawArrays(enum mode, int first, sizei count). DrawArrays(enum mode, int first, sizei count). MultiDrawArrays(enum mode, int *first, sizei *count, sizei primcount). MultiDrawArrays(enum mode, int *first, sizei *count, sizei primcount). DrawElements(enum mode, sizei count, enum type, void *indices). DrawElements(enum mode, sizei count, enum type, void *indices). MultiDrawElements(enum mode, sizei *count, enum type, void **indices, sizei primcount). MultiDrawElements(enum mode, sizei *count, enum type, void **indices, sizei primcount). DrawRangeElements(enum mode, uint start, unit end, sizei count, enum type, void *indices). DrawRangeElements(enum mode, uint start, unit end, sizei count, enum type, void *indices).

ARB_vertex_buffer_object BindBufferARB(enum target, uint buffer). BindBufferARB(enum target, uint buffer). DeleteBuffersARB(sizei n, const uint *buffers). DeleteBuffersARB(sizei n, const uint *buffers). GenBuffersARB(sizei n, uint *buffers). GenBuffersARB(sizei n, uint *buffers). boolean IsBufferARB(uint buffer). boolean IsBufferARB(uint buffer). BufferDataARB(enum target, sizeiptrARB size, const void *data, enum usage). BufferDataARB(enum target, sizeiptrARB size, const void *data, enum usage). BufferSubDataARB(enum target, intptrARB offset, sizeiptrARB size, const void *data). BufferSubDataARB(enum target, intptrARB offset, sizeiptrARB size, const void *data). GetBufferSubDataARB(enum target, intptrARB offset, sizeiptrARB size, void *data). GetBufferSubDataARB(enum target, intptrARB offset, sizeiptrARB size, void *data). void *MapBufferARB(enum target, enum access). void *MapBufferARB(enum target, enum access). boolean UnMapBufferARB(enum target). boolean UnMapBufferARB(enum target).

ARB_vertex_buffer_object target: target: ARRAY_BUFFER_ARB. ARRAY_BUFFER_ARB. ELEMENT_ARRAY_BUFFER_ARB. ELEMENT_ARRAY_BUFFER_ARB. usage: usage: STREAM_DRAW_ARB STREAM_DRAW_ARB STREAM_READ_ARB STREAM_READ_ARB STREAM_COPY_ARB STREAM_COPY_ARB STATIC_DRAW_ARB STATIC_DRAW_ARB STATIC_READ_ARB STATIC_READ_ARB STATIC_COPY_ARB STATIC_COPY_ARB DYNAMIC_DRAW_ARB DYNAMIC_DRAW_ARB DYNAMIC_READ_ARB DYNAMIC_READ_ARB DYNAMIC_COPY_ARB DYNAMIC_COPY_ARB

ARB_vertex_buffer_object access: access: READ_ONLY_ARB. READ_ONLY_ARB. WRITE_ONLY_ARB. WRITE_ONLY_ARB. READ_WRITE_ARB. READ_WRITE_ARB.

TraceDriver Translates driver traces to AGP Transactions for the Command Processor. Translates driver traces to AGP Transactions for the Command Processor. Uses TraceReader. Uses TraceReader. Interface: Interface: startTrace(). startTrace(). bool nextAGPTransaction(AGPTransaction *agpTrans). bool nextAGPTransaction(AGPTransaction *agpTrans).

TraceDriver OpenGL trace example: OpenGL trace example: wglChoosePixelFormat(0x460108C9,... wglDescribePixelFormat(0x460108C9,4,40,... wglChoosePixelFormat(0x460108C9,... wglDescribePixelFormat(0x460108C9,4,40,... wglSetPixelFormat(0x460108C9,4,... wglGetPixelFormat(0x460108C9) = 4 wglDescribePixelFormat(0x460108C9,4,40,... wglGetPixelFormat(0x460108C9) = 4 wglDescribePixelFormat(0x460108C9,1,0,) = 75 wglCreateContext(0x460108C9) = 0x10000 wglGetCurrentContext() = 0x0 wglGetCurrentDC() = 0x0 wglGetPixelFormat(0x460108C9) = 4 wglDescribePixelFormat(0x460108C9,4,40,...

TraceDriver GLX (X11) and wgl (win32) display and window initializations. GLX (X11) and wgl (win32) display and window initializations. Just ignore for now. Just ignore for now. Important information: Important information: pixel/framebuffer format. pixel/framebuffer format. But we can pass without it for now: But we can pass without it for now: assume 32bits RGBA (8 bits per component) standard fb format. assume 32bits RGBA (8 bits per component) standard fb format.

TraceDriver Example: Example: glClearColor( , , , )glShadeModel(GL_FLAT) wglGetCurrentContext() = 0x10000 wglGetCurrentDC() = 0x460108C9 glViewport(0,0,250,250)glMatrixMode(GL_PROJECTION)glLoadIdentity()glOrtho( , , , , , )glMatrixMode(GL_MODELVIEW)glLoadIdentity()

TraceDriver glClearColor( , , , ) glClearColor( , , , ) AGP_REG_WRITE: GPU_COLOR_BUFFER_CLEAR, (u32bit?)0 AGP_REG_WRITE: GPU_COLOR_BUFFER_CLEAR, (u32bit?)0 glShadeModel(GL_FLAT) glShadeModel(GL_FLAT) AGP_REG_WRITE: GPU_INTERPOLATION, TRUE AGP_REG_WRITE: GPU_INTERPOLATION, TRUE wglGetCurrentContext() = 0x10000 wglGetCurrentContext() = 0x10000 wglGetCurrentDC() = 0x460108C9 ignore for now. ignore for now. glViewport(0,0,250,250) glViewport(0,0,250,250) AGP_REG_WRITE: GPU_VIEWPORT_INI_X, 0 AGP_REG_WRITE: GPU_VIEWPORT_INI_X, 0 AGP_REG_WRITE: GPU_VIEWPORT_INI_Y, 0 AGP_REG_WRITE: GPU_VIEWPORT_INI_Y, 0 AGP_REG_WRITE: GPU_VIEWPORT_HEIGHT AGP_REG_WRITE: GPU_VIEWPORT_HEIGHT AGP_REG_WRITE: GPU_VIEWPORT_WIDTH AGP_REG_WRITE: GPU_VIEWPORT_WIDTH

TraceDriver glMatrixMode(GL_PROJECTION) glMatrixMode(GL_PROJECTION) Driver internal state -> Current matrix is the projection matrix. Driver internal state -> Current matrix is the projection matrix. Changes to matrix state affect only to the internal projection matrix. Changes to matrix state affect only to the internal projection matrix. glLoadIdentity() glLoadIdentity() Driver internal state -> load current matrix with identity matrix. Driver internal state -> load current matrix with identity matrix. glOrtho( , , , , , ) glOrtho( , , , , , ) Selects orthogonal projection (?): Selects orthogonal projection (?): AGP_REG_WRITE: GPU_PROJECTION, ORTHOGONAL AGP_REG_WRITE: GPU_PROJECTION, ORTHOGONAL Creates and stores orthogonal projection matrix. Creates and stores orthogonal projection matrix.

TraceDriver glMatrixMode(GL_MODELVIEW) glMatrixMode(GL_MODELVIEW) Driver internal state -> Current matrix is the model view matrix. Driver internal state -> Current matrix is the model view matrix. Changes to matrix state affect only to the internal model view matrix. Changes to matrix state affect only to the internal model view matrix. glLoadIdentity() glLoadIdentity() Driver internal state -> load current matrix with identity matrix. Driver internal state -> load current matrix with identity matrix.

TraceDriver Example: Example: wglGetCurrentContext() = 0x10000 wglGetCurrentDC() = 0x460108C9 glClear(GL_COLOR_BUFFER_BIT)glPushMatrix()glRotatef( , , , )glColor3f( , , )glRectf( , , , )glPopMatrix() wglSwapBuffers(0x460108C9) = TRUE

TraceDriver wglGetCurrentContext() = 0x10000 wglGetCurrentContext() = 0x10000 wglGetCurrentDC() = 0x460108C9 Ignore for now. Ignore for now. glClear(GL_COLOR_BUFFER_BIT) glClear(GL_COLOR_BUFFER_BIT) AGP_COMMAND: GPU_CLEARCOLORBUFFER AGP_COMMAND: GPU_CLEARCOLORBUFFER glPushMatrix() glPushMatrix() Driver internal state -> push current matrix value in the state stack. Driver internal state -> push current matrix value in the state stack. glRotatef( , , , ) glRotatef( , , , ) Update (multiply?) the current with the calculated rotation matrix. Update (multiply?) the current with the calculated rotation matrix.

TraceDriver glColor3f( , , ) glColor3f( , , ) Driver internal state -> set current vertex color. Driver internal state -> set current vertex color. glRectf( , , , ) glRectf( , , , ) Not the best example but … a lot of work to do. Not the best example but … a lot of work to do. Set other clipping/rasterization/etc default state. Set other clipping/rasterization/etc default state. Create a vertex stream: two triangles (6 vertices) forming the rectangle using the default color as vertex color. Create a vertex stream: two triangles (6 vertices) forming the rectangle using the default color as vertex color. Send that vertex data to the GPU -> AGP_WRITE. Send that vertex data to the GPU -> AGP_WRITE. Set the Streamer -> AGP_REG_WRITE. Set the Streamer -> AGP_REG_WRITE. Set the Vertex Shaders -> AGP_REG_WRITE: Set the Vertex Shaders -> AGP_REG_WRITE: Set constant bank (matrices, light parameters, …). Set constant bank (matrices, light parameters, …). Select/build vertex program and set. Select/build vertex program and set. Start drawing: AGP_COMMAND: GPU_DRAW. Start drawing: AGP_COMMAND: GPU_DRAW.

TraceDriver glPopMatrix() glPopMatrix() Driver internal state change -> pop from the state stack the value for the current activ matrix. Driver internal state change -> pop from the state stack the value for the current activ matrix. wglSwapBuffers(0x460108C9) = TRUE wglSwapBuffers(0x460108C9) = TRUE Swap frontbuffer and backbuffer (display current frame). Swap frontbuffer and backbuffer (display current frame). AGP_COMMAND: GPU_SWAPBUFFERS AGP_COMMAND: GPU_SWAPBUFFERS