1848b8605SmrgName 2848b8605Smrg 3848b8605Smrg EXT_shader_integer_mix 4848b8605Smrg 5848b8605SmrgName Strings 6848b8605Smrg 7848b8605Smrg GL_EXT_shader_integer_mix 8848b8605Smrg 9848b8605SmrgContact 10848b8605Smrg 11848b8605Smrg Matt Turner (matt.turner 'at' intel.com) 12848b8605Smrg 13848b8605SmrgContributors 14848b8605Smrg 15848b8605Smrg Matt Turner, Intel 16848b8605Smrg Ian Romanick, Intel 17848b8605Smrg 18848b8605SmrgStatus 19848b8605Smrg 20848b8605Smrg Shipping 21848b8605Smrg 22848b8605SmrgVersion 23848b8605Smrg 24848b8605Smrg Last Modified Date: 09/12/2013 25848b8605Smrg Author Revision: 6 26848b8605Smrg 27848b8605SmrgNumber 28848b8605Smrg 29848b8605Smrg TBD 30848b8605Smrg 31848b8605SmrgDependencies 32848b8605Smrg 33848b8605Smrg OpenGL 3.0 or OpenGL ES 3.0 is required. This extension interacts with 34848b8605Smrg GL_ARB_ES3_compatibility. 35848b8605Smrg 36848b8605Smrg This extension is written against the OpenGL 4.4 (core) specification 37848b8605Smrg and the GLSL 4.40 specification. 38848b8605Smrg 39848b8605SmrgOverview 40848b8605Smrg 41848b8605Smrg GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to 42848b8605Smrg operate on a boolean third argument that does not interpolate but 43848b8605Smrg selects. This extension extends mix() to select between int, uint, 44848b8605Smrg and bool components. 45848b8605Smrg 46848b8605SmrgNew Procedures and Functions 47848b8605Smrg 48848b8605Smrg None. 49848b8605Smrg 50848b8605SmrgNew Tokens 51848b8605Smrg 52848b8605Smrg None. 53848b8605Smrg 54848b8605SmrgAdditions to Chapter 8 of the GLSL 4.40 Specification (Built-in Functions) 55848b8605Smrg 56848b8605Smrg Modify Section 8.3, Common Functions 57848b8605Smrg 58848b8605Smrg Additions to the table listing common built-in functions: 59848b8605Smrg 60848b8605Smrg Syntax Description 61848b8605Smrg --------------------------- -------------------------------------------------- 62848b8605Smrg genIType mix(genIType x, Selects which vector each returned component comes 63848b8605Smrg genIType y, from. For a component of a that is false, the 64848b8605Smrg genBType a) corresponding component of x is returned. For a 65848b8605Smrg genUType mix(genUType x, component of a that is true, the corresponding 66848b8605Smrg genUType y, component of y is returned. 67848b8605Smrg genBType a) 68848b8605Smrg genBType mix(genBType x, 69848b8605Smrg genBType y, 70848b8605Smrg genBType a) 71848b8605Smrg 72848b8605SmrgAdditions to the AGL/GLX/WGL Specifications 73848b8605Smrg 74848b8605Smrg None. 75848b8605Smrg 76848b8605SmrgModifications to The OpenGL Shading Language Specification, Version 4.40 77848b8605Smrg 78848b8605Smrg Including the following line in a shader can be used to control the 79848b8605Smrg language features described in this extension: 80848b8605Smrg 81848b8605Smrg #extension GL_EXT_shader_integer_mix : <behavior> 82848b8605Smrg 83848b8605Smrg where <behavior> is as specified in section 3.3. 84848b8605Smrg 85848b8605Smrg New preprocessor #defines are added to the OpenGL Shading Language: 86848b8605Smrg 87848b8605Smrg #define GL_EXT_shader_integer_mix 1 88848b8605Smrg 89848b8605SmrgInteractions with ARB_ES3_compatibility 90848b8605Smrg 91848b8605Smrg On desktop implementations that support ARB_ES3_compatibility, 92848b8605Smrg GL_EXT_shader_integer_mix can be enabled (and the new functions 93848b8605Smrg used) in shaders declared with '#version 300 es'. 94848b8605Smrg 95848b8605SmrgGLX Protocol 96848b8605Smrg 97848b8605Smrg None. 98848b8605Smrg 99848b8605SmrgErrors 100848b8605Smrg 101848b8605Smrg None. 102848b8605Smrg 103848b8605SmrgNew State 104848b8605Smrg 105848b8605Smrg None. 106848b8605Smrg 107848b8605SmrgNew Implementation Dependent State 108848b8605Smrg 109848b8605Smrg None. 110848b8605Smrg 111848b8605SmrgIssues 112848b8605Smrg 113848b8605Smrg 1) Should we allow linear interpolation of integers via a non-boolean 114848b8605Smrg third component? 115848b8605Smrg 116848b8605Smrg RESOLVED: No. 117848b8605Smrg 118848b8605Smrg 2) Should we allow mix() to select between boolean components? 119848b8605Smrg 120848b8605Smrg RESOLVED: Yes. Implementing the same functionality using casts would be 121848b8605Smrg possible but ugly. 122848b8605Smrg 123848b8605SmrgRevision History 124848b8605Smrg 125848b8605Smrg Rev. Date Author Changes 126848b8605Smrg ---- -------- -------- --------------------------------------------- 127848b8605Smrg 6 09/12/2013 idr After discussions in Khronos, change vendor 128848b8605Smrg prefix to EXT. 129848b8605Smrg 130848b8605Smrg 5 09/09/2013 idr Add ARB_ES3_compatibility interaction. 131848b8605Smrg 132848b8605Smrg 4 09/06/2013 mattst88 Allow extension on OpenGL ES 3.0. 133848b8605Smrg 134848b8605Smrg 3 08/28/2013 mattst88 Add #extension/#define changes. 135848b8605Smrg 136848b8605Smrg 2 08/26/2013 mattst88 Change vendor prefix to MESA. Add mix() that 137848b8605Smrg selects between boolean components. 138848b8605Smrg 1 08/26/2013 mattst88 Initial revision 139