Pipe Driver Overview. Keith Whitwell Nov 13, 2009 Virtual Machine Group

Similar documents
The Application Stage. The Game Loop, Resource Management and Renderer Design

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

TG-Gallium Driver Stack. Softpipe, Cell and Beyond. Keith Whitwell

Case 1:17-cv SLR Document 1-3 Filed 01/23/17 Page 1 of 33 PageID #: 60 EXHIBIT C

Rendering Objects. Need to transform all geometry then

GPU Memory Model Overview

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

The Graphics Pipeline

GPU Memory Model. Adapted from:

CS770/870 Spring 2017 Open GL Shader Language GLSL

CS770/870 Spring 2017 Open GL Shader Language GLSL

WebGL (Web Graphics Library) is the new standard for 3D graphics on the Web, designed for rendering 2D graphics and interactive 3D graphics.

CS770/870 Fall 2015 Advanced GLSL

Metal Feature Set Tables

Shader Programs. Lecture 30 Subsections 2.8.2, Robb T. Koether. Hampden-Sydney College. Wed, Nov 16, 2011

Shaders (some slides taken from David M. course)

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

Metal for OpenGL Developers

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Graphics Processing Unit Architecture (GPU Arch)

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

Basics of GPU-Based Programming

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Shader Series Primer: Fundamentals of the Programmable Pipeline in XNA Game Studio Express

Optimizing i965 for the Future. Kenneth Graunke Intel Visual Technologies Team & The Mesa Community

UberFlow: A GPU-Based Particle Engine

Short Notes of CS201

Introduction to Shaders.

Windowing System on a 3D Pipeline. February 2005

CS8803SC Software and Hardware Cooperative Computing GPGPU. Prof. Hyesoon Kim School of Computer Science Georgia Institute of Technology

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

E.Order of Operations

CS201 - Introduction to Programming Glossary By

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

OpenGL Programmable Shaders

Optimisation. CS7GV3 Real-time Rendering

CS4620/5620: Lecture 14 Pipeline

Designing a Modern GPU Interface

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

CPSC 436D Video Game Programming

Advanced Rendering Techniques

Rasterization-based pipeline

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

Achieving High-performance Graphics on Mobile With the Vulkan API

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

OUTLINE. Learn the basic design of a graphics system Introduce pipeline architecture Examine software components for a graphics system

Programmable Graphics Hardware

Lecture 2. Shaders, GLSL and GPGPU

CS 450: COMPUTER GRAPHICS REVIEW: STATE, ATTRIBUTES, AND OBJECTS SPRING 2015 DR. MICHAEL J. REALE

COMP371 COMPUTER GRAPHICS

A Trip Down The (2011) Rasterization Pipeline

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Real - Time Rendering. Pipeline optimization. Michal Červeňanský Juraj Starinský

2.11 Particle Systems

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

GeForce4. John Montrym Henry Moreton

Working with Metal Overview

Could you make the XNA functions yourself?

Grafica Computazionale: Lezione 30. Grafica Computazionale. Hiding complexity... ;) Introduction to OpenGL. lezione30 Introduction to OpenGL

Rendering Grass with Instancing in DirectX* 10

Shading System Immediate-Mode API v2.2

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

CS179: GPU Programming

Understanding M3G 2.0 and its Effect on Producing Exceptional 3D Java-Based Graphics. Sean Ellis Consultant Graphics Engineer ARM, Maidenhead

2D graphics with WebGL

Deferred Rendering Due: Wednesday November 15 at 10pm

WebGL and GLSL Basics. CS559 Fall 2016 Lecture 14 October

Sung-Eui Yoon ( 윤성의 )

GDC 2014 Barthold Lichtenbelt OpenGL ARB chair

BCA611 Video Oyunları için 3B Grafik

PowerVR Performance Recommendations The Golden Rules. October 2015

Introductory Seminar

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

GLSL 1: Basics. J.Tumblin-Modified SLIDES from:

World Coordinate System

OpenGL ES for iphone Games. Erik M. Buck

Normalized Device Coordinate System (NDC) World Coordinate System. Example Coordinate Systems. Device Coordinate System

Shaders in Eve Online Páll Ragnar Pálsson

Applying Textures. Lecture 27. Robb T. Koether. Hampden-Sydney College. Fri, Nov 3, 2017

The NVIDIA GeForce 8800 GPU

Bringing AAA graphics to mobile platforms. Niklas Smedberg Senior Engine Programmer, Epic Games

Programming Guide. Aaftab Munshi Dan Ginsburg Dave Shreiner. TT r^addison-wesley

OpenGL BOF Siggraph 2011

CS452/552; EE465/505. Clipping & Scan Conversion

Discussion 3. PPM loading Texture rendering in OpenGL

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

Pixel Power (P2) Eliane Kabkab System Integrator Nageswar Keetha Language Guru Eric Liu Project Manager Kaushik Viswanathan System Architect

Soft Particles. Tristan Lorach

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

How to Work on Next Gen Effects Now: Bridging DX10 and DX9. Guennadi Riguer ATI Technologies

Ciril Bohak. - INTRODUCTION TO WEBGL

WebGL. WebGL. Bring 3D to the Masses. WebGL. The web has text, images, and video. We want to support. Put it in on a webpage

Lecture 5 Vertex and Fragment Shaders-1. CITS3003 Graphics & Animation

1.2.3 The Graphics Hardware Pipeline

GLSL Overview: Creating a Program

Graphics Hardware. Instructor Stephen J. Guy

The Rendering Pipeline (1)

Threading Hardware in G80

Transcription:

Pipe Driver Overview Keith Whitwell Nov 13, 2009 Virtual Machine Group

Gallium3D Interface Overview Key aspects: Contexts and Screens Constant state objects Further immediate state Assembly-style tokenized shaders Opaque, immutable texture objects Render targets as views into texture objects Buffer objects with map/unmap semantics Vertex, Index and Constant buffer objects Small set of drawing commands The backend winsys interface.

Screens and Contexts Screen: Explicit object to manage shared resources. Textures, surfaces and buffers Contexts Contexts: Familiar concept of a rendering context. Rasterization and vertex state Shaders Drawing commands.

Screen: Textures and Buffers struct pipe_screen { /** * Create a new texture object, using the given template info. */ struct pipe_texture * (*texture_create)(struct pipe_screen *, const struct pipe_texture *); struct pipe_buffer *(*buffer_create)( struct pipe_screen *screen, unsigned alignment, unsigned usage, unsigned size ); Created and managed by the pipe_screen object. Shareable with all rendering contexts created from that screen. Current screen interface has grown a large number of texture/surface/buffer functions. Time is ripe for a cleanup of these interfaces.

Screen: Surfaces struct pipe_screen { struct pipe_surface *(*get_tex_surface)(struct pipe_screen *, struct pipe_texture *, unsigned face, unsigned level, unsigned zslice, unsigned usage ); struct pipe_framebuffer_state { unsigned width, height; unsigned nr_cbufs; struct pipe_surface *cbufs[pipe_max_color_bufs]; struct pipe_surface *zsbuf; Surfaces are views into textures Bind to contexts as render targets or depth-stencil buffers

Screen: Contexts struct pipe_screen { /* Where is the (*create_context)() entrypoint? */ Gallium is not without its own historical oddities. Conceptually, contexts should be created directly through the pipe_screen interface. For historical reasons: - the create_context interface has ended up in the winsys backend interface, - and has yet to be moved somewhere sensible.

Context: Shaders VERT1.1 DCL IN[0] DCL IN[1] DCL OUT[0], POSITION DCL OUT[1], COLOR DCL CONST[0..3] DCL TEMP[0] 0: MUL TEMP[0], IN[0].xxxx, CONST[0] 1: MAD TEMP[0], IN[0].yyyy, CONST[1], TEMP[0] 2: MAD TEMP[0], IN[0].zzzz, CONST[2], TEMP[0] 3: MAD OUT[0], IN[0].wwww, CONST[3], TEMP[0] 4: MOV OUT[1], IN[1] 5: END FRAG1.1 DCL IN[0], COLOR, LINEAR DCL OUT[0], COLOR 0: MOV OUT[0], IN[0] 1: END Shaders delivered to driver as stream of tokens. Vertex shader inputs matched to context state by number. Vertex outputs matched to fragment inputs by semantic tags. Fragment inputs include interpolation information. Fragment outputs matched to fixed-function blending behaviour by semantic tags. Gallium shader representation was fairly complicated ongoing simplification.

Context: Constant state objects struct pipe_blend_state { unsigned blend_enable:1; unsigned rgb_func:3; /**< PIPE_BLEND_x */ unsigned rgb_src_factor:5; /**< PIPE_BLENDFACTOR_x */ unsigned rgb_dst_factor:5; /**< PIPE_BLENDFACTOR_x */ unsigned alpha_func:3; /**< PIPE_BLEND_x */ unsigned alpha_src_factor:5; /**< PIPE_BLENDFACTOR_x */ unsigned alpha_dst_factor:5; /**< PIPE_BLENDFACTOR_x */ unsigned logicop_enable:1; unsigned logicop_func:4; /**< PIPE_LOGICOP_x */ unsigned colormask:4; /**< bitmask of PIPE_MASK_R/G/B/A */ unsigned dither:1; Create/Bind/Destroy lifecycle. Helper module (CSO) for state-trackers manages this through hash table. Single level save/restore in CSO module to assist beyond-api driver tasks, like quad blitters.

Context: Immediate state struct pipe_vertex_element { unsigned src_offset; unsigned vertex_buffer_index:8; unsigned nr_components:8; enum pipe_format src_format; struct pipe_blend_color { float color[4]; Passed directly to context in state setting functions. Always possible to debate which state should be immediate and which CSO. Try not to deviate too far from other APIs.

Context: Drawing struct pipe_context { boolean (*draw_range_elements)( struct pipe_context *pipe, struct pipe_buffer *indexbuffer, unsigned indexsize, unsigned minindex, unsigned maxindex, unsigned mode, unsigned start, unsigned count); Small number of fairly uncontroversial drawing calls. Will necessarily expand as we add functionality such as instanced drawing for GL3.

Winsys Interface /** * This is the interface that llvmpipe expects any window system * hosting it to implement. */ struct llvmpipe_winsys { struct llvmpipe_displaytarget * (*displaytarget_create)( struct llvmpipe_winsys *ws, enum pipe_format format, unsigned width, unsigned height, unsigned alignment, unsigned *stride ); Each driver chooses its own winsys interface. Must be implemented on each platform that supports the driver. Typical functions include allocating video memory and executing command buffers. This component has evolved to become a resource manager abstraction.