The Opengl® Shading Language, Version 4.60.7
Total Page:16
File Type:pdf, Size:1020Kb
The OpenGL® Shading Language, Version 4.60.7 John Kessenich, Google (Editor and Author) ; Dave Baldwin and Randi Rost (Version 1.1 Authors) Version 4.60.7, Wed, 10 Jul 2019 20:43:00 +0000 Table of Contents 1. Introduction. 2 1.1. Changes . 2 1.2. Overview. 4 1.3. Error Handling . 4 1.4. Typographical Conventions . 5 1.5. Deprecation . 5 2. Overview of Shading . 6 2.1. Vertex Processor . 6 2.2. Tessellation Control Processor . 6 2.3. Tessellation Evaluation Processor . 7 2.4. Geometry Processor . 7 2.5. Fragment Processor . 7 2.6. Compute Processor. 7 3. Basics. 9 3.1. Character Set and Phases of Compilation . 9 3.2. Source Strings . 10 3.3. Preprocessor . 10 3.4. Comments. 16 3.5. Tokens . 17 3.6. Keywords . 17 3.7. Identifiers . 21 3.8. Definitions . 21 4. Variables and Types. 23 4.1. Basic Types. 23 4.2. Scoping . 44 4.3. Storage Qualifiers . 46 4.4. Layout Qualifiers . 62 4.5. Interpolation Qualifiers . 94 4.6. Parameter Qualifiers . 96 4.7. Precision and Precision Qualifiers . 97 4.8. Variance and the Invariant Qualifier . 100 4.9. The Precise Qualifier . 102 4.10. Memory Qualifiers. 105 4.11. Specialization-Constant Qualifier. 108 4.12. Order and Repetition of Qualification. 109 4.13. Empty Declarations . 110 5. Operators and Expressions . 111 5.1. Operators . 111 5.2. Array Operations . 112 5.3. Function Calls . 112 5.4. Constructors. 112 5.5. Vector and Scalar Components and Length . 117 5.6. Matrix Components . 119 5.7. Structure and Array Operations . 120 5.8. Assignments. 121 5.9. Expressions . 122 5.10. Vector and Matrix Operations. 124 5.11. Out-of-Bounds Accesses . 126 5.12. Specialization-Constant Operations. 126 6. Statements and Structure. 128 6.1. Function Definitions . 129.