• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    EXT_shader_integer_mix
4
5Name Strings
6
7    GL_EXT_shader_integer_mix
8
9Contact
10
11    Matt Turner (matt.turner 'at' intel.com)
12
13Contributors
14
15    Matt Turner, Intel
16    Ian Romanick, Intel
17
18Status
19
20    Shipping
21
22Version
23
24    Last Modified Date:         09/12/2013
25    Author Revision:            6
26
27Number
28
29    OpenGL Extension #437
30    OpenGL ES Extension #161
31
32Dependencies
33
34    OpenGL 3.0 or OpenGL ES 3.0 is required. This extension interacts with
35    GL_ARB_ES3_compatibility.
36
37    This extension is written against the OpenGL 4.4 (core) specification
38    and the GLSL 4.40 specification.
39
40Overview
41
42    GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to
43    operate on a boolean third argument that does not interpolate but
44    selects. This extension extends mix() to select between int, uint,
45    and bool components.
46
47New Procedures and Functions
48
49    None.
50
51New Tokens
52
53    None.
54
55Additions to Chapter 8 of the GLSL 4.40 Specification (Built-in Functions)
56
57    Modify Section 8.3, Common Functions
58
59    Additions to the table listing common built-in functions:
60
61      Syntax                       Description
62      ---------------------------  --------------------------------------------------
63      genIType mix(genIType x,     Selects which vector each returned component comes
64                   genIType y,     from. For a component of a that is false, the
65                   genBType a)     corresponding component of x is returned. For a
66      genUType mix(genUType x,     component of a that is true, the corresponding
67                   genUType y,     component of y is returned.
68                   genBType a)
69      genBType mix(genBType x,
70                   genBType y,
71                   genBType a)
72
73Additions to the AGL/GLX/WGL Specifications
74
75    None.
76
77Modifications to The OpenGL Shading Language Specification, Version 4.40
78
79    Including the following line in a shader can be used to control the
80    language features described in this extension:
81
82      #extension GL_EXT_shader_integer_mix : <behavior>
83
84    where <behavior> is as specified in section 3.3.
85
86    New preprocessor #defines are added to the OpenGL Shading Language:
87
88      #define GL_EXT_shader_integer_mix        1
89
90Interactions with ARB_ES3_compatibility
91
92    On desktop implementations that support ARB_ES3_compatibility,
93    GL_EXT_shader_integer_mix can be enabled (and the new functions
94    used) in shaders declared with '#version 300 es'.
95
96GLX Protocol
97
98    None.
99
100Errors
101
102    None.
103
104New State
105
106    None.
107
108New Implementation Dependent State
109
110    None.
111
112Issues
113
114    1) Should we allow linear interpolation of integers via a non-boolean
115       third component?
116
117    RESOLVED: No.
118
119    2) Should we allow mix() to select between boolean components?
120
121    RESOLVED: Yes. Implementing the same functionality using casts would be
122    possible but ugly.
123
124Revision History
125
126    Rev.    Date      Author    Changes
127    ----  --------    --------  ---------------------------------------------
128      6   09/12/2013  idr       After discussions in Khronos, change vendor
129                                prefix to EXT.
130
131      5   09/09/2013  idr       Add ARB_ES3_compatibility interaction.
132
133      4   09/06/2013  mattst88  Allow extension on OpenGL ES 3.0.
134
135      3   08/28/2013  mattst88  Add #extension/#define changes.
136
137      2   08/26/2013  mattst88  Change vendor prefix to MESA. Add mix() that
138                                selects between boolean components.
139      1   08/26/2013  mattst88  Initial revision
140