Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 •...

15
© Copyright Khronos Group, 2009 - Page 1 4 th Annual Dave Shreiner, ARM March 2009

Transcript of Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 •...

Page 1: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 1

4th Annual

Dave Shreiner, ARM March 2009

Page 2: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 2

• Motivation -  What’s OpenGL ES, and what can it do for me?

• Overview -  Lingo decoder -  Overview of the OpenGL ES Pipeline -  What’s this Shader thing, and what’s one look like?

• Where can you learn more -  Specifications, books, man pages and more!

•  The two-for-one deal -  OpenGL ES and OpenCL – “goes together like peas and carrots”

Page 3: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 3

•  The leading 3D rendering API for mobile devices -  Based on desktop OpenGL – but optimized for mobile / handheld devices -  Removes redundancy & rarely used features - adds mobile-friendly data types -  The power of OpenGL distilled into a much smaller package

• A smashing success! -  Widely used in mobile phone handsets from every major handset manufacturer -  Personal Navigation, Personal Media Player, Automotive, Set-Top Box, Mobile Internet Device -  Brew, Windows Mobile, Symbian, Android, iPhone OS, Limo, Embedded Linux

• OpenGL ES 1.1 has become the most widely deployed 3D API -  Used in diverse applications, devices and markets

Page 4: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 4

•  OpenGL is too big for systems with limited resources -  Floating point arithmetic -  Features for CAD, medical imaging, et cetera -  Legacy features that are no longer useful / recommended

•  What to do? -  Remove redundant, unused, or expensive functionality -  Add features needed for embedded systems

•  Result: OpenGL ES -  A compact API that can do almost everything that full OpenGL can -  …while leveraging OpenGL tools and experience

Page 5: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 5

• Mobile Games -  US $2.4B in 2006, growing to -  …US $7.2B in 2010 (Informa)

• Composition-based User Interfaces -  Mac OS X, Windows Vista -  Coming soon in Symbian

• Other Uses -  Implementing Flash / OpenVG -  Application UIs -  Navigation applications -  Etc…

Page 6: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 6

• OpenGL ES Versions -  OpenGL ES 1.x: fixed-function processors, programmed by register setting -  OpenGL ES 2.x: programmable processors, programmed in Shader Languages

Geometry Processor

3D Vertices and Attributes

Screen Triangles

State Variables

Fragment Processor

Rasterization

Colored Fragments

Fragments Models

Frame Buffer Update

Image

Page 7: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 7

• Key Features -  Based on OpenGL 1.5 -  Vertex Arrays / Buffer Objects -  Transform & Lighting -  Multitexturing (min 2 units) -  Fixed-point & Floating-point profiles

•  Features Removed -  Begin / End (immediate-mode interface) -  Color Index Mode

Page 8: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 8

•  “Fixed Function” 3D Acceleration

•  Key Features •  Fixed-point and Floating-point

Data Formats •  Vertex Arrays and Buffer Objects •  Fixed-Function Transformation

and Lighting •  Point, Line, Triangle, Triangle Strip,

Triangle Fan Primitives •  Minimum 2 layer Multi-Texturing •  Vertex Skinning Functionality •  Texture Filtering •  Texture Compression •  Alpha Blending •  Z-Buffer / Stencil Buffer / Color Buffer

Page 9: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 9

• Key Features -  Adds vertex and fragment shader programming -  Removes fixed function pipeline -  Super-compact, efficient API -  High level language (GLSL ES) -  On-line or off-line compilation

• Advanced Feature Set -  Eight attribs / varyings / textures -  Cube Maps -  Framebuffer Objects

Page 10: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 10

•  “Programmable” 3D Acceleration

•  Key Features •  Programmable Transform and

Lighting through Vertex Shader •  Programmable Pixel Rasterization

through Fragment Shader •  Support for 3 levels of precision

in the Shader Programs •  No Fixed Function Vertex

or Fragment Shading -  Breaks backwards compatibility !

•  Fixed function components -  Alpha Blending -  Depth / Stencil Test -  Texture Filtering

•  Texture Compression -  Including royalty free ETC

•  Frame Buffer Objects -  Exchange data within the pipeline without copies

Page 11: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 11

• A (usually small) program written in a shading language -  OpenGL ES 2.0 has its own shading language – the OpenGL ES Shading Language

•  Example Fragment Shader

varying vec2 tc; // texture coords varying vec3 n; // lighting normal

uniform vec3 lightPos; uniform sampler2D tex[2];

void main() { vec4 color = texture2D( tex[0], tc ); vec4 clouds = texture2D( tex[1], tc );

float dp = dot( n, lightPos ); vec4 brightness = max( 0.0, dp );

gl_FragColor = brightness * (color + clouds); }

Page 12: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 12

Page 13: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 13

•  The Khronos Web Site -  Specifications, examples, and …

• OpenGL ES 2.0 manual pages -  OpenGL ES 1.1 pages coming soon

http://www.khronos.org/opengles/sdk/docs/man

Page 14: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 14

• OpenCL with OpenGL (ES) work together • Both standards under one IP framework

-  Enables very close collaborative design •  Efficient, inter-API communication

-  While still allowing both APIs to handle the types of workloads for which they were designed • OpenCL can efficiently share resources with OpenGL (ES)

-  Textures, Buffer Objects and Renderbuffers -  Data is shared, not copied

• Applications can select compute device(s) to run OpenGL and OpenCL -  Efficient queuing of OpenCL and OpenGL commands into the hardware -  Flexible scheduling and synchronization

•  Examples -  Vertex and image data generated with OpenCL and then rendered with OpenGL -  Images rendered with OpenGL and post-processed with OpenCL kernels -  etc. etc.

Page 15: Dave Shreiner, ARM March 2009 - Khronos Group · © Copyright Khronos Group, 2009 - Page 14 • OpenCL with OpenGL (ES) work together • Both standards under one IP framework - Enables

© Copyright Khronos Group, 2009 - Page 15

• OpenGL ES versions -  OpenGL ES 1.1 – the “fixed-function” implementation -  OpenGL ES 2.0 – shader-based graphics

• All trademarked implementations rigorously tested -  Working group agreed conformance tests

2007 2008

OpenGL ES 1.1 with hardware acceleration is the “Sweet Spot” for Mobile 3D through 2008

OpenGL ES 2.0 accelerated products begin to ship

OpenGL ES 2.0 final specification

March 2007

OpenGL ES 1.1 will continue to be used in lower-cost devices

2009

OpenGL ES 2.0 Conformance Tests

May 2008

OpenGL ES 2.0 provisional

specification August 2005

High-end devices will ship with drivers for both OpenGL ES 1.1 and 2.0