Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 Status – Week 257 Victor Moya

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

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

4 GPU Interface Video Input Video Output AGP Port Local Memory

5 GPU Interface: AGP Interface GPU is connected through the AGP port to the CPU and main memory. 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 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. 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. 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. The GPU can send IRQs to the CPU. AGP can map main memory pages to the GPU (graphic overture). 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. Intel describes the logical and physical (signaling) protocol for the AGP port. Based in the PCI bus. Based in the PCI bus. Transactions: Transactions: Read. Read. Write. Write. Control? Control? Do we need to simulate the AGP protocol? Do we need to simulate the AGP protocol?

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

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

10 GPU Interfaces: AGP Interface What do we need? What do we need? Control: Control: GPU commands: 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? What do we need? Control: Control: GPU state changes: 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? What do we need? Signaling (IRQ) to the API/Driver? Signaling (IRQ) to the API/Driver? End of DMA transfer? End of DMA transfer?

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

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

15 GPU Interface Registers: Registers: ViewPort Res X: screen resolution (INT). ViewPort Res X: screen resolution (INT). ViewPort Res Y: screen resolution (INT). ViewPort Res Y: screen resolution (INT). Pixel Mode: bits per pixel, etc (PXFORMAT). Pixel Mode: bits per pixel, etc (PXFORMAT). Color Buffer Address: local memory address for the color buffer (UINT). 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). 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)? Texture Memory Address: local memory address for the texture buffers (UINT)? Program Memory Address: local memory address for the shader program buffers (UINT)? Program Memory Address: local memory address for the shader program buffers (UINT)?

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

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

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

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

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

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

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

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

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

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

26 API/Driver State OpenGL: OpenGL specification has an appendix with all the OpenGL state variables. OpenGL: OpenGL specification has an appendix with all the OpenGL state variables. DirectX: would need research. State based in COM objects. 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. Must translate API calls (OpenGL) and API objects (DirectX) to GPU commands. Read a trace file and translate to GPU commands (static). 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). Replace system API libraries (dlls, shared libs) and send commands to a GPU simulator (dynamic).

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

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

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

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

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


Download ppt "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."

Similar presentations


Ads by Google