The Opengl ES® Shading Language, Version 3.20.6

Total Page:16

File Type:pdf, Size:1020Kb

The Opengl ES® Shading Language, Version 3.20.6 The OpenGL ES® Shading Language, Version 3.20.6 Robert J. Simpson, Qualcomm (Editor), John Kessenich, Google (Editor), Dave Baldwin and Randi Rost (Version 1.1 Authors) Version 3.20.6, Wed, 10 Jul 2019 20:43:52 +0000 Table of Contents 1. Introduction. 2 1.1. Changes . 2 1.2. Overview. 5 1.3. Error Handling . 5 1.4. Typographical Conventions . 6 1.5. Compatibility . 6 2. Overview of Shading . 8 2.1. Vertex Processor . 8 2.2. Tessellation Control Processor . 8 2.3. Tessellation Evaluation Processor . 9 2.4. Geometry Processor . 9 2.5. Fragment Processor . 9 2.6. Compute Processor. 9 3. Basics. 11 3.1. Character Set . 11 3.2. Source Strings . 11 3.3. Version Declaration . 12 3.4. Preprocessor . 13 3.5. Comments. 18 3.6. Tokens . 18 3.7. Keywords . 19 3.8. Identifiers . 22 3.9. Definitions . 23 3.10. Logical Phases of Compilation. 24 4. Variables and Types. 26 4.1. Basic Types. 26 4.2. Scoping . 41 4.3. Storage Qualifiers . 45 4.4. Layout Qualifiers . 60 4.5. Interpolation Qualifiers . 83 4.6. Parameter Qualifiers . 84 4.7. Precision and Precision Qualifiers . 84 4.8. Variance and the Invariant Qualifier . 90 4.9. The Precise Qualifier . 92 4.10. Memory Qualifiers . 96 4.11. Specialization-Constant Qualifier. 99 4.12. Order and Repetition of Qualification. 100 4.13. Empty Declarations . 101 5. Operators and Expressions . 102 5.1. Operators . 102 5.2. Array Operations . 103 5.3. Function Calls . 103 5.4. Constructors. 103 5.5. Vector Components . 108 5.6. Matrix Components . 109 5.7. Structure and Array Operations . 110 5.8. Assignments. 111 5.9. Expressions . 112 5.10. Vector and Matrix Operations. 114 5.11. Specialization-Constant Operations. 116 5.12. Evaluation of Expressions . ..
Recommended publications
  • Introduction to the Vulkan Computer Graphics API
    1 Introduction to the Vulkan Computer Graphics API Mike Bailey mjb – July 24, 2020 2 Computer Graphics Introduction to the Vulkan Computer Graphics API Mike Bailey [email protected] SIGGRAPH 2020 Abridged Version This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License http://cs.oregonstate.edu/~mjb/vulkan ABRIDGED.pptx mjb – July 24, 2020 3 Course Goals • Give a sense of how Vulkan is different from OpenGL • Show how to do basic drawing in Vulkan • Leave you with working, documented, understandable sample code http://cs.oregonstate.edu/~mjb/vulkan mjb – July 24, 2020 4 Mike Bailey • Professor of Computer Science, Oregon State University • Has been in computer graphics for over 30 years • Has had over 8,000 students in his university classes • [email protected] Welcome! I’m happy to be here. I hope you are too ! http://cs.oregonstate.edu/~mjb/vulkan mjb – July 24, 2020 5 Sections 13.Swap Chain 1. Introduction 14.Push Constants 2. Sample Code 15.Physical Devices 3. Drawing 16.Logical Devices 4. Shaders and SPIR-V 17.Dynamic State Variables 5. Data Buffers 18.Getting Information Back 6. GLFW 19.Compute Shaders 7. GLM 20.Specialization Constants 8. Instancing 21.Synchronization 9. Graphics Pipeline Data Structure 22.Pipeline Barriers 10.Descriptor Sets 23.Multisampling 11.Textures 24.Multipass 12.Queues and Command Buffers 25.Ray Tracing Section titles that have been greyed-out have not been included in the ABRIDGED noteset, i.e., the one that has been made to fit in SIGGRAPH’s reduced time slot.
    [Show full text]
  • Differential Fuzzing the Webassembly
    Master’s Programme in Security and Cloud Computing Differential Fuzzing the WebAssembly Master’s Thesis Gilang Mentari Hamidy MASTER’S THESIS Aalto University - EURECOM MASTER’STHESIS 2020 Differential Fuzzing the WebAssembly Fuzzing Différentiel le WebAssembly Gilang Mentari Hamidy This thesis is a public document and does not contain any confidential information. Cette thèse est un document public et ne contient aucun information confidentielle. Thesis submitted in partial fulfillment of the requirements for the degree of Master of Science in Technology. Antibes, 27 July 2020 Supervisor: Prof. Davide Balzarotti, EURECOM Co-Supervisor: Prof. Jan-Erik Ekberg, Aalto University Copyright © 2020 Gilang Mentari Hamidy Aalto University - School of Science EURECOM Master’s Programme in Security and Cloud Computing Abstract Author Gilang Mentari Hamidy Title Differential Fuzzing the WebAssembly School School of Science Degree programme Master of Science Major Security and Cloud Computing (SECCLO) Code SCI3084 Supervisor Prof. Davide Balzarotti, EURECOM Prof. Jan-Erik Ekberg, Aalto University Level Master’s thesis Date 27 July 2020 Pages 133 Language English Abstract WebAssembly, colloquially known as Wasm, is a specification for an intermediate representation that is suitable for the web environment, particularly in the client-side. It provides a machine abstraction and hardware-agnostic instruction sets, where a high-level programming language can target the compilation to the Wasm instead of specific hardware architecture. The JavaScript engine implements the Wasm specification and recompiles the Wasm instruction to the target machine instruction where the program is executed. Technically, Wasm is similar to a popular virtual machine bytecode, such as Java Virtual Machine (JVM) or Microsoft Intermediate Language (MSIL).
    [Show full text]
  • GLSL 4.50 Spec
    The OpenGL® Shading Language Language Version: 4.50 Document Revision: 7 09-May-2017 Editor: John Kessenich, Google Version 1.1 Authors: John Kessenich, Dave Baldwin, Randi Rost Copyright (c) 2008-2017 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast, or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be reformatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group website should be included whenever possible with specification distributions.
    [Show full text]
  • Computer Graphics on Mobile Devices
    Computer Graphics on Mobile Devices Bruno Tunjic∗ Vienna University of Technology Figure 1: Different mobile devices available on the market today. Image courtesy of ASU [ASU 2011]. Abstract 1 Introduction Computer graphics hardware acceleration and rendering techniques Under the term mobile device we understand any device designed have improved significantly in recent years. These improvements for use in mobile context [Marcial 2010]. In other words this term are particularly noticeable in mobile devices that are produced in is used for devices that are battery-powered and therefore physi- great amounts and developed by different manufacturers. New tech- cally movable. This group of devices includes mobile (cellular) nologies are constantly developed and this extends the capabilities phones, personal media players (PMP), personal navigation devices of such devices correspondingly. (PND), personal digital assistants (PDA), smartphones, tablet per- sonal computers, notebooks, digital cameras, hand-held game con- soles and mobile internet devices (MID). Figure 1 shows different In this paper, a review about the existing and new hardware and mobile devices available on the market today. Traditional mobile software, as well as a closer look into some of the most important phones are aimed at making and receiving telephone calls over a revolutionary technologies, is given. Special emphasis is given on radio link. PDAs are personal organizers that later evolved into de- new Application Programming Interfaces (API) and rendering tech- vices with advanced units communication, entertainment and wire- niques that were developed in recent years. A review of limitations less capabilities [Wiggins 2004]. Smartphones can be seen as a that developers have to overcome when bringing graphics to mobile next generation of PDAs since they incorporate all its features but devices is also provided.
    [Show full text]
  • 04 ISC 228-TESIS.Pdf
    UTN –FICA Análisis y Estudio de Tecnología Ruby on Rails con bases de datos Postgresql para Aplicaciones Web 2.0 UNIVERSIDAD TÉCNICA DEL NORTE Facultad de Ingeniería en Ciencias Aplicadas Carrera de Ingeniería en Sistemas Computacionales TESIS PREVIA OBTENCIÓN DEL TITULO DE INGENIERO EN SISTEMAS COMPUTACIONALES Tema: “Análisis y Estudio de Tecnología Ruby on Rails con bases de datos Postgres para Aplicaciones Web 2.0” Aplicativo: Implementación del Portal Web 2.0 para la Mancomunidad de la Cuenca del Río Mira AUTOR : CHRISTIAN FERNANDO REALPE ROSERO. DIRECTOR : ING. MARCO PUSDÁ. IBARRA – ECUADOR, 2012 Christian Fernando Realpe Rosero Implementación del Portal Web 2.0 para la Mancomunidad de la Cuenca del Río Mira Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/) UTN –FICA Análisis y Estudio de Tecnología Ruby on Rails con bases de datos Postgresql para Aplicaciones Web 2.0 Certifico: Que la Tesis previa a la obtención del título de Ingeniería en Sistemas Computacionales con el tema “Análisis y Estudio de Tecnología Ruby on Rails con bases de datos Postgres para Aplicaciones Web 2.0”con el aplicativo “Implementación del Portal Web 2.0 para la Mancomunidad de la Cuenca del Río Mira” ha sido desarrollada y terminada en su totalidad por el Sr. Christian Fernando Realpe Rosero con C.C. 100251109-3 bajo mi supervisión para lo cual firmo en constancia. Atentamente, Ing. Marco Pusdá DIRECTOR DE TESIS Christian Fernando Realpe Rosero Implementación del Portal Web 2.0 para la Mancomunidad de la Cuenca del Río Mira Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/) UTN –FICA Análisis y Estudio de Tecnología Ruby on Rails con bases de datos Postgresql para Aplicaciones Web 2.0 UNIVERSIDAD TÉCNICA DEL NORTE CESIÓN DE DERECHOS DE AUTOR DEL TRABAJO DE INVESTIGACIÓN A FAVOR DE LA UNIVERSIDAD TÉCNICA DEL NORTE Yo, CHRISTIAN FERNANDO REALPE ROSERO, con cedula de identidad Nro.
    [Show full text]
  • Authentication in the Mesh with Webassembly
    Authentication in the mesh with WebAssembly Sondre Halvorsen Master’s Thesis, Spring 2021 Thesis submitted for the degree of Master in Informatics: programming and system architecture 30 credits Department of Informatics Faculty of mathematics and natural sciences UNIVERSITY OF OSLO Spring 2021 © 2021 Sondre Halvorsen Master Thesis http://www.duo.uio.no/ Printed: Reprosentralen, University of Oslo Abstract At the start of the last decade Marc Andreessen stated in his now famous blog entry; ‘Software is eating the world’ [173], and as software is eating the world, problems stemming from its security, or lack thereof, is eating it as well. Or- ganisations are increasingly moving to the cloud and adopting new architecture patterns in this new environment, such as cloud native and microservice ar- chitecture. While moving to the cloud generally results in better security for organisations, due to large professional platforms, microservice architectures in- troduce some new problems in regards to cross-cutting concerns like security, robustness and observabiltity. Service mesh is a technology that aims to provide cloud native and application agnostic solution to many of the challenges with micro service architectures. In parallel with the cloud native revolution there has been innovations in areas like security as well. Authentication, authoriza- tion, and access control have changed drastically, with new requirements for how users want to manage and use their identity. Zero Trust Architectures is an example of this drawn to its logical conclusion where no connection is trusted by default. Unfortunately security breaches stemming from poor implementation of security protocols and frameworks rank among the highest still.
    [Show full text]
  • The Opengl Graphics System
    OpenGL R ES Native Platform Graphics Interface (Version 1.0) Editor: Jon Leech Copyright c 2002-2003 Promoters of the Khronos Group (3Dlabs, ARM Ltd., ATI Technologies, Inc., Discreet, Ericsson Mobile, Imagination Technologies Group plc, Motorola, Inc., Nokia, Silicon Graphics, Inc., SK Telecom, and Sun Microsystems). This document is protected by copyright, and contains information proprietary to The Khronos Group. Any copying, adaptation, distribution, public performance, or public display of this document without the express written consent of the copy- right holders is strictly prohibited. The receipt or possession of this document does not convey any rights to reproduce, disclose, or distribute its contents, or to manu- facture, use, or sell anything that it may describe, in whole or in part. R This document is a derivative work of ”OpenGL Graphics with the X Window System (Version 1.4)”. Silicon Graphics, Inc. owns, and reserves all rights in, the latter document. OpenGL is a registered trademark, and OpenGL ES is a trademark, of Silicon Graphics, Inc. Contents 1 Overview 1 2 EGL Operation 2 2.1 Native Window System and Rendering APIs . 2 2.1.1 Scalar Types . 2 2.1.2 Displays . 3 2.2 Rendering Contexts and Drawing Surfaces . 3 2.2.1 Using Rendering Contexts . 4 2.2.2 Rendering Models . 4 2.2.3 Interaction With Native Rendering . 4 2.3 Direct Rendering and Address Spaces . 5 2.4 Shared State . 5 2.4.1 Texture Objects . 6 2.5 Multiple Threads . 6 2.6 Power Management . 7 3 EGL Functions and Errors 8 3.1 Errors .
    [Show full text]
  • 414 Advances in Opengl ES for Ios 5 V3 DD F
    Advances in OpenGL ES for iOS 5 Session 414 Gokhan Avkarogullari Eric Sunalp iPhone GPU Software These are confidential sessions—please refrain from streaming, blogging, or taking pictures 1 iPad 2 2 3 Per Pixel Lighting/ Normal Maps 4 LightMaps GlossMaps SpecularMaps 5 Dynamic Shadows 6 MSAA 7 Higher Poly Models 8 GLKit New Features 9 GLKit New Features 10 OpenGL ES 2.0 Molecules.app OpenGL ES 1.1 OpenGL ES 2.0 11 GLKit Goals • Making life easier for the developers ■ Find common problems ■ Make solutions available • Encourage unique look ■ Fixed-function pipeline games look similar ■ Shaders to rescue ■ How about porting 12 GLKit GLKTextureLoader GLKTextureLoader • Give a reference—get an OpenGL Texture Object • No need to deal ImageIO, CGImage, libjpg, libpng… 13 GLKit GLKView and GLKViewController GLKTextureLoader GLKView/ViewController • First-class citizen of UIKit hierarchy • Encapsulates FBOs, display links, MSAA management… 14 GLKit GLKMath GLKTextureLoader GLKView/ViewController GLKMath • 3D Graphics math library • Matrix stack, transforms, quaternions… 15 GLKit GLKEffects GLKTextureLoader GLKView/ViewController GLKMath GLKEffects • Fixed-function pipeline features implemented in ES 2.0 context 16 GLKTextureLoader 17 GLKTextureLoader Overview • Makes texture loading simple • Supports common image formats ■ PNG, JPEG, TIFF, etc. • Non-premultiplied data stays non-premultiplied • Cubemap texture support • Convenient loading options ■ Force premultiplication ■ Y-flip ■ Mipmap generation 18 GLKTextureLoader Basic usage • Make an EAGLContext
    [Show full text]
  • Concert CHS Bands Turn Down
    \ — *♦ ll < l e a t h e r n ^la. M*».Pr«dp. „ 34 60 O-OQ -a. 0.00 U> A{,r* i 80 '~ir~S7 61 0.00 f ‘jZH-45 «0 0.00 QUOTE jO.OO f l u . t r z z U i? “Whoe’er excels In what we Jtw 1 '^dTJO Tvaeo ,49 0.06 prize Appears a hero in our eyes.” Bl Jonathan Swift . , 'y > wtmT H Y E A R — N o . 46 14 Pages This Week CHELSEA, MICHIGAN, THURSDAY, MAY 8, 1969 10c per copy SUBSCRIPTION: $8.00 PER YEAR r « P ■Wf' ’ concert Named for MichiganWeek Michigan Week has been described by one - of America’s leading advertising agencies as Turn Down “Michigan’s biggest public .rela­ tions program, ”, While, the actual celebration covers eight days beginning the CHS Bands Saturday - preceding the ~nKlrd Sunday in May. every_yeap$_it: is actually the clijnax of a year­ ,i«a High school Symphony Other program items will in long program in which thousands y Bands will present a elude- Amparita -.Roea . (Spanish of Michigan citizenBf volunteer concert Monday,. May March) .by Texidor; Finale from their time and effort' for .the. bet­ Sym phony-No. 1 in G-minor by terment of their communities and tae-Third of All School Funds ; nrozrsflit set for '8 p.m. in Kalinnikov; Beguine for Band by state,, the objectives of Michigan i f f & school a,uditori- Osser by the Symphony Band, .YY.GvKi - Eliminated Only 724 Voters directed by, D. Keith Lawson. By & feature Heidi Sprague as Back 1953_a group of Michi She will plarCecile Cha- Other Symphony Band selections gan businessmen, - industrialists; School- Dlitrict voters I Mills said that the schools could >g Concertino for flute, acr include Second Suitfe in F by educators and others decided that overwhelming# defeated a school not operate ^at the__ 1968-69 1evel ' nied by -6 section of - the Holst,_ March, Sbng Without something ibig should be done by miliage yproposaT tharw uld" hdve next year with the same funds increased schooUtaxes by 3.83 mills ,-i&ny Band.
    [Show full text]
  • Standards for Vision Processing and Neural Networks
    Standards for Vision Processing and Neural Networks Radhakrishna Giduthuri, AMD [email protected] © Copyright Khronos Group 2017 - Page 1 Agenda • Why we need a standard? • Khronos NNEF • Khronos OpenVX dog Network Architecture Pre-trained Network Model (weights, …) © Copyright Khronos Group 2017 - Page 2 Neural Network End-to-End Workflow Neural Network Third Vision/AI Party Applications Training Frameworks Tools Datasets Trained Vision and Neural Network Network Inferencing Runtime Network Model Architecture Desktop and Cloud Hardware Embedded/Mobile Embedded/MobileEmbedded/Mobile Embedded/Mobile/Desktop/CloudVision/InferencingVision/Inferencing Hardware Hardware cuDNN MIOpen MKL-DNN Vision/InferencingVision/Inferencing Hardware Hardware GPU DSP CPU Custom FPGA © Copyright Khronos Group 2017 - Page 3 Problem: Neural Network Fragmentation Neural Network Training and Inferencing Fragmentation NN Authoring Framework 1 Inference Engine 1 NN Authoring Framework 2 Inference Engine 2 NN Authoring Framework 3 Inference Engine 3 Every Tool Needs an Exporter to Every Accelerator Neural Network Inferencing Fragmentation toll on Applications Inference Engine 1 Hardware 1 Vision/AI Inference Engine 2 Hardware 2 Application Inference Engine 3 Hardware 3 Every Application Needs know about Every Accelerator API © Copyright Khronos Group 2017 - Page 4 Khronos APIs Connect Software to Silicon Software Silicon Khronos is an International Industry Consortium of over 100 companies creating royalty-free, open standard APIs to enable software to access
    [Show full text]
  • Slang: Language Mechanisms for Extensible Real-Time Shading Systems
    Slang: language mechanisms for extensible real-time shading systems YONG HE, Carnegie Mellon University KAYVON FATAHALIAN, Stanford University TIM FOLEY, NVIDIA Designers of real-time rendering engines must balance the conicting goals and GPU eciently, and minimizing CPU overhead using the new of maintaining clear, extensible shading systems and achieving high render- parameter binding model oered by the modern Direct3D 12 and ing performance. In response, engine architects have established eective de- Vulkan graphics APIs. sign patterns for authoring shading systems, and developed engine-specic To help navigate the tension between performance and maintain- code synthesis tools, ranging from preprocessor hacking to domain-specic able/extensible code, engine architects have established eective shading languages, to productively implement these patterns. The problem is design patterns for authoring shading systems, and developed code that proprietary tools add signicant complexity to modern engines, lack ad- vanced language features, and create additional challenges for learning and synthesis tools, ranging from preprocessor hacking, to metapro- adoption. We argue that the advantages of engine-specic code generation gramming, to engine-proprietary domain-specic languages (DSLs) tools can be achieved using the underlying GPU shading language directly, [Tatarchuk and Tchou 2017], for implementing these patterns. For provided the shading language is extended with a small number of best- example, the idea of shader components [He et al. 2017] was recently practice principles from modern, well-established programming languages. presented as a pattern for achieving both high rendering perfor- We identify that adding generics with interface constraints, associated types, mance and maintainable code structure when specializing shader and interface/structure extensions to existing C-like GPU shading languages code to coarse-grained features such as a surface material pattern or enables real-time renderer developers to build shading systems that are a tessellation eect.
    [Show full text]
  • Webgl™ Optimizations for Mobile
    WebGL™ Optimizations for Mobile Lorenzo Dal Col Senior Software Engineer, ARM 1 Agenda 1. Introduction to WebGL™ on mobile . Rendering Pipeline . Locate the bottleneck 2. Performance analysis and debugging tools for WebGL . Generic optimization tips 3. PlayCanvas experience . WebGL Inspector 4. Use case: PlayCanvas Swooop . ARM® DS-5 Streamline . ARM Mali™ Graphics Debugger 5. Q & A 2 Bring the Power of OpenGL® ES to Mobile Browsers What is WebGL™? Why WebGL? . A cross-platform, royalty free web . It brings plug-in free 3D to the web, standard implemented right into the browser. Low-level 3D graphics API . Major browser vendors are members of . Based on OpenGL® ES 2.0 the WebGL Working Group: . A shader based API using GLSL . Apple (Safari® browser) . Mozilla (Firefox® browser) (OpenGL Shading Language) . Google (Chrome™ browser) . Opera (Opera™ browser) . Some concessions made to JavaScript™ (memory management) 3 Introduction to WebGL™ . How does it fit in a web browser? . You use JavaScript™ to control it. Your JavaScript is embedded in HTML5 and uses its Canvas element to draw on. What do you need to start creating graphics? . Obtain WebGLrenderingContext object for a given HTMLCanvasElement. It creates a drawing buffer into which the API calls are rendered. For example: var canvas = document.getElementById('canvas1'); var gl = canvas.getContext('webgl'); canvas.width = newWidth; canvas.height = newHeight; gl.viewport(0, 0, canvas.width, canvas.height); 4 WebGL™ Stack What is happening when a WebGL page is loaded . User enters URL . HTTP stack requests the HTML page Browser . Additional requests will be necessary to get Space User JavaScript™ code and other resources WebKit JavaScript Engine .
    [Show full text]