1 / 32

Status – Week 257

Status – Week 257. Victor Moya. Summary. GPU interface. GPU state. API/Driver State. Driver/CPU Proxy. Command Processor. Imagine. GPU Interface. The GPU chip interfaces with: AGP port. Local (video) memory.

anaya
Download Presentation

Status – Week 257

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Status – Week 257 Victor Moya

  2. Summary • GPU interface. • GPU state. • API/Driver State. • Driver/CPU Proxy. • Command Processor. • Imagine.

  3. GPU Interface • The GPU chip interfaces with: • AGP port. • Local (video) memory. • Output video signal (as DAC is integrated it is already raw digital or analog video signal). • Input Video signal (TV/Video capture). • We can ignore the output/input video signals. • Local memory is only accessed by the GPU chip. It can use any standard DRAM interface.

  4. GPU Interface Local Memory AGP Port Video Output Video Input

  5. GPU Interface: AGP Interface • GPU is connected through the AGP port to the CPU and main memory. • The CPU can issue commands, read and write data from/to the GPU through the AGP. • The GPU can read data and write data through the AGP.

  6. GPU Interface: AGP Interface • DMA can be used to read/write from/to the main memory to/from the video memory through the AGP. • The GPU can send IRQs to the CPU. • AGP can map main memory pages to the GPU (graphic overture).

  7. GPU Interface: AGP Interface • Intel describes the logical and physical (signaling) protocol for the AGP port. • Based in the PCI bus. • Transactions: • Read. • Write. • Control? • Do we need to simulate the AGP protocol?

  8. GPU Interface: AGP Interface • What do we need? • Data written to GPU local memory: • textures • vertex buffers • index buffers • display lists? • Data read from GPU local memory: • textures (render targets). • framebuffer: color + Z + stencil.

  9. GPU Interface: AGP Interface • What do we need? • Data read from the main memory: • AGP textures. • API/Driver buffers in system memory? • Data written to the main memory: • ??

  10. GPU Interfaces: AGP Interface • What do we need? • Control: • GPU commands: • Initialize display (resolution, viewport, pixel format …). • Start frame/end frame. • Draw batch (vertex buffer, indexed buffer, …).

  11. GPU Interface:AGP Interface • What do we need? • Control: • GPU state changes: • Primitive mode. • Clip planes. • Vertex shader program and vertex shader state. • Rasterization options • Texture state. • Pixel shader program and pixel shader state. • Fragment/Color state (color, Z, Stencil, fog, alpha, scissor, …). • Etc.

  12. GPU Interface: AGP Interface. • What do we need? • Signaling (IRQ) to the API/Driver? • End of DMA transfer?

  13. GPU Interface • Simple GPU interface: • Write to GPU memory. • Read from GPU memory. • Write GPU state. • Read GPU state. • Issue GPU command. • IRQ signal? • Termination: read/write, command.

  14. GPU Interface • Write to GPU memory: • Address, size, data -> • Read from GPU memory: • Address, size -> data • Write GPU state: • register, value -> • Read GPU state: • register -> value • Issue GPU command: • command, parameter list ->

  15. GPU Interface • Registers: • ViewPort Res X: screen resolution (INT). • ViewPort Res Y: screen resolution (INT). • Pixel Mode: bits per pixel, etc (PXFORMAT). • Color Buffer Address: local memory address for the color buffer (UINT). • Z/Stencil Buffer Address: local memory address for the Z and Stencil buffers (UINT). • Texture Memory Address: local memory address for the texture buffers (UINT)? • Program Memory Address: local memory address for the shader program buffers (UINT)?

  16. GPU Interface • Registers: • Clear Color: color buffer clear color (QF). • Primitive Mode: TRIANGLE, TRIANGLE STRIP, TRIANGLE FAN, POINT?, LINE?, LINE STRIP?, LINE FAN?. • Interpolation (shading?) Mode: FLAT, LINEAR. • Vertex Shader Program: vertex program ID/address (UINT). • Vertex Shader Constants: vertex program constants (QF[], QI []?, B[]?, I[]?).

  17. GPU Interface • Registers: • Vertex Stream0-n: ID/address to the current vertex buffer stream (UINT). • Vertex Stream Size0-n: Size of the stream (UINT). • Vertex Stream Stride0-n: stride of the stream (UINT). • Vertex Stream Mapping0-n: mapping to the vertex shader input registers. • Index Stream: ID/address to the current vertex buffer stream (UINT). • Index Stream Size: size of the stream (UINT).

  18. GPU Interface • Registers: • Clip Plane Left: left clip plane (FLOAT). • Clip Plane Right: right clip plane (FLOAT). • Clip Plane Top: top clip plane (FLOAT). • Clip Plane Bottom: bottom clip plane (FLOAT). • Clip Plane Near: near clip plane (FLOAT). • Clip Plane Far: far clip plane (FLOAT). • User Clip Planes0-n: User volume clip planes (QF). • Culling Mode: NONE, FRONT, BACK, FRONT_BACK.

  19. GPU Interface • Registers: • Multisampling related registers (?). • Supersampling related registers (?). • Point related registers (?). • Line related registers (?). • Zbias/Depth Offset: ?

  20. GPU Interface • Registers: • Texture related registers (?). • Pxel shader related state: • Pixel shader program: pixel shader program ID/address (UINT). • Pixel shader constants: pixel shader constant bank (QF[]). • Fog related registers (?).

  21. GPU Interface • Registers: • Scissor test related registers (?). • Alpha test related registers (?). • Stencil test related registers (?). • Depth test related registers (?). • Blending related registers (?). • Others (?).

  22. GPU Interface • Commands: • Reset: reset of the GPU. • No parameters: • Clear: clears all buffers? • No parameters. • SwapBuffer: changes the display (front) buffer. • No parameters?. • DrawBatch: draws a vertex batch (array). • No parameters (if the info is in the GPU registers). • DrawIndexedBatch: draw an indexed vertex batch. • No parameters (if the info is in the GPU registers).

  23. GPU Interface • Commands: • Blit: local memory to local memory copy. • Source address • Target address.

  24. GPU State • GPU control registers. • GPU status registers? • Queries. • End Of Frame. • Occlusion queries: number of pixels drawn.

  25. GPU State • Rendering mode: • IMR: Immediate Mode Renderer. • Only stores current state (immediate). • Deferred Rendering. • Must store all state changes for the next frame. • Must have stored the current (drawing) frame. • Perhaps some permanent state (resolution?). • Storage: • Local memory (Bin). • System memory (driver).

  26. API/Driver State • OpenGL: OpenGL specification has an appendix with all the OpenGL state variables. • DirectX: would need research. State based in COM objects.

  27. API/Driver emulation • Must translate API calls (OpenGL) and API objects (DirectX) to GPU commands. • Read a trace file and translate to GPU commands (static). • Replace system API libraries (dlls, shared libs) and send commands to a GPU simulator (dynamic).

  28. API/Driver emulation • First prototype for GLTrace traces: • Set initial state (resolution, etc). • Calculate the projection and model view matrix (multiplication). • Store the combinend matrix (multiplied) in the vertex shader constant memory. • Store the default transformation vertex shader program (vertex x matrix). • Translate glRectf into two triangles.

  29. API/Driver Emulation • Store vertex and vertex parameters between glBegin and glEnd functions. • Issue vertex and vertex parameters to the GPU. • Set other rasterization and fragment parameters for the OpenGL stub.

  30. API/Driver Emulation • Future development: • Add lightning and material state: store in vertex shader constant bank. • Create lightning vertex program. • Support DrawElements and other vertex array and index based rendering modes.

  31. Command Processor • Stores all or part of the GPU state. • GPU state can be replicated in the different sections of the GPU (geometry, rasterization, fragment). • Receives commands from the main system (API/driver). • Interprets and issues those commands to the GPU units.

  32. Imagine • ‘Computer Graphics on a Stream Architecture’, John Douglas Owens, PhD dissertation. • Not read yet either.

More Related