OpenGL SC. March Sean Harmer Managing Director UK

Similar documents
Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

GLSL: Creating GLSL Programs - Overview

MODERNIZATION C++ Bjarne Stroustrup, creator of C++

OpenGL. Shading Language. Third Edition

Qt 3D Basics. Paul Lemire

Dave Shreiner, ARM March 2009

I think this assignment should have 8 objectives but we should still mark it out of 10. The Mean TA.

Programming shaders & GPUs Christian Miller CS Fall 2011

Copyright Khronos Group Page 1. Vulkan Overview. June 2015

Mobile Graphics Ecosystem. Tom Olson OpenGL ES working group chair

Vulkan 1.1 March Copyright Khronos Group Page 1

Lecture 09: Shaders (Part 1)

GPU Quality and Application Portability

Overview. Technology Details. D/AVE NX Preliminary Product Brief

Motivation Hardware Overview Programming model. GPU computing. Part 1: General introduction. Ch. Hoelbling. Wuppertal University

Mobile HW and Bandwidth

OpenGL BOF Siggraph 2011

Dynamic Texturing. Mark Harris NVIDIA Corporation

SIGGRAPH Briefing August 2014

COMP371 COMPUTER GRAPHICS

Copyright Khronos Group Page 1

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

PERFORMANCE OPTIMIZATIONS FOR AUTOMOTIVE SOFTWARE

printf Debugging Examples

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

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

GLSL Programming. Nicolas Holzschuch

Computer Graphics. Bing-Yu Chen National Taiwan University

GeForce3 OpenGL Performance. John Spitzer

Hands-On Workshop: 3D Automotive Graphics on Connected Radios Using Rayleigh and OpenGL ES 2.0

Shaders CSCI 4229/5229 Computer Graphics Fall 2017

GLSL Overview: Creating a Program

Working with Metal Overview

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

From Separated ECUs to a Display Cluster April 18, 2018

Shaders CSCI 4239/5239 Advanced Computer Graphics Spring 2014

OpenGL Essentials Training

last time put back pipeline figure today will be very codey OpenGL API library of routines to control graphics calls to compile and load shaders

Tutorial 1: Your First Triangle!

1 Hardware virtualization for shading languages Group Technical Proposal

Mention driver developers in the room. Because of time this will be fairly high level, feel free to come talk to us afterwards

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Optimizing Mobile Games with ARM. Solo Chang Staff Applications Engineer, ARM

Lecture 13: OpenGL Shading Language (GLSL)

CS335 Graphics and Multimedia. Slides adopted from OpenGL Tutorial

Khronos Connects Software to Silicon

CS179 GPU Programming Introduction to CUDA. Lecture originally by Luke Durant and Tamas Szalay

Using the PowerVR SDK to Optimize your Renderer

The PowerVR Insider SDK. PowerVR Developer Technology

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

OpenGL ES 2.0 : Start Developing Now. Dan Ginsburg Advanced Micro Devices, Inc.

OpenGL with Qt 5. Qt Developer Days, Berlin Presented by Sean Harmer. Produced by Klarälvdalens Datakonsult AB

Bringing it all together: The challenge in delivering a complete graphics system architecture. Chris Porthouse

Cg Toolkit. Cg 2.1 beta August 2008 Release Notes

Prospects for a more robust, simpler and more efficient shader cross-compilation pipeline in Unity with SPIR-V

General Purpose computation on GPUs. Liangjun Zhang 2/23/2005

Adding Advanced Shader Features and Handling Fragmentation

Mobile Performance Tools and GPU Performance Tuning. Lars M. Bishop, NVIDIA Handheld DevTech Jason Allen, NVIDIA Handheld DevTools

Mobile Application Programing: Android. OpenGL Operation

mbed OS Update Sam Grove Technical Lead, mbed OS June 2017 ARM 2017

Vulkan: Scaling to Multiple Threads. Kevin sun Lead Developer Support Engineer, APAC PowerVR Graphics

OpenGL Status - November 2013 G-Truc Creation

Using SPIR-V in practice with SPIRV-Cross

GPU Offline Shader Compiler. Mali. User Guide. Version: 2.2. Copyright 2009 ARM. All rights reserved. ARM DUI 0513A (ID101409)

Green Hills Software, Inc.

Mali Developer Resources. Kevin Ho ARM Taiwan FAE

R&S QuickStep Test Executive Software Flexibility and excellent performance

CS475/CS675 - Computer Graphics. OpenGL Drawing

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

Rationale for Non-Programmable Additions to OpenGL 2.0

Modernizing C++ March 18. Kevin Funk

Achieving High-performance Graphics on Mobile With the Vulkan API

GPU Shader Library. Mali. User Guide. Version: 1.0. Copyright 2009 ARM. All rights reserved. ARM DUI 0510A (ID101409)

Rendering Grass with Instancing in DirectX* 10

Creating outstanding digital cockpits with Qt Automotive Suite

Visual HTML5. Human Information Interaction for Knowledge Extraction, Interaction, Utilization, Decision making HI-I-KEIUD

Vulkan API 杨瑜, 资深工程师

OpenGL ES for iphone Games. Erik M. Buck

PowerVR SDK & Tools. February 2017

Profiling and Debugging Games on Mobile Platforms

Order Matters in Resource Creation

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

Parallel Programming on Larrabee. Tim Foley Intel Corp

Technical Report. GLSL Pseudo-Instancing

OpenMAX AL, OpenSL ES

Standards for Vision Processing and Neural Networks

Update on Khronos Open Standard APIs for Vision Processing Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem

Free Downloads OpenGL ES 3.0 Programming Guide

Lighting and Texturing

Enabling the Next Generation of Computational Graphics with NVIDIA Nsight Visual Studio Edition. Jeff Kiel Director, Graphics Developer Tools

GDC 2014 Barthold Lichtenbelt OpenGL ARB chair

Vulkan Launch Webinar 18 th February Copyright Khronos Group Page 1

- Surface Rendering -

Research Placement Technical Report Cross-Platform OpenGL Shader Authoring

Introduction. What s New in This Edition

Copyright Khronos Group, Page 1. Khronos Overview. Taiwan, February 2012

Overview. Consolidating SCM Infrastructures - Migrating between Tools -

Exploiting the GPU for High Performance Geospatial Situational Awareness Involving Massive and Dynamic Data Sets

EECS 487: Interactive Computer Graphics

Transcription:

March 2017 OpenGL SC Sean Harmer Managing Director UK The need for safety-critical systems with user-friendly interfaces is on the rise. To respond to this need, the Khronos Group (responsible for OpenGL, etc) has introduced OpenGL SC, a new standard that enables graphics in safety critical applications. OpenGL SC certifies a subset of OpenGL ES software and accelerated hardware under DO178-B (for aviation cockpits), ISO26262 (for automotive instrument panels), and ISO 61508 (for industrial automation controls). It primarily focuses on features needed to render aviation cockpit displays: digital instrument panels, 2D maps, 3D terrain, and augmented reality displays. As an embedded graphics programmer you re already familiar with OpenGL ES, but your company or your customers may begin asking for OpenGL SC support in your products. You may be wondering how much time and effort is needed to port your applications over to KDAB the Qt, OpenGL and C++ experts OpenGL SC. What techniques won t carry over? Are there functions you can no longer use? What are the gotchas? This whitepaper reviews the basic differences in moving from OpenGL ES to OpenGL SC, to help you quickly determine what s needed in skills and software to make the change. Specifically, we will compare the latest released version of both standards: OpenGL ES version 3.2 and OpenGL SC 2.0. It s important to note that OpenGL SC 2.0 is not backward compatible with OpenGL SC 1.0; as the 2.0 release of the standard is still relatively recent, it may not yet be available from your OpenGL vendor. 1

OpenGL SC can t support creating shaders on the fly so you ll need to remove any inline shader compilation/ testing/validation code and switch to shaders created at compile-time. No Runtime Shaders No gldrawelements glcompileshader, glcreateshader, glattachshader, glvalidateprogram, glshaderbinary, glshadersource, gllinkprogram, glgetshaderiv, glgetshaderinfolog, glgetshaderprecisionformat, glgetshadersource, glgetattachedshaders Safety critical code doesn t need to create shaders on the fly. This moves all shader compilation to compiletime and removes the need to include complex (and difficult to validate) GLSL compilers in the OpenGL SC drivers The gldrawelements function is removed. Programs must use gldrawrangeelements instead (added in OpenGL ES 3.0) Ensuring that the indicies passed to the OpenGL function will not exceed a predefined range helps limit the extent of validation testing All functions doing rendering Create a wrapper for gldrawrangeelements that omits start/ end parameters for non-safety critical builds and calls gldrawelements instead Code that compiles shaders at run-time for cross-platform compatibility or toolchain simplicity No Object Deletion Remove any C/C++ shader compilation/ testing/validation code and switch to compile-time shader compilation gldeletebuffers, gldeleteframebuffers, gldeleteprogram, gldeleterenderbuffers, gldeleteshader, gldeletetextures No Frame Buffer to Texture Transfers glcopyteximage2d, glcopytexsubimage2d Reading frame buffer into texture is used in games for special visual effects, mirrors, etc. There is no need to read screen pixels into a texture for safety critical apps Special post-processing visual filters applied to screen data (for example, contrast enhancement) Debug routines that grab screen shots for testing/validation purposes Use glreadnpixels instead Safety critical programs do not dynamically allocate memory, as memory exhaustion would cause failure. Routines that dynamically release resources are not needed because the program will not stop executing or return to the operating system Libraries containing functions using exception-safe or Resource Acquisition Is Initialization (RAII) resource management techniques Create a safety-critical branch that omits resource deletion for shared sources Use #ifdefs to wrap or remove resource deletion for safety critical builds KDAB the Qt, OpenGL and C++ experts 2

Safety critical programs do not dynamically allocate memory, as memory exhaustion would cause failure. And memory cleanup isn t needed as the program shouldn t stop executing or return to the operating system. No glcompressedteximage2d No Cube Maps The glcompressedteximage2d function is removed. Programs must use glcompressedtexsubimage2d instead glcompressedteximage2d re-allocates memory for a given texture, and reallocating is forbidden. One must use gltexstorage2d to allocate storage (only once), then upload data into the texture via gltexsubimage The function glteximage2d is removed The functions gltexparameteri and glbindtexture will not accept a GL_ TEXTURE_CUBE_MAP parameter The following constants are removed: GL_TEXTURE_CUBE_MAP_NEGATIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_Y GL_TEXTURE_CUBE_MAP_NEGATIVE_Z GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_POSITIVE_Y GL_TEXTURE_CUBE_MAP_POSITIVE_Z Any graphics using compressed textures like background images or dial/gauge texturing Texture cubes are typically used for providing background to virtual reality gaming environments and are not necessary for instrument clusters Create wrapper for glcompressedteximage2d that calls glcompressedtexsubimage2d and grabs full image Use standard compression formats Artificial horizon indicator (or 8-ball ) for aircraft/spacecraft Sky texture above a 2.5D navigation map No Object Verification glisbuffer, glisframebuffer, glisrenderbuffer, glisshader, glistexture Use individual texture for each cube face Use single tall texture with attributespecifying faces; use special logic in fragment shader to grab attribute and translate into texture y-offset Typically functions that are used to test for valid objects before freeing resources are not needed if no resources can be freed Verification checks to ensure APIs being used correctly Unit test frameworks Remove validation Use #ifdefs to wrap or remove resource deletion for safety critical builds KDAB the Qt, OpenGL and C++ experts 3

In Open GL SC, APIs that don t pass buffer size or length are replaced with an equivalent n routine that does (for example, glreadnpixels instead of glreadpixels). No glreadpixels No Uniform or Attribute Inspection The glreadpixels function is removed. Programs must use glreadnpixels instead (added in OpenGL ES 3.2) Passing size of the buffer allows checks that prevent buffer overruns The following functions are removed without replacements: glgetactiveattrib, glgetactiveuniform The functions glgetuniformfv, glgetuniformiv and glgetuniformuiv are removed. Programs must use glgetnuniformfv, glgetnuniformiv, or glgetnuniformuiv instead (added in OpenGL ES 3.2) Special post-processing visual filters applied to screen data (for example, contrast enhancement) Debug routines that grab screen shots for testing/validation purposes If sharing source with code earlier than OpenGL ES 3.2, wrap glreadpixels calls with macro that tests against buffer size or discards bufsize parameter and calls glreadnpixels Otherwise convert all glreadpixels calls to use glreadnpixels and add bufsize parameter If using for debugging only, remove calls This family of functions are used to inspect the Open GL state. The glgetactive* functions are susceptible to buffer overrun unless they use dynamic memory allocation, neither of which is allowable for safety critical applications. The glgetuniform* functions are substituted for versions that pass the buffer s size, allowing prevention of buffer overruns Debugging functions Unit tests and test scaffolding GL state inspection If sharing source with code earlier than OpenGL ES 3.2, wrap glgetuniform* calls with macro that tests against buffer size or discards bufsize parameter and calls glgetnuniform* Convert all glgetuniform* calls to use glgetnuniform* and add bufsize parameter Remove calls to glgetactiveattrib and glgetactiveuniform KDAB the Qt, OpenGL and C++ experts 4

The family of functions that inspect the Open GL state are susceptible to buffer overrun unless they use dynamic memory allocation, neither of which is allowable for safety critical applications. Conclusion The future will dramatically increase the number of embedded systems that we consider to be safety-critical and as we become more dependent on those systems, the consequences of their failure become more serious. Hence the need for standards like OpenGL SC. While implementing a functional safety process may significantly impact your development, it won t be due to OpenGL SC. A greater concern may be making safety-critical code without using memory frees or reallocation avoiding C++ delete which may require a bit more restructuring than just a handful of API alterations. The differences between OpenGL ES and OpenGL SC are limited to a handful of functions, many of which aren t in common use. This breakdown shows that adopting OpenGL SC requires minimal changes to your existing OpenGL ES source code and habits, which should be somewhat of a relief. About the KDAB Group The KDAB Group is the world s leading software consultancy for architecture, development and design of Qt, C++ and OpenGL applications across desktop, embedded and mobile platforms. KDAB is the biggest independent contributor to Qt. Our experts build runtimes, mix native and web technologies, solve hardware stack performance issues and porting problems for hundreds of customers, many among the Fortune 500. KDAB s tools and extensive experience in creating, debugging, profiling and porting complex applications help developers worldwide to deliver successful projects. KDAB s trainers, all full-time developers, provide market leading, hands-on, training for Qt, OpenGL and modern C++ in multiple languages. Founded in 1999, KDAB has offices throughout North America and Europe. www.kdab.com 2017 the KDAB Group. KDAB is a registered trademark of the KDAB Group. All other trademarks belong to their respective owners. KDAB the Qt, OpenGL and C++ experts 5