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