15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci ARB_shader_objects 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_ARB_shader_objects 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Kurt Akeley 125bd8deadSopenharmony_ci Allen Akin 135bd8deadSopenharmony_ci Dave Baldwin 145bd8deadSopenharmony_ci Bob Beretta 155bd8deadSopenharmony_ci Pat Brown 165bd8deadSopenharmony_ci Matt Craighead 175bd8deadSopenharmony_ci Cass Everitt 185bd8deadSopenharmony_ci Mandar Godse 195bd8deadSopenharmony_ci Evan Hart 205bd8deadSopenharmony_ci Phil Huxley 215bd8deadSopenharmony_ci Deron Dann Johnson 225bd8deadSopenharmony_ci James Jones 235bd8deadSopenharmony_ci Dale Kirkland 245bd8deadSopenharmony_ci John Kessenich 255bd8deadSopenharmony_ci Steve Koren 265bd8deadSopenharmony_ci Jon Leech 275bd8deadSopenharmony_ci Bill Licea-Kane 285bd8deadSopenharmony_ci Barthold Lichtenbelt 295bd8deadSopenharmony_ci Kent Lin 305bd8deadSopenharmony_ci Benjamin Lipchak 315bd8deadSopenharmony_ci Rob Mace 325bd8deadSopenharmony_ci Michael McCool 335bd8deadSopenharmony_ci Teri Morrison 345bd8deadSopenharmony_ci Jeremy Morris 355bd8deadSopenharmony_ci Glenn Ortner 365bd8deadSopenharmony_ci Ian Romanick 375bd8deadSopenharmony_ci Randi Rost 385bd8deadSopenharmony_ci Jeremy Sandmel 395bd8deadSopenharmony_ci Folker Schamel 405bd8deadSopenharmony_ci Mik Wells 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ciContact 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci Barthold Lichtenbelt, 3Dlabs, Inc. (barthold 'at' 3dlabs.com) 455bd8deadSopenharmony_ci Randi Rost, 3Dlabs, Inc. (rost 'at' 3dlabs.com) 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciNotice 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci Copyright (c) 2003-2013 The Khronos Group Inc. Copyright terms at 505bd8deadSopenharmony_ci http://www.khronos.org/registry/speccopyright.html 515bd8deadSopenharmony_ci 525bd8deadSopenharmony_ciSpecification Update Policy 535bd8deadSopenharmony_ci 545bd8deadSopenharmony_ci Khronos-approved extension specifications are updated in response to 555bd8deadSopenharmony_ci issues and bugs prioritized by the Khronos OpenGL Working Group. For 565bd8deadSopenharmony_ci extensions which have been promoted to a core Specification, fixes will 575bd8deadSopenharmony_ci first appear in the latest version of that core Specification, and will 585bd8deadSopenharmony_ci eventually be backported to the extension document. This policy is 595bd8deadSopenharmony_ci described in more detail at 605bd8deadSopenharmony_ci https://www.khronos.org/registry/OpenGL/docs/update_policy.php 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ciIP Status 635bd8deadSopenharmony_ci 645bd8deadSopenharmony_ci As described in the Contributor License, which can be found at 655bd8deadSopenharmony_ci http://www.3dlabs.com/support/developer/ogl2/specs/3dlabs_contributor.pdf. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ciStatus 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci Complete. Approved by the ARB on June 11, 2003. 705bd8deadSopenharmony_ci Updated revision 0.89 approved by the ARB on June 17, 2004. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ciVersion 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci Last Modified Date: December 14, 2009 755bd8deadSopenharmony_ci Author Revision: 0.90 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ciNumber 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci ARB Extension #30 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ciDependencies 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci OpenGL 1.0 is required. 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci This extension is written against version 1.10 of the OpenGL Shading 865bd8deadSopenharmony_ci Language Specification. 875bd8deadSopenharmony_ci 885bd8deadSopenharmony_ci The extension is written against the OpenGL 1.4 Specification. 895bd8deadSopenharmony_ci 905bd8deadSopenharmony_ciOverview 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci This extension adds API calls that are necessary to manage shader 935bd8deadSopenharmony_ci objects and program objects as defined in the OpenGL 2.0 white papers by 945bd8deadSopenharmony_ci 3Dlabs. 955bd8deadSopenharmony_ci 965bd8deadSopenharmony_ci The generation of an executable that runs on one of OpenGL's 975bd8deadSopenharmony_ci programmable units is modeled to that of developing a typical C/C++ 985bd8deadSopenharmony_ci application. There are one or more source files, each of which are 995bd8deadSopenharmony_ci stored by OpenGL in a shader object. Each shader object (source file) 1005bd8deadSopenharmony_ci needs to be compiled and attached to a program object. Once all shader 1015bd8deadSopenharmony_ci objects are compiled successfully, the program object needs to be linked 1025bd8deadSopenharmony_ci to produce an executable. This executable is part of the program object, 1035bd8deadSopenharmony_ci and can now be loaded onto the programmable units to make it part of the 1045bd8deadSopenharmony_ci current OpenGL state. Both the compile and link stages generate a text 1055bd8deadSopenharmony_ci string that can be queried to get more information. This information 1065bd8deadSopenharmony_ci could be, but is not limited to, compile errors, link errors, 1075bd8deadSopenharmony_ci optimization hints, etc. Values for uniform variables, declared in a 1085bd8deadSopenharmony_ci shader, can be set by the application and used to control a shader's 1095bd8deadSopenharmony_ci behavior. 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci This extension defines functions for creating shader objects and program 1125bd8deadSopenharmony_ci objects, for compiling shader objects, for linking program objects, for 1135bd8deadSopenharmony_ci attaching shader objects to program objects, and for using a program 1145bd8deadSopenharmony_ci object as part of current state. Functions to load uniform values are 1155bd8deadSopenharmony_ci also defined. Some house keeping functions, like deleting an object and 1165bd8deadSopenharmony_ci querying object state, are also provided. 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci Although this extension defines the API for creating shader objects, it 1195bd8deadSopenharmony_ci does not define any specific types of shader objects. It is assumed that 1205bd8deadSopenharmony_ci this extension will be implemented along with at least one such 1215bd8deadSopenharmony_ci additional extension for creating a specific type of OpenGL 2.0 shader 1225bd8deadSopenharmony_ci (e.g., the ARB_fragment_shader extension or the ARB_vertex_shader 1235bd8deadSopenharmony_ci extension). 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ciIssues 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ci 1) What to do if part of a shader pair is not present? 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci DISCUSSION: There are several shader types that go together. For 1305bd8deadSopenharmony_ci example, a VERTEX_SHADER and a FRAGMENT_SHADER form a pair that is part 1315bd8deadSopenharmony_ci of the geometry pipeline. It is not required to supply both shader types 1325bd8deadSopenharmony_ci of a pair in a program object. 1335bd8deadSopenharmony_ci 1345bd8deadSopenharmony_ci RESOLUTION: If one or the other of a pair is not present in the program 1355bd8deadSopenharmony_ci object, OpenGL will substitute the standard 1.4 OpenGL pipeline for the 1365bd8deadSopenharmony_ci one not present. The most likely place for this substitution to happen 1375bd8deadSopenharmony_ci is the link stage. Note that it is defined elsewhere exactly what part 1385bd8deadSopenharmony_ci of the OpenGL 1.4 pipeline a shader replaces. 1395bd8deadSopenharmony_ci 1405bd8deadSopenharmony_ci 2) Should source code string passed to ShaderSourceARB be null 1415bd8deadSopenharmony_ci terminated? 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci DISCUSSION: Source code strings should not be required to end with the 1445bd8deadSopenharmony_ci byte 0. This is a programming language dependent concept, and interferes 1455bd8deadSopenharmony_ci with loading source code out of files. (Memory mapping read-only files 1465bd8deadSopenharmony_ci leaves no ability to add a 0 at the end without an extra copy). 1475bd8deadSopenharmony_ci Development of shaders can be from files, not necessarily from embedded 1485bd8deadSopenharmony_ci source. If null termination was required a shader's source code would be 1495bd8deadSopenharmony_ci read from a file, based on an address and a length, then get copied to 1505bd8deadSopenharmony_ci add a 0 on, then are passed to the compiler which promptly goes and 1515bd8deadSopenharmony_ci finds the 0, in order to get back to an address and a length. That is 1525bd8deadSopenharmony_ci all useless work. 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci RESOLUTION: It is allowed, but not required, to have a null termination 1555bd8deadSopenharmony_ci at the end of the string. If the string is null terminated, OpenGL can 1565bd8deadSopenharmony_ci find out the length of the string, and the length parameter passed in 1575bd8deadSopenharmony_ci can be set to negative one. 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ci 3) Should the string passed in to GetUniformLocationARB be null 1605bd8deadSopenharmony_ci terminated? 1615bd8deadSopenharmony_ci 1625bd8deadSopenharmony_ci DISCUSSION: It is not very likely that this will be a memory mapped 1635bd8deadSopenharmony_ci file, therefore null termination can be assumed. 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci RESOLUTION: Yes. 1665bd8deadSopenharmony_ci 1675bd8deadSopenharmony_ci 4) Should the string returned by GetInfoLog be null terminated? 1685bd8deadSopenharmony_ci 1695bd8deadSopenharmony_ci DISCUSSION: In this case it is useful to have the info string be null 1705bd8deadSopenharmony_ci terminated, so it can be passed to printf() directly. All other strings 1715bd8deadSopenharmony_ci returned by the GL are also null terminated. 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci RESOLUTION: YES 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci 5) Should GetInfoLog also return the length of the string? 1765bd8deadSopenharmony_ci 1775bd8deadSopenharmony_ci DISCUSSION: This applies to an older version of GetInfoLog, but is no 1785bd8deadSopenharmony_ci longer applicable. 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci RESOLUTION: N/A 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci 6) Do we need a new GLcharARB data type to handle input strings? 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci DISCUSSION: Currently there is no precedence of passing in strings into 1855bd8deadSopenharmony_ci OpenGL. This exposes a deficiency in OpenGL data types. In C++ a literal 1865bd8deadSopenharmony_ci string is of type char. OpenGL only has GLubyte and GLbyte data types, 1875bd8deadSopenharmony_ci defined as being unsigned char and signed char respectively. This means 1885bd8deadSopenharmony_ci that it is not possible to pass a literal string to OpenGL using either 1895bd8deadSopenharmony_ci GLubyte or GLbyte. For example, GetUniformLocationARB(programObj, 1905bd8deadSopenharmony_ci "Offset") needs to have the prototype GetUniformLocationARB(handleARB 1915bd8deadSopenharmony_ci obj, const char *string). 1925bd8deadSopenharmony_ci 1935bd8deadSopenharmony_ci RESOLUTION: YES 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci 7) Do we load uniforms using their string representation? 1965bd8deadSopenharmony_ci 1975bd8deadSopenharmony_ci DISCUSSION: Loading uniforms is still performance sensitive, although 1985bd8deadSopenharmony_ci not as much as vertex attributes. Passing in a string into the load 1995bd8deadSopenharmony_ci uniform command seems too big of a performance hit. Every time the load 2005bd8deadSopenharmony_ci is called the string needs to be parsed and the location for the data 2015bd8deadSopenharmony_ci computed. It is better to move this performance cost outside the load 2025bd8deadSopenharmony_ci uniform command into GetUniformLocationARB. 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci RESOLUTION: NO. 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci 8) Should Uniform*ARB take a program object as a parameter? 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ci DISCUSSION: Again, this is a performance issue. If it does, the object 2095bd8deadSopenharmony_ci passed in needs to be validated for every uniform loaded. Instead, move 2105bd8deadSopenharmony_ci this validation cost outside the uniform command, and have the uniform 2115bd8deadSopenharmony_ci command modify uniforms for the currently in use program object (Set by 2125bd8deadSopenharmony_ci UseProgramObjectARB). The validation cost is now much lower. The program 2135bd8deadSopenharmony_ci object is validated once, when calling UseProgramObjectARB. 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci RESOLUTION: NO. 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci 9) Should uniform values be state per program object? 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci DISCUSSION: Should values loaded for uniforms be kept in a program 2205bd8deadSopenharmony_ci object, so that they are retained across program object switches? This 2215bd8deadSopenharmony_ci is application friendly. However, loading uniforms becomes a bit more of 2225bd8deadSopenharmony_ci a heavy weight operation because the OpenGL implementation now has to 2235bd8deadSopenharmony_ci store its values with the program object, and reload when the program 2245bd8deadSopenharmony_ci object is made current, even if the previous program object already had 2255bd8deadSopenharmony_ci the same uniform values loaded. 2265bd8deadSopenharmony_ci 2275bd8deadSopenharmony_ci RESOLUTION: YES. We don't want to force an application to re-load its 2285bd8deadSopenharmony_ci uniforms every time a program object is used. 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci 10) Should the name space for uniforms be global per program object? 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci DISCUSSION: If one shader object references a uniform called "foo" and 2335bd8deadSopenharmony_ci another shader object, attached to the same program object, also 2345bd8deadSopenharmony_ci references "foo", are those shaders referencing the same uniform? If 2355bd8deadSopenharmony_ci they do not reference the same uniform values, uniforms now need to be 2365bd8deadSopenharmony_ci state per shader object and loaded per shader object. Also, if a vertex 2375bd8deadSopenharmony_ci shader references "foo" and the accompanying fragment shader also 2385bd8deadSopenharmony_ci references "foo", it would make sense to expect those to be the same 2395bd8deadSopenharmony_ci uniform reference. 2405bd8deadSopenharmony_ci 2415bd8deadSopenharmony_ci RESOLUTION: YES. 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ci 11) What to do if no value is loaded for a uniform? 2445bd8deadSopenharmony_ci 2455bd8deadSopenharmony_ci DISCUSSION: A program object can be used and rendering commenced without 2465bd8deadSopenharmony_ci loading values for all the uniforms referenced in its shader objects. 2475bd8deadSopenharmony_ci What to do in this case? Note that the values of the uniforms are state 2485bd8deadSopenharmony_ci belonging to the program object. Once loaded, these values are reused 2495bd8deadSopenharmony_ci whenever the program object is in use again. Should uniforms have an 2505bd8deadSopenharmony_ci initial value? 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci RESOLUTION: Uniforms are initialized to zero. 2535bd8deadSopenharmony_ci 2545bd8deadSopenharmony_ci 12) Should it be allowed to load uniforms in a display list? 2555bd8deadSopenharmony_ci 2565bd8deadSopenharmony_ci DISCUSSION: Doing so will make the display list tied to a program 2575bd8deadSopenharmony_ci object. The location passed in to the load uniform commands is program 2585bd8deadSopenharmony_ci object specific. However, this can still be useful for some 2595bd8deadSopenharmony_ci applications. If a program object is in use at CallList time which does 2605bd8deadSopenharmony_ci not match that display list, then all bets are off. See also issue 30. 2615bd8deadSopenharmony_ci 2625bd8deadSopenharmony_ci RESOLUTION: YES 2635bd8deadSopenharmony_ci 2645bd8deadSopenharmony_ci 13) Do we need uniforms that are local to a program object and uniforms 2655bd8deadSopenharmony_ci that are globally accessible by all program objects? 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci DISCUSSION: ARB_vertex_program has this functionality. It seems 2685bd8deadSopenharmony_ci convenient to be able to set a uniform once, and have its value be 2695bd8deadSopenharmony_ci accessible across many shaders (for example, a uniform used to set a 2705bd8deadSopenharmony_ci light position). This type of global uniform could be a performance win 2715bd8deadSopenharmony_ci as well, its value does not have to be cached by OpenGL per program 2725bd8deadSopenharmony_ci object, and re-loaded at every program object switch. 2735bd8deadSopenharmony_ci 2745bd8deadSopenharmony_ci RESOLUTION: This is useful, but for this version of the spec this 2755bd8deadSopenharmony_ci functionality is deferred. 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci 14) Do we need INT, FLOAT and BOOL versions of the load uniform 2785bd8deadSopenharmony_ci commands? 2795bd8deadSopenharmony_ci 2805bd8deadSopenharmony_ci DISCUSSION: There are two types to keep separate. The type the uniform 2815bd8deadSopenharmony_ci is declared in the shader, and the type of the data the application uses 2825bd8deadSopenharmony_ci for uniform values. There are three basic uniform types that can be 2835bd8deadSopenharmony_ci declared in a shader: Float, Int and Bool. Thus one can envision an API 2845bd8deadSopenharmony_ci where the uniform type is encoded in the API name, besides the 2855bd8deadSopenharmony_ci application's data type. For example, UniformInt3iv(). Where the word 2865bd8deadSopenharmony_ci 'Int' encodes the uniform type, and 'iv' the user input data type. On 2875bd8deadSopenharmony_ci the other hand, the uniform type information is known to the GL, and 2885bd8deadSopenharmony_ci therefore encoding it in the API name is redundant. 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci RESOLUTION: We won't encode the uniform type in the API name. 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci 15) There is the potential for a huge explosion of load uniform 2935bd8deadSopenharmony_ci commands, what to do? 2945bd8deadSopenharmony_ci 2955bd8deadSopenharmony_ci DISCUSSION: We need to be able to load a vec1, vec2, vec3, or vec4, or 2965bd8deadSopenharmony_ci arrays of vec1, arrays of vec2, arrays of vec3 or arrays of vec4. 2975bd8deadSopenharmony_ci Furtheremore, there is a need to also load 2x2, 3x3 and 4x4 matrices, 2985bd8deadSopenharmony_ci and arrays of 2x2, arrays of 3x3 and arrays of 4x4 matrices. The input 2995bd8deadSopenharmony_ci values to the load uniforms commands can (traditional OpenGL) come in 3005bd8deadSopenharmony_ci bytes, shorts, ints, floats, doubles and unsigned bytes, unsigned shorts 3015bd8deadSopenharmony_ci and unsigned ints. 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci RESOLUTION: A suggested subset is in the New Procedures and Functions 3045bd8deadSopenharmony_ci section below. 3055bd8deadSopenharmony_ci 3065bd8deadSopenharmony_ci 16) Should a special INVALID_HANDLE for the data type handleARB be 3075bd8deadSopenharmony_ci provided, or is 0 sufficient? 3085bd8deadSopenharmony_ci 3095bd8deadSopenharmony_ci DISCUSSION: 0 is fine. There are less code defects if code compares to 3105bd8deadSopenharmony_ci zero than some invalid handle that is defined to zero anyway. 3115bd8deadSopenharmony_ci Applications should not compare to NULL, since NULL is not necessarily 3125bd8deadSopenharmony_ci defined to be zero in C, only in C++. Besides, a handleARB is an 3135bd8deadSopenharmony_ci integer. 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci RESOLUTION: YES. 3165bd8deadSopenharmony_ci 3175bd8deadSopenharmony_ci 17) What happens if the currently in use program object is re-linked by 3185bd8deadSopenharmony_ci calling LinkProgramARB? 3195bd8deadSopenharmony_ci 3205bd8deadSopenharmony_ci DISCUSSION: Consider that the currently in use program object has a 3215bd8deadSopenharmony_ci uniform named "foo". The application changed some code around in that 3225bd8deadSopenharmony_ci program object, and still has a uniform named "foo", then calls 3235bd8deadSopenharmony_ci LinkProgramARB. After this link call the location of "foo" does not have 3245bd8deadSopenharmony_ci to be the same as before the link call. If LinkProgramARB does not imply 3255bd8deadSopenharmony_ci a call to UseProgramObjectARB, then a call to Uniform*ARB to load a 3265bd8deadSopenharmony_ci value for "foo" is ill defined. In this case, does the application use 3275bd8deadSopenharmony_ci the old location of "foo" or the new location? 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci It is consistent with other parts of OpenGL to have updates to an object 3305bd8deadSopenharmony_ci take effect after the update without issuing another command to make the 3315bd8deadSopenharmony_ci update active, for example the TexSubImage* commands. 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci RESOLUTION: The re-linked program will be used automatically, without 3345bd8deadSopenharmony_ci requiring a new call to UseProgarmObjectARB. 3355bd8deadSopenharmony_ci 3365bd8deadSopenharmony_ci 18) Should object handles be allocated by the application or by OpenGL? 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci DISCUSSION: For current OpenGL objects such as textures and display 3395bd8deadSopenharmony_ci lists, object Ids can be assigned by the application. The Id name space 3405bd8deadSopenharmony_ci is unique for texture objects and display lists. This resulted in a 3415bd8deadSopenharmony_ci different API for generating and managing texture Ids or Display List 3425bd8deadSopenharmony_ci Ids. 3435bd8deadSopenharmony_ci 3445bd8deadSopenharmony_ci It is not desirable to keep the same mechanism for general object 3455bd8deadSopenharmony_ci management. It prevents the definition of generic operations on objects 3465bd8deadSopenharmony_ci such as deletion and querying. It prevents the OpenGL implementation 3475bd8deadSopenharmony_ci from managing the name space the way it sees fit. It is much more common 3485bd8deadSopenharmony_ci for the underlying library to allocate and manage handles and thereby 3495bd8deadSopenharmony_ci keep control of the name space. It can make using a third party supplied 3505bd8deadSopenharmony_ci library harder or even impossible. 3515bd8deadSopenharmony_ci 3525bd8deadSopenharmony_ci RESOLUTION: Object handles should be allocated and its name space 3535bd8deadSopenharmony_ci managed by OpenGL, not by the application. 3545bd8deadSopenharmony_ci 3555bd8deadSopenharmony_ci 19) Should a handle be opaque to the application? 3565bd8deadSopenharmony_ci 3575bd8deadSopenharmony_ci DISCUSSION: A handle is only read and written by OpenGL. Therefore the 3585bd8deadSopenharmony_ci interpretation of the value of the handle does not need to be exposed to 3595bd8deadSopenharmony_ci the application. However, we will expose how a handle is implemented. 3605bd8deadSopenharmony_ci Certain implementation choices for handles, like a pointer, are 3615bd8deadSopenharmony_ci discouraged. The practical solution seems to be to make a handle an 3625bd8deadSopenharmony_ci integer. 3635bd8deadSopenharmony_ci 3645bd8deadSopenharmony_ci RESOLUTION: YES. 3655bd8deadSopenharmony_ci 3665bd8deadSopenharmony_ci 20) Do we need a way to get the source code back from a shader object? 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci DISCUSSION: To stay with the OpenGL philosophy that any state that can 3695bd8deadSopenharmony_ci be set also be queried, we need such a get. This function will return 3705bd8deadSopenharmony_ci the last set of strings stored in a shader object. Note that this set of 3715bd8deadSopenharmony_ci strings is not necessarily the same as the set of strings that compiled 3725bd8deadSopenharmony_ci and linked into program object currently in use. 3735bd8deadSopenharmony_ci 3745bd8deadSopenharmony_ci RESOLUTION: YES, this is achieved through GetShaderSourceARB. 3755bd8deadSopenharmony_ci 3765bd8deadSopenharmony_ci 21) Are the limits on all resources an executable uses queriable and 3775bd8deadSopenharmony_ci known to the application? 3785bd8deadSopenharmony_ci 3795bd8deadSopenharmony_ci DISCUSSION: Various proposals have been discussed. One very important 3805bd8deadSopenharmony_ci consideration is to end up with a specification that provides 3815bd8deadSopenharmony_ci application portability (e.g., ISVs do not need to support multiple 3825bd8deadSopenharmony_ci rendering back ends in order to run on all the different flavors of 3835bd8deadSopenharmony_ci hardware). ISVs definitely would prefer the specification to say that 3845bd8deadSopenharmony_ci the OpenGL Shading Language implementation is responsible for ensuring 3855bd8deadSopenharmony_ci that all valid shaders must run. 3865bd8deadSopenharmony_ci 3875bd8deadSopenharmony_ci RESOLUTION: Resources that are easy to count (number of uniforms 3885bd8deadSopenharmony_ci available to a vertex shader, number of uniforms available to a fragment 3895bd8deadSopenharmony_ci shader, number of vertex attributes, number of varyings, number of 3905bd8deadSopenharmony_ci texture units) will have queriable limits. The application is 3915bd8deadSopenharmony_ci responsible for working within these externally visible limits. The 3925bd8deadSopenharmony_ci OpenGL Shading Language implementation is responsible for virtualizing 3935bd8deadSopenharmony_ci resources that are not easy to count (for example, the number of machine 3945bd8deadSopenharmony_ci instructions in the final executable, number of temporary registers used 3955bd8deadSopenharmony_ci in the final executable, etc.). The expectation is that for any 3965bd8deadSopenharmony_ci practical application an executable (generated by the link stage) will 3975bd8deadSopenharmony_ci run. 3985bd8deadSopenharmony_ci 3995bd8deadSopenharmony_ci 22) Should a higher level shading language be layered on top of OpenGL 4005bd8deadSopenharmony_ci instead of being designed to fit within OpenGL? 4015bd8deadSopenharmony_ci 4025bd8deadSopenharmony_ci DISCUSSION: In the current design, the OpenGL Shading Language is 4035bd8deadSopenharmony_ci integrated into OpenGL and just provides alternative methods to the 4045bd8deadSopenharmony_ci state controlled pipeline of OpenGL 1.4. The Stanford approach is to 4055bd8deadSopenharmony_ci layer their shading language on top of OpenGL. This has some advantages 4065bd8deadSopenharmony_ci and disadvantages that will become apparent when the differences are 4075bd8deadSopenharmony_ci examined. 4085bd8deadSopenharmony_ci 4095bd8deadSopenharmony_ci The Stanford approach uses a higher abstraction level. This helps with 4105bd8deadSopenharmony_ci writing some kinds of programs where the abstractions match the problem 4115bd8deadSopenharmony_ci domain. For example treating lights and surfaces as abstract entities 4125bd8deadSopenharmony_ci makes some 3D graphics operations easier, however OpenGL is now being 4135bd8deadSopenharmony_ci used for video and image processing where this abstraction is largely 4145bd8deadSopenharmony_ci irrelevant. Similarly many games have shunned lighting via traditional 4155bd8deadSopenharmony_ci means and use textures (light maps) instead. 4165bd8deadSopenharmony_ci 4175bd8deadSopenharmony_ci There is nothing in the OpenGL Shading Language or bindings that prevent 4185bd8deadSopenharmony_ci higher levels of abstractions from being layered on top of a 4195bd8deadSopenharmony_ci programmable OpenGL. We also wish to keep the overall abstraction level 4205bd8deadSopenharmony_ci of OpenGL at its current level. 4215bd8deadSopenharmony_ci 4225bd8deadSopenharmony_ci The Stanford approach also provides for different computational 4235bd8deadSopenharmony_ci frequencies. By having the higher levels of abstraction where one 4245bd8deadSopenharmony_ci program defines the current graphics operation in total allows the 4255bd8deadSopenharmony_ci compiler to separate out the parts that need to run at the primitive 4265bd8deadSopenharmony_ci group level, primitive level, vertex level and fragment level. The 4275bd8deadSopenharmony_ci compiler can therefore generate the code to run on the CPU, vertex 4285bd8deadSopenharmony_ci processor and fragment processor as appropriate. This is obviously more 4295bd8deadSopenharmony_ci complicated to implement than having the programmer specify the programs 4305bd8deadSopenharmony_ci to run on each part of the pipeline (although some hints are still 4315bd8deadSopenharmony_ci required by the Stanford language), although this does make the 4325bd8deadSopenharmony_ci virtualization of the hardware easier as the compiler has the overall 4335bd8deadSopenharmony_ci view. 4345bd8deadSopenharmony_ci 4355bd8deadSopenharmony_ci The major disadvantage of this is that it forces more intrusive changes 4365bd8deadSopenharmony_ci to OpenGL to support the clear delineation of the primitives, vertices 4375bd8deadSopenharmony_ci and fragment operations. Many of the core OpenGL features have been 4385bd8deadSopenharmony_ci replaced. 4395bd8deadSopenharmony_ci 4405bd8deadSopenharmony_ci An advantage of the current approach is that the look and feel of OpenGL 4415bd8deadSopenharmony_ci 1.4 is maintained and it allows a graceful mix and match approach during 4425bd8deadSopenharmony_ci the transition period from fixed functionality to full programmability. 4435bd8deadSopenharmony_ci 4445bd8deadSopenharmony_ci This is not a criticism of the Stanford work, as they had no choice but 4455bd8deadSopenharmony_ci to layer on top of OpenGL. 4465bd8deadSopenharmony_ci 4475bd8deadSopenharmony_ci RESOLUTION: The OpenGL Shading Language should be built into OpenGL, and 4485bd8deadSopenharmony_ci not layered on top. It is also noted that if this is not the case, 4495bd8deadSopenharmony_ci OpenGL should still have a standard shading language. 4505bd8deadSopenharmony_ci 4515bd8deadSopenharmony_ci 23) Should an error be set if a glUseProgramObjectARB call is made on a 4525bd8deadSopenharmony_ci program object that has not been successfully linked? 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci DISCUSSION: This was an issue when UseProgramObject returned a Boolean 4555bd8deadSopenharmony_ci indicating success or failure. However, it no longer does, thus an error 4565bd8deadSopenharmony_ci has to be generated. 4575bd8deadSopenharmony_ci 4585bd8deadSopenharmony_ci RESOLUTION: YES 4595bd8deadSopenharmony_ci 4605bd8deadSopenharmony_ci 24) Do we need a way to get object code back, just like the model of C 4615bd8deadSopenharmony_ci on host processors? 4625bd8deadSopenharmony_ci 4635bd8deadSopenharmony_ci DISCUSSION: Lots in email on the arb-gl2 mailing list. This is about 4645bd8deadSopenharmony_ci lowest-level, machine specific code that may not even be portable within 4655bd8deadSopenharmony_ci a family of cards from the same vendor. One main goal is to save 4665bd8deadSopenharmony_ci compilation time. There seems to be general consensus that this has 4675bd8deadSopenharmony_ci merit. 4685bd8deadSopenharmony_ci 4695bd8deadSopenharmony_ci RESOLUTION: This is an interesting capability to have, but will be 4705bd8deadSopenharmony_ci deferred to the next release or could be added as a separate extension. 4715bd8deadSopenharmony_ci 4725bd8deadSopenharmony_ci 25) How are samplers used to access textures? 4735bd8deadSopenharmony_ci 4745bd8deadSopenharmony_ci DISCUSSION: Samplers are special uniforms used in the OpenGL Shading 4755bd8deadSopenharmony_ci Language to identify the texture object used for each texture lookup. 4765bd8deadSopenharmony_ci The value of a sampler indicates the texture image unit being accessed. 4775bd8deadSopenharmony_ci The type of the sampler identifies the target on that texture image 4785bd8deadSopenharmony_ci unit. The texture object bound to that texture image unit's target is 4795bd8deadSopenharmony_ci then used for the texture lookup. For example, a variable of type 4805bd8deadSopenharmony_ci sampler2D selects target TEXTURE_2D on its texture image unit. Binding 4815bd8deadSopenharmony_ci of texture objects to targets is done as usual with BindTexture. 4825bd8deadSopenharmony_ci Selecting the texture image unit to bind is done as usual with 4835bd8deadSopenharmony_ci ActiveTexture. 4845bd8deadSopenharmony_ci 4855bd8deadSopenharmony_ci The location of a sampler needs to be queried with 4865bd8deadSopenharmony_ci GetUniformLocationARB, just like any uniform variable, and its value 4875bd8deadSopenharmony_ci needs to be set by calling Uniform1i{v}ARB. 4885bd8deadSopenharmony_ci 4895bd8deadSopenharmony_ci In the future, sampler types might allow for binding a texture object 4905bd8deadSopenharmony_ci directly, instead of binding to a texture image unit first, to get to a 4915bd8deadSopenharmony_ci texture object. 4925bd8deadSopenharmony_ci 4935bd8deadSopenharmony_ci RESOLUTION: Resolved 4945bd8deadSopenharmony_ci 4955bd8deadSopenharmony_ci 26) Do we need a validation command as a developers aid? 4965bd8deadSopenharmony_ci 4975bd8deadSopenharmony_ci DISCUSSION: The LinkProgramARB command will check if the code in all 4985bd8deadSopenharmony_ci shaders in the program object will link. It will catch things like 4995bd8deadSopenharmony_ci having too many active samplers, a mismatch between varyings in a vertex 5005bd8deadSopenharmony_ci and fragment shader, etc. However, it will not check for any errors 5015bd8deadSopenharmony_ci related to the values of uniforms or inconsistent OpenGL state that 5025bd8deadSopenharmony_ci would result in undefined behavior or worse, prevent a program object 5035bd8deadSopenharmony_ci from executing. A validation command could check for things like a 5045bd8deadSopenharmony_ci mismatch between a shadow texture lookup and no TEXTURE_COMPARE_MODE 5055bd8deadSopenharmony_ci set. Or check for values of samplers being out of range. Or check for 5065bd8deadSopenharmony_ci samplers of different types being used to access the same texture image 5075bd8deadSopenharmony_ci unit, etc. This validate command will at least do all the validation 5085bd8deadSopenharmony_ci that needs to occur at render time, and it could do anything extra that 5095bd8deadSopenharmony_ci might help the developer understand their shader(s) better. Note that it 5105bd8deadSopenharmony_ci is not necessary to call validate, it only is a development tool. 5115bd8deadSopenharmony_ci 5125bd8deadSopenharmony_ci RESOLUTION: YES, this is a desirable feature. 5135bd8deadSopenharmony_ci 5145bd8deadSopenharmony_ci 27) Should there be an info log per object? 5155bd8deadSopenharmony_ci 5165bd8deadSopenharmony_ci DISCUSSION: To store the info log per object created is consistent with 5175bd8deadSopenharmony_ci the whole object model. However, it might not be useful to keep an info 5185bd8deadSopenharmony_ci log around till the object is deleted. It does take resources away from 5195bd8deadSopenharmony_ci the system. Hence we could keep one info log per object type (shader or 5205bd8deadSopenharmony_ci program objects) as not to take too many resources. 5215bd8deadSopenharmony_ci 5225bd8deadSopenharmony_ci Alternatively, the specification could say that at least one info log is 5235bd8deadSopenharmony_ci kept per object type, but that the GL implementation is free to keep 5245bd8deadSopenharmony_ci more. This was considered in an earlier version of this specification, 5255bd8deadSopenharmony_ci but broke down when considering the life time of an info log in a 5265bd8deadSopenharmony_ci multi-context situation. 5275bd8deadSopenharmony_ci 5285bd8deadSopenharmony_ci Note that in either case the API definition for GetInfoLogARB does not 5295bd8deadSopenharmony_ci change. The application passes in a handle for the object, and if the 5305bd8deadSopenharmony_ci info log does not exist it returns an empty string. 5315bd8deadSopenharmony_ci 5325bd8deadSopenharmony_ci RESOLUTION: We will have an info log per object, and not worry about the 5335bd8deadSopenharmony_ci resource usage. 5345bd8deadSopenharmony_ci 5355bd8deadSopenharmony_ci 28) Is there a need to have a command to append source code to a shader 5365bd8deadSopenharmony_ci object? 5375bd8deadSopenharmony_ci 5385bd8deadSopenharmony_ci DISCUSSION: AppendShaderARB facilitates applications that generate 5395bd8deadSopenharmony_ci shaders on the fly. Developers can pass parts of a shader source to 5405bd8deadSopenharmony_ci OpenGL this way. However, the application can do the same thing in its 5415bd8deadSopenharmony_ci own memory buffer, and then pass the whole shader to OpenGL using 5425bd8deadSopenharmony_ci ShaderSourceARB. The application usually doesn't have to copy or 5435bd8deadSopenharmony_ci concatenate strings together. It can build a list of strings and pass 5445bd8deadSopenharmony_ci those to OpenGL all at once using ShaderSourceARB. 5455bd8deadSopenharmony_ci 5465bd8deadSopenharmony_ci RESOLUTION: No, this is deemed not necessary. 5475bd8deadSopenharmony_ci 5485bd8deadSopenharmony_ci 29) Should loading the source code into a shader object automatically 5495bd8deadSopenharmony_ci invoke a compilation? 5505bd8deadSopenharmony_ci 5515bd8deadSopenharmony_ci DISCUSSION: Keeping the loading of source and compilation of the source 5525bd8deadSopenharmony_ci as two distinctive API commands makes it possible for the application to 5535bd8deadSopenharmony_ci control when an expensive operation like a compile is done. For example, 5545bd8deadSopenharmony_ci it could first load all source for all its shaders at startup, and 5555bd8deadSopenharmony_ci compile them as needed through the execution of the application. Keeping 5565bd8deadSopenharmony_ci it separate leaves the most control to the application. 5575bd8deadSopenharmony_ci 5585bd8deadSopenharmony_ci RESOLUTION: No. 5595bd8deadSopenharmony_ci 5605bd8deadSopenharmony_ci 30) What happens if an application tries to load more values in a 5615bd8deadSopenharmony_ci uniform than its declared extent? 5625bd8deadSopenharmony_ci 5635bd8deadSopenharmony_ci DISCUSSION: It is possible to run off the end of a uniform, which could 5645bd8deadSopenharmony_ci potentially corrupt other uniforms, or any data that is stored by OpenGL 5655bd8deadSopenharmony_ci at the position next to the uniform. 5665bd8deadSopenharmony_ci 5675bd8deadSopenharmony_ci Since it is not known, nor desirable to dictate, where an implementation 5685bd8deadSopenharmony_ci stores its uniforms, it cannot be defined what happens when a load 5695bd8deadSopenharmony_ci uniform command runs off the end. While enforcing bounds checking is 5705bd8deadSopenharmony_ci potentially expensive and can cost a good deal of performance, the 5715bd8deadSopenharmony_ci safety provided by bounds checking is considered more important than the 5725bd8deadSopenharmony_ci highest possible uniform loading performance. 5735bd8deadSopenharmony_ci 5745bd8deadSopenharmony_ci Note also that the OpenGL Shading Language states that it is undefined 5755bd8deadSopenharmony_ci when a shader references an array element outside the array bounds. 5765bd8deadSopenharmony_ci 5775bd8deadSopenharmony_ci RESOLUTION: The GL implementation must do whatever bounds checking is 5785bd8deadSopenharmony_ci necessary while loading uniforms. Applications that would like the 5795bd8deadSopenharmony_ci highest API performance should strongly consider using vertex attributes 5805bd8deadSopenharmony_ci for a small number of frequently changing values. 5815bd8deadSopenharmony_ci 5825bd8deadSopenharmony_ci 31) Should UseProgramObjectARB be display-list-able? 5835bd8deadSopenharmony_ci 5845bd8deadSopenharmony_ci DISCUSSION: Consider a geometric object consisting of multiple 5855bd8deadSopenharmony_ci primitives. The primitives within this geometric object are rendered 5865bd8deadSopenharmony_ci using different shaders. The only way to encapsulate this into one 5875bd8deadSopenharmony_ci display list is by allowing UseProgramObjectARB to be compiled into a 5885bd8deadSopenharmony_ci display list. If this is not allowed, then the geometric object has to 5895bd8deadSopenharmony_ci be broken up in potentially many display lists, creating a management 5905bd8deadSopenharmony_ci nightmare for ISVs. 5915bd8deadSopenharmony_ci 5925bd8deadSopenharmony_ci ARB_vertex_program allows BindProgramARB to be compiled into a display 5935bd8deadSopenharmony_ci list. Thus when using ARB_vertex_program it is possible to achieve the 5945bd8deadSopenharmony_ci scenario described above. 5955bd8deadSopenharmony_ci 5965bd8deadSopenharmony_ci UseProgramObjectARB will generate a GL error if its operation failed, so 5975bd8deadSopenharmony_ci that applications can still check if it succeeded. 5985bd8deadSopenharmony_ci 5995bd8deadSopenharmony_ci RESOLUTION: Yes 6005bd8deadSopenharmony_ci 6015bd8deadSopenharmony_ci 32) Can you explain how uniform loading works? 6025bd8deadSopenharmony_ci 6035bd8deadSopenharmony_ci DISCUSSION: Uniform variables, including samplers, are named and 6045bd8deadSopenharmony_ci declared in a shader. This name is a string and needs to be used in 6055bd8deadSopenharmony_ci GetUniformLocationARB to retrieve a location ID. Once this location ID 6065bd8deadSopenharmony_ci has been retrieved it won't change until the next call to 6075bd8deadSopenharmony_ci LinkProgramARB. After LinkProgramARB has been issued, the application 6085bd8deadSopenharmony_ci will have to query the location IDs of uniform variables again. 6095bd8deadSopenharmony_ci LinkProgramARB will initialize all uniforms to zero. Note that 6105bd8deadSopenharmony_ci GetUniformLocationARB will only return a location ID if the uniform is 6115bd8deadSopenharmony_ci part of the set of active uniforms, else it will return -1. The set of 6125bd8deadSopenharmony_ci active uniforms, for a given program object, can be queried with 6135bd8deadSopenharmony_ci GetActiveUniformARB. 6145bd8deadSopenharmony_ci 6155bd8deadSopenharmony_ci Once the location ID is obtained, it can be used in the Uniform*ARB 6165bd8deadSopenharmony_ci commands to load value(s) for the uniform. Note that the Uniform*ARB 6175bd8deadSopenharmony_ci command used has to match the size and the type of the uniform variable. 6185bd8deadSopenharmony_ci 6195bd8deadSopenharmony_ci GetUniformLocationARB can only retrieve location IDs for uniforms 6205bd8deadSopenharmony_ci declared as a basic type (float, int, bool and vectors thereof) and 6215bd8deadSopenharmony_ci arrays of basic types. It is not possible to query the location ID of a 6225bd8deadSopenharmony_ci structure, for example. The application will have to break down the 6235bd8deadSopenharmony_ci structure into its fields until it has reached a basic type or an array 6245bd8deadSopenharmony_ci of basic type. It does this by using the "." (dot) and "[]" operations 6255bd8deadSopenharmony_ci in the name string passed to GetUniformLocationARB. It is possible to 6265bd8deadSopenharmony_ci query the location ID of an element K in an array. It is possible to use 6275bd8deadSopenharmony_ci that location ID to load multiple values into an array starting at that 6285bd8deadSopenharmony_ci location K. However, it is not possible to take that location ID and add 6295bd8deadSopenharmony_ci an integer N to that location ID to advance to element K + N in that 6305bd8deadSopenharmony_ci array. The application will have to query the location ID of array 6315bd8deadSopenharmony_ci element K + N separately. 6325bd8deadSopenharmony_ci 6335bd8deadSopenharmony_ci For example, consider the following structure: 6345bd8deadSopenharmony_ci 6355bd8deadSopenharmony_ci struct { 6365bd8deadSopenharmony_ci struct { 6375bd8deadSopenharmony_ci float a; 6385bd8deadSopenharmony_ci float b[10]; 6395bd8deadSopenharmony_ci } c[2]; 6405bd8deadSopenharmony_ci vec2 d; 6415bd8deadSopenharmony_ci } e; 6425bd8deadSopenharmony_ci 6435bd8deadSopenharmony_ci loc1 = GetUniformLocationARB(programObject, "e.d") is a valid command. 6445bd8deadSopenharmony_ci loc2 = GetUniformLocationARB(programObject, "e.c[0]") is not valid. 6455bd8deadSopenharmony_ci loc3 = GetUniformLocationARB(programObject, "e.c[0].b") is a valid command. 6465bd8deadSopenharmony_ci loc4 = GetUniformLocationARB(programObject, "e.c[0].b[2]") is a valid command. 6475bd8deadSopenharmony_ci 6485bd8deadSopenharmony_ci The location loc2 cannot be retrieved because "e.c[0]" references a 6495bd8deadSopenharmony_ci structure. 6505bd8deadSopenharmony_ci 6515bd8deadSopenharmony_ci Uniform2fARB(loc1, 1.0f, 2.0f) is a valid command. 6525bd8deadSopenharmony_ci Uniform2iARB(loc1, 1, 2) is not. loc1 references a vec2, not an ivec2. 6535bd8deadSopenharmony_ci Uniform1fARB(loc1, 1.0f) is not. loc1 references a vec2, not a float. 6545bd8deadSopenharmony_ci Uniform1fvARB(loc3, 10, floatPtr) is a valid command. 6555bd8deadSopenharmony_ci Uniform1fvARB(loc4, 10, floatPtr) is not. It runs off the end of the array. 6565bd8deadSopenharmony_ci Uniform1fvARB(loc4, 8, floatPtr) is a valid command. 6575bd8deadSopenharmony_ci 6585bd8deadSopenharmony_ci RESOLUTION: Yes 6595bd8deadSopenharmony_ci 6605bd8deadSopenharmony_ci 33) Should automatic conversion of input data types be done when loading 6615bd8deadSopenharmony_ci uniforms? 6625bd8deadSopenharmony_ci 6635bd8deadSopenharmony_ci DISCUSSION: In other words, if the application passes an integer to the 6645bd8deadSopenharmony_ci uniform loading commands, and the uniform is declared as a float, should 6655bd8deadSopenharmony_ci automatic type conversion of that integer to a float occur? The vertex 6665bd8deadSopenharmony_ci attribute loading commands do this, for example. 6675bd8deadSopenharmony_ci 6685bd8deadSopenharmony_ci OpenGL specifies that this kind of type conversion is dependent on the 6695bd8deadSopenharmony_ci usage of the data. Color, normals and depth components are normalized 6705bd8deadSopenharmony_ci and converted to floats as specified in Table 2.6. Other components are 6715bd8deadSopenharmony_ci not normalized before conversion to float. However, generally it is not 6725bd8deadSopenharmony_ci known what a uniform is used for. 6735bd8deadSopenharmony_ci 6745bd8deadSopenharmony_ci It is hard to imagine that it is useful for an application to pass in 6755bd8deadSopenharmony_ci data that is declared as a different type in the shader. In that case 6765bd8deadSopenharmony_ci the type of the uniform in the shader could be matched to the 6775bd8deadSopenharmony_ci application's data type instead. 6785bd8deadSopenharmony_ci 6795bd8deadSopenharmony_ci RESOLUTION: NO. If the basic type of the uniform is float, then 6805bd8deadSopenharmony_ci Uniform*f{v}ARB will have to be used. If the basic type of the uniform 6815bd8deadSopenharmony_ci is integer, then Uniform*i{v}ARB will have to be used. If the basic type 6825bd8deadSopenharmony_ci of the uniform is a sampler, then Uniform1i{v}ARB will have to be used. 6835bd8deadSopenharmony_ci 6845bd8deadSopenharmony_ci Since there is no Boolean type in C (and we are defining C bindings) but 6855bd8deadSopenharmony_ci there is a Boolean type in the OpenGL Shading Language, type conversion 6865bd8deadSopenharmony_ci needs to be done. It is allowed to either pass in floats or integers if 6875bd8deadSopenharmony_ci the uniform is declared as a boolean. If the basic type of the uniform 6885bd8deadSopenharmony_ci is a Boolean, then either Uniform*f{v}ARB or Uniform*i{v}ARB can be 6895bd8deadSopenharmony_ci used. 6905bd8deadSopenharmony_ci 6915bd8deadSopenharmony_ci Note that the uniform loading API can later be extended to allow for 6925bd8deadSopenharmony_ci automatic type conversion, with and without normalization, if it turns 6935bd8deadSopenharmony_ci out that is desired. 6945bd8deadSopenharmony_ci 6955bd8deadSopenharmony_ci 34) Why introduce the new terms "Use" and "Create"? 6965bd8deadSopenharmony_ci 6975bd8deadSopenharmony_ci DISCUSSION: This question refers to glUseProgramObjectARB, 6985bd8deadSopenharmony_ci glCreateShaderObjectARB and glCreateProgramOBjectARB. We could have 6995bd8deadSopenharmony_ci defined glNewShaderObjectARB, glNewProgramObjectARB and left off the 7005bd8deadSopenharmony_ci "Use" in glUseProgramOBjectARB, resulting in glProgramObjectARB. 7015bd8deadSopenharmony_ci 7025bd8deadSopenharmony_ci RESOLUTION: "New" is used for an existing function name (glNewList) that 7035bd8deadSopenharmony_ci takes a name as input, instead of returning a handle. We deliberately 7045bd8deadSopenharmony_ci chose "Create" for functions that return handles. Similarly "Use" is 7055bd8deadSopenharmony_ci used in a function name that takes a handle as input. Different names 7065bd8deadSopenharmony_ci make it clear to the developer that there are different semantics. 7075bd8deadSopenharmony_ci 7085bd8deadSopenharmony_ci 35) How is a uniform array treated when only some of the array elements 7095bd8deadSopenharmony_ci are actually used? 7105bd8deadSopenharmony_ci 7115bd8deadSopenharmony_ci DISCUSSION: We have two goals in mind: 7125bd8deadSopenharmony_ci 7135bd8deadSopenharmony_ci 1) To be able to always load a uniform array starting from offset 0 7145bd8deadSopenharmony_ci into the array. 7155bd8deadSopenharmony_ci 2) To keep the list of active uniforms as small as possible. 7165bd8deadSopenharmony_ci 7175bd8deadSopenharmony_ci RESOLUTION: For a uniform array declared in a shader, 7185bd8deadSopenharmony_ci GetActiveUniformARB() will return the name of the array, its basic type 7195bd8deadSopenharmony_ci and a count. This count is determined by the highest element used in the 7205bd8deadSopenharmony_ci shader (as determined by the linker / compiler). If the shader doesn't 7215bd8deadSopenharmony_ci use the array at all, then the GL should obviously not report it as an 7225bd8deadSopenharmony_ci active uniform. Loading more data for the array, using Uniform*ARB, than 7235bd8deadSopenharmony_ci the count returned by GetActiveUniformARB is allowed. The extra data is 7245bd8deadSopenharmony_ci silently ignored (sent to the bit-bucket). 7255bd8deadSopenharmony_ci 7265bd8deadSopenharmony_ci For example, consider the array: 7275bd8deadSopenharmony_ci 7285bd8deadSopenharmony_ci uniform vec3 a[10]; 7295bd8deadSopenharmony_ci 7305bd8deadSopenharmony_ci Which is used in a shader that uses elements 3 and 7 in this array. 7315bd8deadSopenharmony_ci GetActiveUniformARB will return: 7325bd8deadSopenharmony_ci 7335bd8deadSopenharmony_ci "a" - the name of the array 7345bd8deadSopenharmony_ci 8 - The size of the array (based on the highest element used, 7) 7355bd8deadSopenharmony_ci FLOAT_VEC3_ARB - The type 7365bd8deadSopenharmony_ci 7375bd8deadSopenharmony_ci Since array elements 0 through 7 are active, the application can query 7385bd8deadSopenharmony_ci the locations for elements 0, 1, 2, 3, 4, 5, 6, 7 using 7395bd8deadSopenharmony_ci GetUniformLocationARB(). 7405bd8deadSopenharmony_ci 7415bd8deadSopenharmony_ci Loading data for this array using a count of 10 (not 8) is allowed. Thus 7425bd8deadSopenharmony_ci it is legal to issue: 7435bd8deadSopenharmony_ci 7445bd8deadSopenharmony_ci location = GetUniformLocation(progObj, "a"); 7455bd8deadSopenharmony_ci LoadUniform3fv(location, 10, dataPtr); 7465bd8deadSopenharmony_ci 7475bd8deadSopenharmony_ci This will load data into array elements 0 through 7, since only array 7485bd8deadSopenharmony_ci elements 0 through 7 are active, and will ignore the rest of the data. 7495bd8deadSopenharmony_ci 7505bd8deadSopenharmony_ci Array data is queried one element at a time. In order to query any 7515bd8deadSopenharmony_ci uniform, a location needs to be provided by the application. Therefore, 7525bd8deadSopenharmony_ci in this example, the application can query data for array elements 0 7535bd8deadSopenharmony_ci through 7, but not for elements 8 and 9. 7545bd8deadSopenharmony_ci 7555bd8deadSopenharmony_ci This makes array loading portable, independent of the smartness of the 7565bd8deadSopenharmony_ci compiler / linker. It also encourages shader writers to start using 7575bd8deadSopenharmony_ci array elements starting at zero, and work their way upwards, to get 7585bd8deadSopenharmony_ci maximum resource efficiency from the OpenGL implementation. It also 7595bd8deadSopenharmony_ci works nicely with auto-sized uniform arrays (an array declared with 7605bd8deadSopenharmony_ci empty brackets "[]" and indexed only with compile time constants). 7615bd8deadSopenharmony_ci 7625bd8deadSopenharmony_ci 36) Should a location of -1 passed in to Uniform*ARB generate a GL error? 7635bd8deadSopenharmony_ci 7645bd8deadSopenharmony_ci DISCUSSION: The Uniform*API commands will set an INVALID_OPERATION error 7655bd8deadSopenharmony_ci when passing in a location that does not exist. GetUniformLocationARB 7665bd8deadSopenharmony_ci will return -1 if the string passed in is not an active uniform, or if 7675bd8deadSopenharmony_ci it starts with the prefix "gl_". (This means you cannot get a location 7685bd8deadSopenharmony_ci for active built-in uniforms, for example gl_ModelviewMatrix). 7695bd8deadSopenharmony_ci 7705bd8deadSopenharmony_ci If you're looping over GetUniformLocationARB and passing the result to 7715bd8deadSopenharmony_ci one of the Uniform*ARB commands, and if any -1 location passed to 7725bd8deadSopenharmony_ci Uniform*ARB will generate a GL error, then this means that you should 7735bd8deadSopenharmony_ci really bracket your Uniform*ARB command with a 'if (location != -1) 7745bd8deadSopenharmony_ci statement. It seems desireable to not generate a GL error when -1 is 7755bd8deadSopenharmony_ci passed in as a location to Uniform*ARB. The data passed in should then 7765bd8deadSopenharmony_ci be silently ignored. 7775bd8deadSopenharmony_ci 7785bd8deadSopenharmony_ci RESOLUTION. NO. Note that this has changed since the version 0.87 (which 7795bd8deadSopenharmony_ci was published in the extension registry). That version did set an error 7805bd8deadSopenharmony_ci when passing in a location of -1. 7815bd8deadSopenharmony_ci 7825bd8deadSopenharmony_ci 37) What should the behavior of glDeleteObject(0) be? 7835bd8deadSopenharmony_ci 7845bd8deadSopenharmony_ci DISCUSSION: It would be desirable to allow 0 as a valid input value, and 7855bd8deadSopenharmony_ci not raise an error. 7865bd8deadSopenharmony_ci 7875bd8deadSopenharmony_ci RESOLUTION: glDeleteObject() will silently ignore deleting the value 0. 7885bd8deadSopenharmony_ci This is consistent with glDeleteTextures() that also silently ignores 7895bd8deadSopenharmony_ci deleting the value 0. 7905bd8deadSopenharmony_ci 7915bd8deadSopenharmony_ci 38) It is unclear how GetUniform*ARB works for matrices. Is the data 7925bd8deadSopenharmony_ci returned in column or row major order? 7935bd8deadSopenharmony_ci 7945bd8deadSopenharmony_ci DISCUSSION: glGet(MODEL_VIEW_MATRIX) returns data in column major order. 7955bd8deadSopenharmony_ci It was discussed, but rejected, to add two new commands to return 7965bd8deadSopenharmony_ci matrices in column or row major order: 7975bd8deadSopenharmony_ci 7985bd8deadSopenharmony_ci void GetUniformMatrixfvARB(handleARB programObj, int location, 7995bd8deadSopenharmony_ci boolean transpose, float *params) 8005bd8deadSopenharmony_ci void GetUniformMatrixivARB(handleARB programObj, int location, 8015bd8deadSopenharmony_ci boolean transpose, float *params) 8025bd8deadSopenharmony_ci 8035bd8deadSopenharmony_ci RESOLUTION: GetUniformARB will return data in column major order, 8045bd8deadSopenharmony_ci regardles of the transpose flag used to set the matrix in the 8055bd8deadSopenharmony_ci LoadUniform*ARB commands. 8065bd8deadSopenharmony_ci 8075bd8deadSopenharmony_ci 39) Do "const" qualified variables consume uniform word storage, or not? 8085bd8deadSopenharmony_ci 8095bd8deadSopenharmony_ci RESOLUTION: They do not. 8105bd8deadSopenharmony_ci 8115bd8deadSopenharmony_ci 40) What happens when a program object currently in use is re-linked, 8125bd8deadSopenharmony_ci and this re-link fails? 8135bd8deadSopenharmony_ci 8145bd8deadSopenharmony_ci DISCUSSION: This should not affect the executable(s), part of the 8155bd8deadSopenharmony_ci current rendering state. As opposed to revert to fix pipeline for 8165bd8deadSopenharmony_ci example. 8175bd8deadSopenharmony_ci 8185bd8deadSopenharmony_ci RESOLUTION: The currently active executable code will be kept until 8195bd8deadSopenharmony_ci changed or the program has been linked successfully. 8205bd8deadSopenharmony_ci 8215bd8deadSopenharmony_ci 41) What happens when an empty program object (one with no shader 8225bd8deadSopenharmony_ci objects attached) is linked? 8235bd8deadSopenharmony_ci 8245bd8deadSopenharmony_ci DISCUSSION: Linking a program object with just a vertex shader will get 8255bd8deadSopenharmony_ci you fixed- function fragment processing. Vice versa, linking a program 8265bd8deadSopenharmony_ci object with just a fragment shader gets you fixed-function vertex 8275bd8deadSopenharmony_ci processing. 8285bd8deadSopenharmony_ci 8295bd8deadSopenharmony_ci RESOLUTION: This will succeed and in this case you get the fixed 8305bd8deadSopenharmony_ci pipeline for both vertex and fragment processing if UseProgramObject() 8315bd8deadSopenharmony_ci is issued for this program object. 8325bd8deadSopenharmony_ci 8335bd8deadSopenharmony_ci 42) How to indicate the first element of an array when requesting a 8345bd8deadSopenharmony_ci uniform location? 8355bd8deadSopenharmony_ci 8365bd8deadSopenharmony_ci DISCUSSION: There is a desire to have the location of the first element 8375bd8deadSopenharmony_ci of an array be indicated either using the name of the uniform array, or 8385bd8deadSopenharmony_ci by using the name appended with "[0]". 8395bd8deadSopenharmony_ci 8405bd8deadSopenharmony_ci That would mean the following: 8415bd8deadSopenharmony_ci 8425bd8deadSopenharmony_ci uniform s a[1]; // Where 's' is some struct with a field 'f' that is a float. 8435bd8deadSopenharmony_ci 8445bd8deadSopenharmony_ci The following string combinations could be formed to pass into 8455bd8deadSopenharmony_ci GetUniformLocation: 8465bd8deadSopenharmony_ci 8475bd8deadSopenharmony_ci a[0].f 8485bd8deadSopenharmony_ci a.f 8495bd8deadSopenharmony_ci 8505bd8deadSopenharmony_ci If 'f' is an array float f[1] then the following string combinations 8515bd8deadSopenharmony_ci could be formed to pass into GetUniformLocation: 8525bd8deadSopenharmony_ci 8535bd8deadSopenharmony_ci a[0].f[0] 8545bd8deadSopenharmony_ci a[0].f 8555bd8deadSopenharmony_ci a.f[0] 8565bd8deadSopenharmony_ci a.f 8575bd8deadSopenharmony_ci 8585bd8deadSopenharmony_ci RESOLUTION: The spec is changed so that in the middle of a string it is 8595bd8deadSopenharmony_ci mandatory to use [0]. Thus that means that only the following two 8605bd8deadSopenharmony_ci strings are valid to pass to GetUniformLocation: 8615bd8deadSopenharmony_ci 8625bd8deadSopenharmony_ci a[0].f 8635bd8deadSopenharmony_ci a[0].f[0] 8645bd8deadSopenharmony_ci 8655bd8deadSopenharmony_ci 43) What does GetActiveUniformARB() report for the following two 8665bd8deadSopenharmony_ci uniforms? 8675bd8deadSopenharmony_ci 8685bd8deadSopenharmony_ci DISCUSSION: Consider shader code with: 8695bd8deadSopenharmony_ci 8705bd8deadSopenharmony_ci uniform float a[1]; 8715bd8deadSopenharmony_ci uniform float a; 8725bd8deadSopenharmony_ci 8735bd8deadSopenharmony_ci The size reported by GetActiveUniformARB() will be '1', and the type 8745bd8deadSopenharmony_ci reported will be float. The string reported can be 'a' in both cases, or 8755bd8deadSopenharmony_ci can be 'a[0]' in the array case. In other words, from this data it is 8765bd8deadSopenharmony_ci not clear to the application if 'a' is an array of size one or a scalar. 8775bd8deadSopenharmony_ci Reporting 'a[0]' is the recommended way for the array case. Technically 8785bd8deadSopenharmony_ci it doesn't really matter, since it is legal to address the first element 8795bd8deadSopenharmony_ci of an array with 'a' or 'a[0]' and pass either string into 8805bd8deadSopenharmony_ci GetUniformLocation. 8815bd8deadSopenharmony_ci 8825bd8deadSopenharmony_ci RESOLUTION: The GL implementation can report either string. However, it 8835bd8deadSopenharmony_ci is recommended to return 'a[0]'. 8845bd8deadSopenharmony_ci 8855bd8deadSopenharmony_ci 44) Do GL enables affect the built-in state available to a shader? 8865bd8deadSopenharmony_ci 8875bd8deadSopenharmony_ci DISCUSSION: The lighting state, for example, is still tracked and kept 8885bd8deadSopenharmony_ci current even when lighting, or a specific light, is disabled. This goes 8895bd8deadSopenharmony_ci for all built-in state listed in Chapter 7.5 of the OpenGL Shading 8905bd8deadSopenharmony_ci Language Specification. Do realize that the enables 8915bd8deadSopenharmony_ci VERTEX_PROGRAM_POINT_SIZE and VERTEX_PROGRAM_TWO_SIDE do need to be 8925bd8deadSopenharmony_ci enabled by the application, to get their desired effect. 8935bd8deadSopenharmony_ci 8945bd8deadSopenharmony_ci RESOLUTION: Enable state is a piece of orthogonal state that is not 8955bd8deadSopenharmony_ci available to a shader. The enable state does not affect the built-in 8965bd8deadSopenharmony_ci state that is available to a shader, which is listed in Chapter 7.5 of 8975bd8deadSopenharmony_ci the OpenGL Shading Language specification. 8985bd8deadSopenharmony_ci 8995bd8deadSopenharmony_ci 45) Please give an example of using the uniform API. 9005bd8deadSopenharmony_ci 9015bd8deadSopenharmony_ci DISCUSSION: Below are two examples. The first one queries each active 9025bd8deadSopenharmony_ci uniform, then loads a value for it. The second example works of a list 9035bd8deadSopenharmony_ci of uniforms, and queries their locations. Some of the uniforms in that 9045bd8deadSopenharmony_ci list might not be active. 9055bd8deadSopenharmony_ci 9065bd8deadSopenharmony_ci // 9075bd8deadSopenharmony_ci // Example code that queries active uniforms, then loads their values 9085bd8deadSopenharmony_ci // 9095bd8deadSopenharmony_ci void 9105bd8deadSopenharmony_ci example1(GLhandleARB programObject) 9115bd8deadSopenharmony_ci { 9125bd8deadSopenharmony_ci int i, count, size, type, linked, location; 9135bd8deadSopenharmony_ci char uniformName[1000]; 9145bd8deadSopenharmony_ci 9155bd8deadSopenharmony_ci // Link the program object and make sure it succeeded. 9165bd8deadSopenharmony_ci glLinkProgramARB(programObject); 9175bd8deadSopenharmony_ci glGetObjectParameterivARB(programObject, GL_OBJECT_LINK_STATUS_ARB, &linked); 9185bd8deadSopenharmony_ci 9195bd8deadSopenharmony_ci if (!linked) { 9205bd8deadSopenharmony_ci return; 9215bd8deadSopenharmony_ci } 9225bd8deadSopenharmony_ci 9235bd8deadSopenharmony_ci // Install the executables in the program object as part of current state. 9245bd8deadSopenharmony_ci glUseProgramObjectARB(programObject); 9255bd8deadSopenharmony_ci 9265bd8deadSopenharmony_ci // Check for GL Errors 9275bd8deadSopenharmony_ci 9285bd8deadSopenharmony_ci // Setup uniform values in the array 'colorInterior'. 9295bd8deadSopenharmony_ci 9305bd8deadSopenharmony_ci // Query the number of active uniforms 9315bd8deadSopenharmony_ci glGetObjectParameterivARB(programObject, GL_OBJECT_ACTIVE_UNIFORMS_ARB, 9325bd8deadSopenharmony_ci &count); 9335bd8deadSopenharmony_ci 9345bd8deadSopenharmony_ci // Loop over each of the active uniforms, and set their value 9355bd8deadSopenharmony_ci for (i = 0; i < count; i++) 9365bd8deadSopenharmony_ci { 9375bd8deadSopenharmony_ci glGetActiveUniformARB(programObject, i, 1000, NULL, &size, &type, 9385bd8deadSopenharmony_ci uniformName); 9395bd8deadSopenharmony_ci printf("active uniform: %s\n",uniformName); 9405bd8deadSopenharmony_ci 9415bd8deadSopenharmony_ci location = glGetUniformLocationARB(programObject, uniformName); 9425bd8deadSopenharmony_ci 9435bd8deadSopenharmony_ci if (type == GL_FLOAT_VEC3_ARB) { 9445bd8deadSopenharmony_ci float *data; 9455bd8deadSopenharmony_ci 9465bd8deadSopenharmony_ci // Allocate data based on 'size' 9475bd8deadSopenharmony_ci // do some kind of hash lookup on the uniform name to get the 9485bd8deadSopenharmony_ci // data to load for the uniform. 9495bd8deadSopenharmony_ci lookupUniformData(uniformName, data); 9505bd8deadSopenharmony_ci 9515bd8deadSopenharmony_ci // This a vec3, therefore need to use the '3f' or '3fv' version 9525bd8deadSopenharmony_ci // of the uniform loading commands. 9535bd8deadSopenharmony_ci glUniform3fvARB(location, size, data); 9545bd8deadSopenharmony_ci } // else : Setup more types here 9555bd8deadSopenharmony_ci } 9565bd8deadSopenharmony_ci } 9575bd8deadSopenharmony_ci 9585bd8deadSopenharmony_ci 9595bd8deadSopenharmony_ci // 9605bd8deadSopenharmony_ci // Example code that has a list of uniforms, and loads values for each uniform 9615bd8deadSopenharmony_ci // in the list. Not all uniforms have to be active ones. 9625bd8deadSopenharmony_ci // 9635bd8deadSopenharmony_ci void 9645bd8deadSopenharmony_ci example2(GLhandleARB programObject) 9655bd8deadSopenharmony_ci { 9665bd8deadSopenharmony_ci int i, count, linked, location; 9675bd8deadSopenharmony_ci char **uniformName; 9685bd8deadSopenharmony_ci float *data; 9695bd8deadSopenharmony_ci 9705bd8deadSopenharmony_ci // Link the program object and make sure it succeeded. 9715bd8deadSopenharmony_ci glLinkProgramARB(programObject); 9725bd8deadSopenharmony_ci glGetObjectParameterivARB(programObject, GL_OBJECT_LINK_STATUS_ARB, &linked); 9735bd8deadSopenharmony_ci 9745bd8deadSopenharmony_ci if (!linked) { 9755bd8deadSopenharmony_ci return; 9765bd8deadSopenharmony_ci } 9775bd8deadSopenharmony_ci 9785bd8deadSopenharmony_ci // Install the executables in the program object as part of current state. 9795bd8deadSopenharmony_ci glUseProgramObjectARB(programObject); 9805bd8deadSopenharmony_ci 9815bd8deadSopenharmony_ci // Check for GL Errors 9825bd8deadSopenharmony_ci 9835bd8deadSopenharmony_ci // Setup uniform values in the array 'data'. 9845bd8deadSopenharmony_ci // Setup 'count' and the array 'uniformName' 9855bd8deadSopenharmony_ci 9865bd8deadSopenharmony_ci // Loop over the list of uniforms in uniformName, and set their value 9875bd8deadSopenharmony_ci for (i = 0; i < count; i++) 9885bd8deadSopenharmony_ci { 9895bd8deadSopenharmony_ci // Location will be -1 if the uniform is not active, but that is OK 9905bd8deadSopenharmony_ci // the uniform loading commands will silently ignore a location of -1. 9915bd8deadSopenharmony_ci location = glGetUniformLocationARB(programObject, uniformName[i]); 9925bd8deadSopenharmony_ci 9935bd8deadSopenharmony_ci // This a a vec3, therefore need to use the '3f' or '3fv' version of 9945bd8deadSopenharmony_ci // the uniform loading command. 9955bd8deadSopenharmony_ci glUniform3fvARB(location, 1, &data[i * 3]); 9965bd8deadSopenharmony_ci } 9975bd8deadSopenharmony_ci } 9985bd8deadSopenharmony_ci 9995bd8deadSopenharmony_ci 46) Should we add capability to query if an object is dirty? 10005bd8deadSopenharmony_ci 10015bd8deadSopenharmony_ci DISCUSSION: Specifically, do we add a way to query if a program object 10025bd8deadSopenharmony_ci needs relinking? Do we add a way to query if a shader object needs 10035bd8deadSopenharmony_ci re-compilation? 10045bd8deadSopenharmony_ci 10055bd8deadSopenharmony_ci RESOLUTION: No, the application can keep track of this information as 10065bd8deadSopenharmony_ci well. Mipmap state consistency is not queriable either, for example. 10075bd8deadSopenharmony_ci 10085bd8deadSopenharmony_ciNew Procedures and Functions 10095bd8deadSopenharmony_ci 10105bd8deadSopenharmony_ci void DeleteObjectARB(handleARB obj) 10115bd8deadSopenharmony_ci 10125bd8deadSopenharmony_ci handleARB GetHandleARB(enum pname) 10135bd8deadSopenharmony_ci 10145bd8deadSopenharmony_ci void DetachObjectARB(handleARB containerObj, handleARB attachedObj) 10155bd8deadSopenharmony_ci 10165bd8deadSopenharmony_ci handleARB CreateShaderObjectARB(enum shaderType) 10175bd8deadSopenharmony_ci 10185bd8deadSopenharmony_ci void ShaderSourceARB(handleARB shaderObj, sizei count, const charARB **string, 10195bd8deadSopenharmony_ci const int *length) 10205bd8deadSopenharmony_ci 10215bd8deadSopenharmony_ci void CompileShaderARB(handleARB shaderObj) 10225bd8deadSopenharmony_ci 10235bd8deadSopenharmony_ci handleARB CreateProgramObjectARB(void) 10245bd8deadSopenharmony_ci 10255bd8deadSopenharmony_ci void AttachObjectARB(handleARB containerObj, handleARB obj) 10265bd8deadSopenharmony_ci 10275bd8deadSopenharmony_ci void LinkProgramARB(handleARB programObj) 10285bd8deadSopenharmony_ci 10295bd8deadSopenharmony_ci void UseProgramObjectARB(handleARB programObj) 10305bd8deadSopenharmony_ci 10315bd8deadSopenharmony_ci void ValidateProgramARB(handleARB programObj) 10325bd8deadSopenharmony_ci 10335bd8deadSopenharmony_ci void Uniform1fARB(int location, float v0) 10345bd8deadSopenharmony_ci void Uniform2fARB(int location, float v0, float v1) 10355bd8deadSopenharmony_ci void Uniform3fARB(int location, float v0, float v1, float v2) 10365bd8deadSopenharmony_ci void Uniform4fARB(int location, float v0, float v1, float v2, float v3) 10375bd8deadSopenharmony_ci 10385bd8deadSopenharmony_ci void Uniform1iARB(int location, int v0) 10395bd8deadSopenharmony_ci void Uniform2iARB(int location, int v0, int v1) 10405bd8deadSopenharmony_ci void Uniform3iARB(int location, int v0, int v1, int v2) 10415bd8deadSopenharmony_ci void Uniform4iARB(int location, int v0, int v1, int v2, int v3) 10425bd8deadSopenharmony_ci 10435bd8deadSopenharmony_ci void Uniform1fvARB(int location, sizei count, const float *value) 10445bd8deadSopenharmony_ci void Uniform2fvARB(int location, sizei count, const float *value) 10455bd8deadSopenharmony_ci void Uniform3fvARB(int location, sizei count, const float *value) 10465bd8deadSopenharmony_ci void Uniform4fvARB(int location, sizei count, const float *value) 10475bd8deadSopenharmony_ci 10485bd8deadSopenharmony_ci void Uniform1ivARB(int location, sizei count, const int *value) 10495bd8deadSopenharmony_ci void Uniform2ivARB(int location, sizei count, const int *value) 10505bd8deadSopenharmony_ci void Uniform3ivARB(int location, sizei count, const int *value) 10515bd8deadSopenharmony_ci void Uniform4ivARB(int location, sizei count, const int *value) 10525bd8deadSopenharmony_ci 10535bd8deadSopenharmony_ci void UniformMatrix2fvARB(int location, sizei count, boolean transpose, const float *value) 10545bd8deadSopenharmony_ci void UniformMatrix3fvARB(int location, sizei count, boolean transpose, const float *value) 10555bd8deadSopenharmony_ci void UniformMatrix4fvARB(int location, sizei count, boolean transpose, const float *value) 10565bd8deadSopenharmony_ci 10575bd8deadSopenharmony_ci void GetObjectParameterfvARB(handleARB obj, enum pname, float *params) 10585bd8deadSopenharmony_ci void GetObjectParameterivARB(handleARB obj, enum pname, int *params) 10595bd8deadSopenharmony_ci 10605bd8deadSopenharmony_ci void GetInfoLogARB(handleARB obj, sizei maxLength, sizei *length, charARB *infoLog) 10615bd8deadSopenharmony_ci 10625bd8deadSopenharmony_ci void GetAttachedObjectsARB(handleARB containerObj, sizei maxCount, sizei *count, 10635bd8deadSopenharmony_ci handleARB *obj) 10645bd8deadSopenharmony_ci 10655bd8deadSopenharmony_ci int GetUniformLocationARB(handleARB programObj, const charARB *name) 10665bd8deadSopenharmony_ci 10675bd8deadSopenharmony_ci void GetActiveUniformARB(handleARB programObj, uint index, sizei maxLength, 10685bd8deadSopenharmony_ci sizei *length, int *size, enum *type, charARB *name) 10695bd8deadSopenharmony_ci 10705bd8deadSopenharmony_ci void GetUniformfvARB(handleARB programObj, int location, float *params) 10715bd8deadSopenharmony_ci void GetUniformivARB(handleARB programObj, int location, int *params) 10725bd8deadSopenharmony_ci 10735bd8deadSopenharmony_ci void GetShaderSourceARB(handleARB obj, sizei maxLength, sizei *length, 10745bd8deadSopenharmony_ci charARB *source) 10755bd8deadSopenharmony_ci 10765bd8deadSopenharmony_ciNew Tokens 10775bd8deadSopenharmony_ci 10785bd8deadSopenharmony_ci Accepted by the <pname> argument of GetHandleARB: 10795bd8deadSopenharmony_ci 10805bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB 0x8B40 10815bd8deadSopenharmony_ci 10825bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetObjectParameter{fi}vARB: 10835bd8deadSopenharmony_ci 10845bd8deadSopenharmony_ci OBJECT_TYPE_ARB 0x8B4E 10855bd8deadSopenharmony_ci OBJECT_SUBTYPE_ARB 0x8B4F 10865bd8deadSopenharmony_ci OBJECT_DELETE_STATUS_ARB 0x8B80 10875bd8deadSopenharmony_ci OBJECT_COMPILE_STATUS_ARB 0x8B81 10885bd8deadSopenharmony_ci OBJECT_LINK_STATUS_ARB 0x8B82 10895bd8deadSopenharmony_ci OBJECT_VALIDATE_STATUS_ARB 0x8B83 10905bd8deadSopenharmony_ci OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 10915bd8deadSopenharmony_ci OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 10925bd8deadSopenharmony_ci OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 10935bd8deadSopenharmony_ci OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 10945bd8deadSopenharmony_ci OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 10955bd8deadSopenharmony_ci 10965bd8deadSopenharmony_ci Returned by the <params> parameter of GetObjectParameter{fi}vARB: 10975bd8deadSopenharmony_ci 10985bd8deadSopenharmony_ci SHADER_OBJECT_ARB 0x8B48 10995bd8deadSopenharmony_ci 11005bd8deadSopenharmony_ci Returned by the <type> parameter of GetActiveUniformARB: 11015bd8deadSopenharmony_ci 11025bd8deadSopenharmony_ci FLOAT 0x1406 11035bd8deadSopenharmony_ci FLOAT_VEC2_ARB 0x8B50 11045bd8deadSopenharmony_ci FLOAT_VEC3_ARB 0x8B51 11055bd8deadSopenharmony_ci FLOAT_VEC4_ARB 0x8B52 11065bd8deadSopenharmony_ci INT 0x1404 11075bd8deadSopenharmony_ci INT_VEC2_ARB 0x8B53 11085bd8deadSopenharmony_ci INT_VEC3_ARB 0x8B54 11095bd8deadSopenharmony_ci INT_VEC4_ARB 0x8B55 11105bd8deadSopenharmony_ci BOOL_ARB 0x8B56 11115bd8deadSopenharmony_ci BOOL_VEC2_ARB 0x8B57 11125bd8deadSopenharmony_ci BOOL_VEC3_ARB 0x8B58 11135bd8deadSopenharmony_ci BOOL_VEC4_ARB 0x8B59 11145bd8deadSopenharmony_ci FLOAT_MAT2_ARB 0x8B5A 11155bd8deadSopenharmony_ci FLOAT_MAT3_ARB 0x8B5B 11165bd8deadSopenharmony_ci FLOAT_MAT4_ARB 0x8B5C 11175bd8deadSopenharmony_ci SAMPLER_1D_ARB 0x8B5D 11185bd8deadSopenharmony_ci SAMPLER_2D_ARB 0x8B5E 11195bd8deadSopenharmony_ci SAMPLER_3D_ARB 0x8B5F 11205bd8deadSopenharmony_ci SAMPLER_CUBE_ARB 0x8B60 11215bd8deadSopenharmony_ci SAMPLER_1D_SHADOW_ARB 0x8B61 11225bd8deadSopenharmony_ci SAMPLER_2D_SHADOW_ARB 0x8B62 11235bd8deadSopenharmony_ci SAMPLER_2D_RECT_ARB 0x8B63 11245bd8deadSopenharmony_ci SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 11255bd8deadSopenharmony_ci 11265bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.4 Specification (OpenGL Operation) 11275bd8deadSopenharmony_ci 11285bd8deadSopenharmony_ci Add two new rows to Table 2.2, page 9. 11295bd8deadSopenharmony_ci 11305bd8deadSopenharmony_ci GL Type Minimum Description 11315bd8deadSopenharmony_ci Bit Width 11325bd8deadSopenharmony_ci ------- ------- ------------- 11335bd8deadSopenharmony_ci charARB 8 characters that make up strings 11345bd8deadSopenharmony_ci handleARB 32 identifier for generic objects 11355bd8deadSopenharmony_ci 11365bd8deadSopenharmony_ci Modify Section 2.5, GL Errors, p. 11 11375bd8deadSopenharmony_ci 11385bd8deadSopenharmony_ci (modify the last paragraph, p. 11) Four error generation conditions are 11395bd8deadSopenharmony_ci implicit... 11405bd8deadSopenharmony_ci 11415bd8deadSopenharmony_ci (modify the first paragraph, p. 12) ...the error INVALID_VALUE results. 11425bd8deadSopenharmony_ci Third, the error INVALID_VALUE is generated by any command that takes 11435bd8deadSopenharmony_ci one or more handles as input, and one or more of these handles are not a 11445bd8deadSopenharmony_ci generic object handle generated by OpenGL. Finally, if memory is 11455bd8deadSopenharmony_ci exhausted... 11465bd8deadSopenharmony_ci 11475bd8deadSopenharmony_ci Modify Section 2.6.1 Begin and End Objects, p. 13 11485bd8deadSopenharmony_ci 11495bd8deadSopenharmony_ci Remove the term "objects" from this section. 11505bd8deadSopenharmony_ci 11515bd8deadSopenharmony_ci Add a new section 2.14 Generic Objects, p.60 11525bd8deadSopenharmony_ci 11535bd8deadSopenharmony_ci The currently existing object types in OpenGL, texture objects (see 11545bd8deadSopenharmony_ci Section 3.8.12) and display lists (see Section 5.4), each have their own 11555bd8deadSopenharmony_ci management API and object ID name space. Rather than designing a new API 11565bd8deadSopenharmony_ci for each new object type added to OpenGL, this section introduces a more 11575bd8deadSopenharmony_ci generic object API, which is initially applied to shader objects 11585bd8deadSopenharmony_ci (Section 2.14.1) and program objects (Section 2.14.2). 11595bd8deadSopenharmony_ci 11605bd8deadSopenharmony_ci In OpenGL, a "generic object" is an OpenGL-managed opaque data 11615bd8deadSopenharmony_ci structure. The data stored in such a generic object may be quite large, 11625bd8deadSopenharmony_ci so applications are given control over how objects are managed. Generic 11635bd8deadSopenharmony_ci objects are given handles (names) by OpenGL at object creation time. 11645bd8deadSopenharmony_ci Applications can specify the data that is to be stored in objects and 11655bd8deadSopenharmony_ci can modify that data through function calls. Generic objects can be 11665bd8deadSopenharmony_ci created, deleted, modified, attached, detached and used as part of the 11675bd8deadSopenharmony_ci current rendering state. 11685bd8deadSopenharmony_ci 11695bd8deadSopenharmony_ci Some types of generic objects act as containers for other objects. 11705bd8deadSopenharmony_ci Linking an object to another is called "attaching" and unlinking an 11715bd8deadSopenharmony_ci object is called "detaching". 11725bd8deadSopenharmony_ci 11735bd8deadSopenharmony_ci To attach an object to a container object, use the command: 11745bd8deadSopenharmony_ci 11755bd8deadSopenharmony_ci void AttachObjectARB (handleARB containerObj, handleARB obj) 11765bd8deadSopenharmony_ci 11775bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if <obj> is not a type that can 11785bd8deadSopenharmony_ci be attached to a container object or if <containerObj> is not a 11795bd8deadSopenharmony_ci container object. The same error is generated if an attempt is made to 11805bd8deadSopenharmony_ci attach the same object more than once to the same container object. 11815bd8deadSopenharmony_ci 11825bd8deadSopenharmony_ci To detach an object from the container object it is attached to, use the 11835bd8deadSopenharmony_ci command: 11845bd8deadSopenharmony_ci 11855bd8deadSopenharmony_ci void DetachObjectARB(handleARB containerObj, handleARB attachedObj) 11865bd8deadSopenharmony_ci 11875bd8deadSopenharmony_ci If the object <attachedObj> is not attached to any other container 11885bd8deadSopenharmony_ci object in any rendering context, and the object is flagged for deletion, 11895bd8deadSopenharmony_ci the information for <attachedObj> and the data for <attachedObj> is 11905bd8deadSopenharmony_ci deleted. If <attachedObj> is not attached to <containerObj>, the error 11915bd8deadSopenharmony_ci INVALID_OPERATION is generated. The error INVALID_OPERATION is also 11925bd8deadSopenharmony_ci generated if <containerObj> is not a container object. 11935bd8deadSopenharmony_ci 11945bd8deadSopenharmony_ci Generic objects can be deleted with the following command: 11955bd8deadSopenharmony_ci 11965bd8deadSopenharmony_ci void DeleteObjectARB(handleARB obj) 11975bd8deadSopenharmony_ci 11985bd8deadSopenharmony_ci This command will either delete the object, or flag it for deletion. An 11995bd8deadSopenharmony_ci object that is attached to a container object is not deleted until it is 12005bd8deadSopenharmony_ci no longer attached to any container object, for any context. If it is 12015bd8deadSopenharmony_ci still attached to at least one container object, the object is flagged 12025bd8deadSopenharmony_ci for deletion. If the object is part of the current rendering state, it 12035bd8deadSopenharmony_ci is not deleted until it is no longer part of the current rendering state 12045bd8deadSopenharmony_ci for any context. If the object is still part of the rendering state of 12055bd8deadSopenharmony_ci at least one context, it is flagged for deletion. 12065bd8deadSopenharmony_ci 12075bd8deadSopenharmony_ci if an object is flagged for deletion, its Boolean status bit 12085bd8deadSopenharmony_ci OBJECT_DELETE_STATUS_ARB is set to true. The value of 12095bd8deadSopenharmony_ci OBJECT_DELETE_STATUS_ARB can be queried with GetObjectParameter{fi}vARB 12105bd8deadSopenharmony_ci (see Section 6.1.12). 12115bd8deadSopenharmony_ci 12125bd8deadSopenharmony_ci DeleteObjectARB will silently ignore the value zero. 12135bd8deadSopenharmony_ci 12145bd8deadSopenharmony_ci When a container object is deleted, it will detach each attached object 12155bd8deadSopenharmony_ci as part of the deletion process. When an object is deleted, all 12165bd8deadSopenharmony_ci information for the object referenced is lost. The data for the object 12175bd8deadSopenharmony_ci is also deleted. One bit of state is needed to indicate if a delete 12185bd8deadSopenharmony_ci request for an object was made. The default is no request. 12195bd8deadSopenharmony_ci 12205bd8deadSopenharmony_ci Add Subsection 2.14.1 Shader Objects 12215bd8deadSopenharmony_ci 12225bd8deadSopenharmony_ci Subsequent sections of this specification will define stages of the GL 12235bd8deadSopenharmony_ci pipeline that are programmable. The source code that makes up a program 12245bd8deadSopenharmony_ci that gets executed by one of the programmable stages is encapsulated in 12255bd8deadSopenharmony_ci one or more "shader objects". To create a shader object use the 12265bd8deadSopenharmony_ci following command: 12275bd8deadSopenharmony_ci 12285bd8deadSopenharmony_ci handleARB CreateShaderObjectARB(enum shaderType) 12295bd8deadSopenharmony_ci 12305bd8deadSopenharmony_ci The shader object is empty when it is created. The <shaderType> argument 12315bd8deadSopenharmony_ci specifies the type of shader object to be created, and should be one of 12325bd8deadSopenharmony_ci < >. (This list to be augmented by other extensions.) If the shader 12335bd8deadSopenharmony_ci object is created successfully, a handle that can be used to reference 12345bd8deadSopenharmony_ci it is returned, and its object specific parameter OBJECT_TYPE_ARB is set 12355bd8deadSopenharmony_ci to SHADER_OBJECT_ARB. The object specific parameter OBJECT_SUBTYPE_ARB 12365bd8deadSopenharmony_ci is set to the actual type of the shader object created. The value of 12375bd8deadSopenharmony_ci OBJECT_TYPE_ARB and OBJECT_SUBTYPE_ARB can be queried with 12385bd8deadSopenharmony_ci GetObjectParameter{fi}vARB (see Section 6.1.12). If the creation failed 12395bd8deadSopenharmony_ci the handle returned will be 0. 12405bd8deadSopenharmony_ci 12415bd8deadSopenharmony_ci Source code for the shader is specified with the command: 12425bd8deadSopenharmony_ci 12435bd8deadSopenharmony_ci void ShaderSourceARB(handleARB shaderObj, sizei count, 12445bd8deadSopenharmony_ci const charARB **string, const int *length) 12455bd8deadSopenharmony_ci 12465bd8deadSopenharmony_ci The <string> argument is an array of pointers to one or more, optionally 12475bd8deadSopenharmony_ci null terminated, character strings that make up the source code. The 12485bd8deadSopenharmony_ci <length> argument is an array with the number of charARBs in each string 12495bd8deadSopenharmony_ci (the string length). Each element in this array can be set to negative 12505bd8deadSopenharmony_ci one (or smaller), indicating that its accompanying string is null 12515bd8deadSopenharmony_ci terminated. If <length> is set to NULL, all strings in the <string> 12525bd8deadSopenharmony_ci argument are considered null terminated. The ShaderSourceARB command 12535bd8deadSopenharmony_ci sets the source code for the specified shader object <shaderObj> to the 12545bd8deadSopenharmony_ci text strings in the <string> array. If the object previously had source 12555bd8deadSopenharmony_ci code loaded into it, it is completely replaced. The number of strings in 12565bd8deadSopenharmony_ci the array is given in <count>. Any length passed in excludes the null 12575bd8deadSopenharmony_ci termination in its count. If <shaderObj> does not reference a shader 12585bd8deadSopenharmony_ci object, the error INVALID_OPERATION is generated. 12595bd8deadSopenharmony_ci 12605bd8deadSopenharmony_ci The strings that are loaded into a shader object are expected to form 12615bd8deadSopenharmony_ci the source code for a valid shader as defined in the OpenGL Shading 12625bd8deadSopenharmony_ci Language Specification. Once the source code for a shader has been 12635bd8deadSopenharmony_ci loaded, the shader object can be compiled with the following command: 12645bd8deadSopenharmony_ci 12655bd8deadSopenharmony_ci void CompileShaderARB(handleARB shaderObj) 12665bd8deadSopenharmony_ci 12675bd8deadSopenharmony_ci This function will compile <shaderObj>. Each shader object has a Boolean 12685bd8deadSopenharmony_ci status, OBJECT_COMPILE_STATUS_ARB, that is modified as a result of 12695bd8deadSopenharmony_ci compilation. This status can be queried with GetObjectParameter{fi}vARB 12705bd8deadSopenharmony_ci (see Section 6.1.12). This status will be set to TRUE if the shader 12715bd8deadSopenharmony_ci <shaderObj> was compiled without errors and is ready for use, and FALSE 12725bd8deadSopenharmony_ci otherwise. Compilation can fail for a variety of reasons as listed in 12735bd8deadSopenharmony_ci the OpenGL Shading Language Specification. If CompileShaderARB failed, 12745bd8deadSopenharmony_ci any information about a previous compile is lost and is not restored. 12755bd8deadSopenharmony_ci Thus a failed compile does not restore the old state of <shaderObj>. If 12765bd8deadSopenharmony_ci <shaderObj> does not reference a shader object, the error 12775bd8deadSopenharmony_ci INVALID_OPERATION is generated. 12785bd8deadSopenharmony_ci 12795bd8deadSopenharmony_ci Note that changing the source code of a shader object, through 12805bd8deadSopenharmony_ci ShaderSourceARB, does not change its compile status 12815bd8deadSopenharmony_ci OBJECT_COMPILE_STATUS_ARB. 12825bd8deadSopenharmony_ci 12835bd8deadSopenharmony_ci Each shader object has an information log that is modified as a result 12845bd8deadSopenharmony_ci of compilation. This information log can be queried with GetInfoLogARB 12855bd8deadSopenharmony_ci to obtain more information about the compilation attempt (see Section 12865bd8deadSopenharmony_ci 6.1.12). 12875bd8deadSopenharmony_ci 12885bd8deadSopenharmony_ci Add Subsection 2.14.2 Program Objects 12895bd8deadSopenharmony_ci 12905bd8deadSopenharmony_ci The shader objects that are to be used by the programmable stages of 12915bd8deadSopenharmony_ci OpenGL are collected together to form a "program object". The programs 12925bd8deadSopenharmony_ci that are executed by these programmable stages are called "executables". 12935bd8deadSopenharmony_ci All information necessary for defining an executable is encapsulated in 12945bd8deadSopenharmony_ci a program object. A program object is created with the following 12955bd8deadSopenharmony_ci command: 12965bd8deadSopenharmony_ci 12975bd8deadSopenharmony_ci handleARB CreateProgramObjectARB(void) 12985bd8deadSopenharmony_ci 12995bd8deadSopenharmony_ci Program objects are empty when they are created. If the program object 13005bd8deadSopenharmony_ci is created successfully, a handle that can be used to reference it is 13015bd8deadSopenharmony_ci returned and its attribute OBJECT_TYPE_ARB is set to PROGRAM_OBJECT_ARB. 13025bd8deadSopenharmony_ci If the creation failed the handle returned will be 0. 13035bd8deadSopenharmony_ci 13045bd8deadSopenharmony_ci A program object is a container object. Shader objects are attached to a 13055bd8deadSopenharmony_ci program object with the command AttachObjectARB. It is permissible to 13065bd8deadSopenharmony_ci attach shader objects to program objects before source code has been 13075bd8deadSopenharmony_ci loaded into the shader object, or before the shader object has been 13085bd8deadSopenharmony_ci compiled. It is permissible to attach multiple shader objects of the 13095bd8deadSopenharmony_ci same type to a single program object, and it is permissible to attach a 13105bd8deadSopenharmony_ci shader object to more than one program object. 13115bd8deadSopenharmony_ci 13125bd8deadSopenharmony_ci In order to use the shader objects contained in a program object, the 13135bd8deadSopenharmony_ci program object must be linked. This is accomplished with the following 13145bd8deadSopenharmony_ci command: 13155bd8deadSopenharmony_ci 13165bd8deadSopenharmony_ci void LinkProgramARB (handleARB programObj) 13175bd8deadSopenharmony_ci 13185bd8deadSopenharmony_ci This function will link <programObj>. Each program object has a Boolean 13195bd8deadSopenharmony_ci status, OBJECT_LINK_STATUS_ARB, that is modified as a result of linking. 13205bd8deadSopenharmony_ci This status can be queried with GetObjectParameter{fi}vARB (see Section 13215bd8deadSopenharmony_ci 6.1.12). This status will be set to TRUE if a valid executable is 13225bd8deadSopenharmony_ci created, and FALSE otherwise. Linking can fail for a variety of reasons 13235bd8deadSopenharmony_ci as specified in the OpenGL Shading Language Specification. Linking will 13245bd8deadSopenharmony_ci also fail if one or more of the shader objects, attached to 13255bd8deadSopenharmony_ci <programObj>, are not compiled successfully, or if more active uniform 13265bd8deadSopenharmony_ci or active sampler variables are used in <programObj> than allowed (see 13275bd8deadSopenharmony_ci Sections 2.14.3 and 2.14.4). If LinkProgramARB failed, any information 13285bd8deadSopenharmony_ci about a previous link is lost and is not restored. Thus a failed link 13295bd8deadSopenharmony_ci does not restore the old state of <programObj>. If <programObj> is not 13305bd8deadSopenharmony_ci of type PROGRAM_OBJECT_ARB, the error INVALID_OPERATION is generated. 13315bd8deadSopenharmony_ci 13325bd8deadSopenharmony_ci Each program object has an information log that is modified as a result 13335bd8deadSopenharmony_ci of a link operation. This information log can be queried with 13345bd8deadSopenharmony_ci GetInfoLogARB to obtain more information about the link operation (see 13355bd8deadSopenharmony_ci Section 6.1.12). 13365bd8deadSopenharmony_ci 13375bd8deadSopenharmony_ci If a valid executable is created, it can be made part of the current 13385bd8deadSopenharmony_ci rendering state with the following command: 13395bd8deadSopenharmony_ci 13405bd8deadSopenharmony_ci void UseProgramObjectARB(handleARB programObj) 13415bd8deadSopenharmony_ci 13425bd8deadSopenharmony_ci This command will install the executable code as part of current 13435bd8deadSopenharmony_ci rendering state if the program object <programObj> contains valid 13445bd8deadSopenharmony_ci executable code, i.e. has been linked successfully. If 13455bd8deadSopenharmony_ci UseProgramObjectARB is called with the handle set to 0, it is as if the 13465bd8deadSopenharmony_ci GL had no programmable stages and the fixed functionality paths will be 13475bd8deadSopenharmony_ci used instead. If <programObj> cannot be made part of the current 13485bd8deadSopenharmony_ci rendering state, an INVALID_OPERATION error will be generated and the 13495bd8deadSopenharmony_ci current rendering state left unmodified. This error will be set, for 13505bd8deadSopenharmony_ci example, if <programObj> has not been linked successfully. If 13515bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB, the error 13525bd8deadSopenharmony_ci INVALID_OPERATION is generated. 13535bd8deadSopenharmony_ci 13545bd8deadSopenharmony_ci While a program object is in use, applications are free to modify 13555bd8deadSopenharmony_ci attached shader objects, compile attached shader objects, attach 13565bd8deadSopenharmony_ci additional shader objects, and detach shader objects. This does not 13575bd8deadSopenharmony_ci affect the link status OBJECT_LINK_STATUS_ARB of the program object. 13585bd8deadSopenharmony_ci This does not affect the executable code that is part of the current 13595bd8deadSopenharmony_ci state either. That executable code is only affected when the program 13605bd8deadSopenharmony_ci object has been re-linked successfully. After such a successful re-link, 13615bd8deadSopenharmony_ci the LinkProgramARB command will install the generated executable code as 13625bd8deadSopenharmony_ci part of the current rendering state if the specified program object was 13635bd8deadSopenharmony_ci already in use as a result of a previous call to UseProgramObjectARB. If 13645bd8deadSopenharmony_ci this re-link failed, then the executable code part of the current state 13655bd8deadSopenharmony_ci does not change. 13665bd8deadSopenharmony_ci 13675bd8deadSopenharmony_ci Add Subsection 2.14.3 Uniform Variables 13685bd8deadSopenharmony_ci 13695bd8deadSopenharmony_ci Shaders can declare and name "uniform variables" as discussed in the 13705bd8deadSopenharmony_ci OpenGL Shading Language Specification. Values for these uniforms are to 13715bd8deadSopenharmony_ci remain constant over a primitive, and typically they are constant across 13725bd8deadSopenharmony_ci many primitives. Uniforms are program object specific state. They retain 13735bd8deadSopenharmony_ci their values once loaded, and their values are restored whenever a 13745bd8deadSopenharmony_ci program object is used, as long as the program object has not been 13755bd8deadSopenharmony_ci re-linked. A uniform is considered "active" if it is determined by the 13765bd8deadSopenharmony_ci compiler and linker that the uniform will actually be accessed when the 13775bd8deadSopenharmony_ci executable code is executed. In cases where the compiler and linker 13785bd8deadSopenharmony_ci cannot make a conclusive determination, the uniform will be considered 13795bd8deadSopenharmony_ci active. 13805bd8deadSopenharmony_ci 13815bd8deadSopenharmony_ci As a result of a successful link all active uniforms belonging to the 13825bd8deadSopenharmony_ci program object are initialized to zero. A successful link will also 13835bd8deadSopenharmony_ci generate a location for each active uniform. The values of active 13845bd8deadSopenharmony_ci uniforms can be changed using this location and the appropriate 13855bd8deadSopenharmony_ci Uniform*ARB command (see below). These locations are invalidated and new 13865bd8deadSopenharmony_ci ones assigned after each successful re-link. 13875bd8deadSopenharmony_ci 13885bd8deadSopenharmony_ci The following function can be used to find the location of an active 13895bd8deadSopenharmony_ci uniform variable within a program object: 13905bd8deadSopenharmony_ci 13915bd8deadSopenharmony_ci int GetUniformLocationARB(handleARB programObj, const charARB *name) 13925bd8deadSopenharmony_ci 13935bd8deadSopenharmony_ci This command will return the location of uniform variable <name>. <name> 13945bd8deadSopenharmony_ci has to be a null terminated string, without white space. The value of -1 13955bd8deadSopenharmony_ci will be returned if <name> does not correspond to an active uniform 13965bd8deadSopenharmony_ci variable name in <programObj> or if <name> starts with the reserved 13975bd8deadSopenharmony_ci prefix "gl_". If <programObj> has not been successfully linked, or if 13985bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB, the error 13995bd8deadSopenharmony_ci INVALID_OPERATION is generated. The location of a uniform variable does 14005bd8deadSopenharmony_ci not change until the next link command is issued. 14015bd8deadSopenharmony_ci 14025bd8deadSopenharmony_ci A valid <name> cannot be a structure, an array of structures, or a 14035bd8deadSopenharmony_ci subcomponent of a vector or a matrix. In order to identify a valid 14045bd8deadSopenharmony_ci <name>, the "." (dot) and "[]" operators can be used in <name> to 14055bd8deadSopenharmony_ci operate on a structure or to operate on an array. 14065bd8deadSopenharmony_ci 14075bd8deadSopenharmony_ci The first element of a uniform array is identified using the name of the 14085bd8deadSopenharmony_ci uniform array appended with "[0]". Except if the last part of the string 14095bd8deadSopenharmony_ci <name> indicates a uniform array, then the location of the first element 14105bd8deadSopenharmony_ci of that array can be retrieved by either using the name of the uniform 14115bd8deadSopenharmony_ci array, or the name of the uniform array appended with "[0]". 14125bd8deadSopenharmony_ci 14135bd8deadSopenharmony_ci To determine which of the declared uniform variables are active and to 14145bd8deadSopenharmony_ci determine their sizes and types, use the command: 14155bd8deadSopenharmony_ci 14165bd8deadSopenharmony_ci void GetActiveUniformARB(handleARB programObj, uint index, 14175bd8deadSopenharmony_ci sizei maxLength, sizei *length, int *size, 14185bd8deadSopenharmony_ci enum *type, charARB *name) 14195bd8deadSopenharmony_ci 14205bd8deadSopenharmony_ci This command provides information about the uniform selected by <index>. 14215bd8deadSopenharmony_ci The <index> of 0 selects the first active uniform, and <index> of 14225bd8deadSopenharmony_ci OBJECT_ACTIVE_UNIFORMS_ARB-1 selects the last active uniform. The value 14235bd8deadSopenharmony_ci of OBJECT_ACTIVE_UNIFORMS_ARB can be queried with 14245bd8deadSopenharmony_ci GetObjectParameter{if}vARB (see Section 6.1.12). If <index> is greater 14255bd8deadSopenharmony_ci than or equal to OBJECT_ACTIVE_UNIFORMS_ARB, the error INVALID_VALUE is 14265bd8deadSopenharmony_ci generated. 14275bd8deadSopenharmony_ci 14285bd8deadSopenharmony_ci The parameter <programObj> is a handle to a program object for which the 14295bd8deadSopenharmony_ci command LinkProgramARB has been issued in the past. It is not necessary 14305bd8deadSopenharmony_ci for <programObj> to have been linked successfully. The link could have 14315bd8deadSopenharmony_ci failed because the number of active uniforms exceeded the limit. If 14325bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB, the error 14335bd8deadSopenharmony_ci INVALID_OPERATION is generated. 14345bd8deadSopenharmony_ci 14355bd8deadSopenharmony_ci If an error occurred, the return parameters <length>, <size>, <type> and 14365bd8deadSopenharmony_ci <name> will be unmodified. 14375bd8deadSopenharmony_ci 14385bd8deadSopenharmony_ci For the selected uniform, the uniform name is returned into <name>. The 14395bd8deadSopenharmony_ci string <name> will be null terminated. The actual number of characters 14405bd8deadSopenharmony_ci written by the GL into <name> is returned in <length>. This count 14415bd8deadSopenharmony_ci excludes the null termination. If <length> is NULL then the GL ignores 14425bd8deadSopenharmony_ci this parameter. The maximum number of characters the GL is allowed to 14435bd8deadSopenharmony_ci write into <name> is passed in by <maxLength>. The returned uniform name 14445bd8deadSopenharmony_ci can be the name of built-in uniform state as well. The complete list of 14455bd8deadSopenharmony_ci built-in uniform state is described in section 7.5 of the OpenGL Shading 14465bd8deadSopenharmony_ci Language specification. The length of the longest uniform name in 14475bd8deadSopenharmony_ci <programObj> is given by OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB, which can 14485bd8deadSopenharmony_ci be queried with GetObjectParameter{if}vARB (see Section 6.1.12). 14495bd8deadSopenharmony_ci 14505bd8deadSopenharmony_ci Each uniform variable, declared in a shader, is broken down into one or 14515bd8deadSopenharmony_ci more strings using the "." (dot) and "[]" operators, if necessary, to 14525bd8deadSopenharmony_ci the point that it is legal to pass each string back into 14535bd8deadSopenharmony_ci GetUniformLocationARB. Each of these strings constitutes one active 14545bd8deadSopenharmony_ci uniform, and each string is assigned an index. 14555bd8deadSopenharmony_ci 14565bd8deadSopenharmony_ci For the selected uniform, the type of the uniform is returned into 14575bd8deadSopenharmony_ci <type>. The size of the uniform is returned into <size>. The value in 14585bd8deadSopenharmony_ci <size> is in units of the type returned in <type>. The type returned can 14595bd8deadSopenharmony_ci be any of FLOAT, FLOAT_VEC2_ARB, FLOAT_VEC3_ARB, FLOAT_VEC4_ARB, INT, 14605bd8deadSopenharmony_ci INT_VEC2_ARB, INT_VEC3_ARB, INT_VEC4_ARB, BOOL_ARB, BOOL_VEC2_ARB, 14615bd8deadSopenharmony_ci BOOL_VEC3_ARB, BOOL_VEC4_ARB, FLOAT_MAT2_ARB, FLOAT_MAT3_ARB, 14625bd8deadSopenharmony_ci FLOAT_MAT4_ARB, SAMPLER_1D_ARB, SAMPLER_2D_ARB, SAMPLER_3D_ARB, 14635bd8deadSopenharmony_ci SAMPLER_CUBE_ARB, SAMPLER_1D_SHADOW_ARB, SAMPLER_2D_SHADOW_ARB, 14645bd8deadSopenharmony_ci SAMPLER_2D_RECT_ARB or SAMPLER_2D_RECT_SHADOW_ARB. 14655bd8deadSopenharmony_ci 14665bd8deadSopenharmony_ci If one or more elements of an array are active, GetActiveUniformARB will 14675bd8deadSopenharmony_ci return the name of the array in <name>, subject to the restrictions 14685bd8deadSopenharmony_ci listed above. The type of the array is returned in <type>. The <size> 14695bd8deadSopenharmony_ci parameter contains the highest array element index used, plus one. The 14705bd8deadSopenharmony_ci compiler or linker determines the highest index used. There will be only 14715bd8deadSopenharmony_ci one active uniform reported by the GL per uniform array. 14725bd8deadSopenharmony_ci 14735bd8deadSopenharmony_ci This command will return as much information about active uniforms as 14745bd8deadSopenharmony_ci possible. If no information is available, <length> will be set to zero 14755bd8deadSopenharmony_ci and <name> will be an empty string. This situation could arise if 14765bd8deadSopenharmony_ci GetActiveUniformARB is issued after a failed link. 14775bd8deadSopenharmony_ci 14785bd8deadSopenharmony_ci The following commands are used to load values into the uniform 14795bd8deadSopenharmony_ci variables of the program object that is currently in use. 14805bd8deadSopenharmony_ci 14815bd8deadSopenharmony_ci void Uniform{1234}fARB(int location, T value) 14825bd8deadSopenharmony_ci void Uniform{1234}iARB(int location, T value) 14835bd8deadSopenharmony_ci 14845bd8deadSopenharmony_ci void Uniform{1234}fvARB(int location, sizei count, T value) 14855bd8deadSopenharmony_ci void Uniform{1234}ivARB(int location, sizei count, T value) 14865bd8deadSopenharmony_ci 14875bd8deadSopenharmony_ci void UniformMatrix(234}fvARB(int location, sizei count, 14885bd8deadSopenharmony_ci boolean transpose, T value) 14895bd8deadSopenharmony_ci 14905bd8deadSopenharmony_ci These commands will load the given values into the uniform variable 14915bd8deadSopenharmony_ci location identified by <location>. 14925bd8deadSopenharmony_ci 14935bd8deadSopenharmony_ci The Uniform{1234}f{v}ARB commands will load one or more floating-point 14945bd8deadSopenharmony_ci values <count> times into a uniform location defined as a float or 14955bd8deadSopenharmony_ci floating-point vector or an array of floats or an array of 14965bd8deadSopenharmony_ci floating-point vectors. 14975bd8deadSopenharmony_ci 14985bd8deadSopenharmony_ci The Uniform{1234}i{v}ARB commands will load one or more integer values 14995bd8deadSopenharmony_ci <count> times into a uniform location defined as a sampler, integer or 15005bd8deadSopenharmony_ci integer vector or an array of integers or an array of integer vectors. 15015bd8deadSopenharmony_ci Only the Uniform1i{v}ARB commands can be used to load sampler values. 15025bd8deadSopenharmony_ci See section 2.14.4. 15035bd8deadSopenharmony_ci 15045bd8deadSopenharmony_ci The UniformMatrix{234}fvARB commands will load a 2x2, 3x3 or 4x4 matrix 15055bd8deadSopenharmony_ci (corresponding to 2, 3, or 4 in the command name) of floating-point 15065bd8deadSopenharmony_ci values <count> times into a uniform location defined as a matrix or an 15075bd8deadSopenharmony_ci array of matrices. If <transpose> is FALSE, the matrix is specified in 15085bd8deadSopenharmony_ci column major order, otherwise in row major order. 15095bd8deadSopenharmony_ci 15105bd8deadSopenharmony_ci When loading values for a uniform declared as a Boolean, a Boolean 15115bd8deadSopenharmony_ci vector or an array of Booleans or an array of Boolean vectors, both the 15125bd8deadSopenharmony_ci Uniform*i{v} and Uniform*f{v} set of commands can be used to load 15135bd8deadSopenharmony_ci Boolean values. Type conversion is done by the GL. The uniform is set to 15145bd8deadSopenharmony_ci FALSE if the input value is 0 or 0.0f, and set to TRUE otherwise. The 15155bd8deadSopenharmony_ci Uniform*ARB command used must match the size of the uniform, as declared 15165bd8deadSopenharmony_ci in the shader. For example, to load a uniform declared as a bvec2, 15175bd8deadSopenharmony_ci either Uniform2i{v}ARB or Uniform2f{v}ARB can be used. An 15185bd8deadSopenharmony_ci INVALID_OPERATION error will be generated if an attempt is made to use a 15195bd8deadSopenharmony_ci non-matching Uniform*ARB command. In this example using Uniform1ivARB 15205bd8deadSopenharmony_ci would generate an error. 15215bd8deadSopenharmony_ci 15225bd8deadSopenharmony_ci For all other uniform types the Uniform*ARB command used must match the 15235bd8deadSopenharmony_ci size and type of the uniform, as declared in the shader. No type 15245bd8deadSopenharmony_ci conversions are done. For example, to load a uniform declared as a vec4, 15255bd8deadSopenharmony_ci Uniform4f{v}ARB must be used. To load a 3x3 matrix, 15265bd8deadSopenharmony_ci UniformFloatMatrix3fvARB must be used. An INVALID_OPERATION error will 15275bd8deadSopenharmony_ci be generated if an attempt is made to use a non-matching Uniform*ARB 15285bd8deadSopenharmony_ci command. In this example, using Uniform4i{v}ARB would generate an error. 15295bd8deadSopenharmony_ci 15305bd8deadSopenharmony_ci When loading N elements starting at an arbitrary position k in a uniform 15315bd8deadSopenharmony_ci declared as an array, elements k through k + N - 1 in the array will be 15325bd8deadSopenharmony_ci replaced with the new values. Values for any array element that exceeds 15335bd8deadSopenharmony_ci the highest array element index used, as reported by 15345bd8deadSopenharmony_ci GetActiveUniformARB, will be ignored by the GL. 15355bd8deadSopenharmony_ci 15365bd8deadSopenharmony_ci If the value of <location> is -1, the Uniform*ARB commands will silently 15375bd8deadSopenharmony_ci ignore the data passed in. The current uniform values will therefore not 15385bd8deadSopenharmony_ci be changed. 15395bd8deadSopenharmony_ci 15405bd8deadSopenharmony_ci The following applies to errors that can be generated when loading 15415bd8deadSopenharmony_ci uniforms: 15425bd8deadSopenharmony_ci 15435bd8deadSopenharmony_ci - If the size indicated in the name of the Uniform*ARB command used 15445bd8deadSopenharmony_ci does not match the size of the uniform declared in the shader, an 15455bd8deadSopenharmony_ci INVALID_OPERATION error is generated and the uniform's value is not 15465bd8deadSopenharmony_ci changed. 15475bd8deadSopenharmony_ci - If a uniform not of type Boolean is loaded, then if the type 15485bd8deadSopenharmony_ci indicated in the name of the Uniform*ARB command used does not match 15495bd8deadSopenharmony_ci the type of the uniform declared in the shader, an INVALID_OPERATION 15505bd8deadSopenharmony_ci error is generated and the uniform's value is not changed. 15515bd8deadSopenharmony_ci - If <location> is not -1 and <location> does not exist for the program 15525bd8deadSopenharmony_ci object currently in use, the error INVALID_OPERATION is generated. 15535bd8deadSopenharmony_ci - The error INVALID_OPERATION is generated by any of the Uniform*ARB 15545bd8deadSopenharmony_ci commands if there is no program object in use. 15555bd8deadSopenharmony_ci 15565bd8deadSopenharmony_ci Add Subsection 2.14.4 Samplers 15575bd8deadSopenharmony_ci 15585bd8deadSopenharmony_ci Samplers are special uniforms used in the OpenGL Shading Language to 15595bd8deadSopenharmony_ci identify the texture object used for each texture lookup. The value of a 15605bd8deadSopenharmony_ci sampler indicates the texture image unit being accessed. Setting a 15615bd8deadSopenharmony_ci sampler's value to i selects texture image unit number i. The values of 15625bd8deadSopenharmony_ci i range from zero to the maximum supported number of texture image 15635bd8deadSopenharmony_ci units. This maximum is implementation dependent, and defined in other 15645bd8deadSopenharmony_ci specifications. 15655bd8deadSopenharmony_ci 15665bd8deadSopenharmony_ci The type of the sampler identifies the target on the texture image unit. 15675bd8deadSopenharmony_ci The texture object bound to that texture image unit's target is then 15685bd8deadSopenharmony_ci used for the texture lookup. For example, a variable of type sampler2D 15695bd8deadSopenharmony_ci selects target TEXTURE_2D on its texture image unit. Binding of texture 15705bd8deadSopenharmony_ci objects to targets is done as usual with BindTexture. Selecting the 15715bd8deadSopenharmony_ci texture image unit to bind to is done as usual with ActiveTexture. 15725bd8deadSopenharmony_ci 15735bd8deadSopenharmony_ci The location of a sampler needs to be queried with 15745bd8deadSopenharmony_ci GetUniformLocationARB, just like any uniform variable. Sampler values 15755bd8deadSopenharmony_ci need to be set by calling Uniform1i{v}ARB. Loading samplers with any of 15765bd8deadSopenharmony_ci the other Uniform*ARB entry points is not allowed and will result in an 15775bd8deadSopenharmony_ci INVALID_OPERATION error. 15785bd8deadSopenharmony_ci 15795bd8deadSopenharmony_ci It is not allowed to have variables of different sampler types pointing 15805bd8deadSopenharmony_ci to the same texture image unit within a program object. This situation 15815bd8deadSopenharmony_ci can only be detected at the next rendering command issued, and an 15825bd8deadSopenharmony_ci INVALID_OPERATION error will then be generated. 15835bd8deadSopenharmony_ci 15845bd8deadSopenharmony_ci Active samplers are samplers actually being used in a program object. 15855bd8deadSopenharmony_ci The LinkProgramARB command determines if a sampler is active or not. The 15865bd8deadSopenharmony_ci LinkProgramARB command will attempt to determine if the active samplers 15875bd8deadSopenharmony_ci in the shader(s) contained in the program object exceed the maximum 15885bd8deadSopenharmony_ci allowable limits. If it determines that the count of active samplers 15895bd8deadSopenharmony_ci exceeds the allowable limits, then the link fails. (These limits are 15905bd8deadSopenharmony_ci determined by other extensions, and can be different for different types 15915bd8deadSopenharmony_ci of shaders.) If this cannot be determined at link time, for example if 15925bd8deadSopenharmony_ci the program object only contains a vertex shader, then this will be 15935bd8deadSopenharmony_ci determined at the next rendering command issued, and an 15945bd8deadSopenharmony_ci INVALID_OPERATION error will then be generated. 15955bd8deadSopenharmony_ci 15965bd8deadSopenharmony_ci Add Subsection 2.14.5 Resource Limits 15975bd8deadSopenharmony_ci 15985bd8deadSopenharmony_ci A shader should not fail to compile and a program object to link due to 15995bd8deadSopenharmony_ci lack of instruction space or lack of temporary variables. 16005bd8deadSopenharmony_ci Implementations should ensure that all valid shaders and program objects 16015bd8deadSopenharmony_ci could be successfully compiled, linked and executed. 16025bd8deadSopenharmony_ci 16035bd8deadSopenharmony_ci Add Subsection 2.15 Validation 16045bd8deadSopenharmony_ci 16055bd8deadSopenharmony_ci It is not always possible to determine at link time if a program object 16065bd8deadSopenharmony_ci actually will execute. Therefore validation is done when the first 16075bd8deadSopenharmony_ci rendering command is issued, to determine if the currently active 16085bd8deadSopenharmony_ci program object can be executed. If it cannot be executed then no 16095bd8deadSopenharmony_ci fragments will be rendered, and Begin, RasterPos, or any command that 16105bd8deadSopenharmony_ci performs an explicit Begin will generate the error INVALID_OPERATION. 16115bd8deadSopenharmony_ci 16125bd8deadSopenharmony_ci This error is generated by Begin, RasterPos, or any command that 16135bd8deadSopenharmony_ci performs an explicit Begin if: 16145bd8deadSopenharmony_ci 16155bd8deadSopenharmony_ci * One or more samplers of different types in the current program 16165bd8deadSopenharmony_ci object access the same texture image unit. 16175bd8deadSopenharmony_ci * If more than the maximum allowable texture image units are accessed 16185bd8deadSopenharmony_ci based on the count of active samplers and the rest of the GL state. 16195bd8deadSopenharmony_ci Note that LinkProgramARB can normally resolve this, except for the 16205bd8deadSopenharmony_ci case where an ARB_vertex_shader shader is mixed with an 16215bd8deadSopenharmony_ci ARB_fragment_program shader or mixed with fixed-function fragment 16225bd8deadSopenharmony_ci processing. 16235bd8deadSopenharmony_ci 16245bd8deadSopenharmony_ci The INVALID_OPERATION error reported by these rendering commands does 16255bd8deadSopenharmony_ci not provide enough information to find out why the currently active 16265bd8deadSopenharmony_ci program object would not execute. No information at all is available 16275bd8deadSopenharmony_ci about a program object that would still execute, but is inefficient or 16285bd8deadSopenharmony_ci sub optimal given the current GL state. As a development aid, use the 16295bd8deadSopenharmony_ci command 16305bd8deadSopenharmony_ci 16315bd8deadSopenharmony_ci void ValidateProgramARB(handleARB programObj) 16325bd8deadSopenharmony_ci 16335bd8deadSopenharmony_ci to validate the program object <programObj> against the GL state at that 16345bd8deadSopenharmony_ci moment. Each program object has a Boolean status, 16355bd8deadSopenharmony_ci OBJECT_VALIDATE_STATUS_ARB, that is modified as a result of validation. 16365bd8deadSopenharmony_ci This status can be queried with GetObjectParameter{if}vARB (see Section 16375bd8deadSopenharmony_ci 6.1.12). If validation succeeded this status will be set to TRUE, 16385bd8deadSopenharmony_ci otherwise it will be set to FALSE. If validation succeeded the program 16395bd8deadSopenharmony_ci object is guaranteed to execute, given the current GL state. If 16405bd8deadSopenharmony_ci validation failed, the program object is guaranteed to not execute, 16415bd8deadSopenharmony_ci given the current GL state. If <programObj> is not of type 16425bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB, the error INVALID_OPERATION is generated. 16435bd8deadSopenharmony_ci 16445bd8deadSopenharmony_ci ValidateProgramARB will validate at least as much as is done when a 16455bd8deadSopenharmony_ci rendering command is issued, and it could validate more. For example, it 16465bd8deadSopenharmony_ci could give a hint on how to optimize some piece of shader code. 16475bd8deadSopenharmony_ci 16485bd8deadSopenharmony_ci ValidateProgramARB will store its information in the info log. This 16495bd8deadSopenharmony_ci information will either be an empty string or it will contain validation 16505bd8deadSopenharmony_ci information. 16515bd8deadSopenharmony_ci 16525bd8deadSopenharmony_ci ValidateProgramARB is typically only useful during application 16535bd8deadSopenharmony_ci development. An application should not expect different OpenGL 16545bd8deadSopenharmony_ci implementations to produce identical information. 16555bd8deadSopenharmony_ci 16565bd8deadSopenharmony_ci 2.16 Undefined Behavior 16575bd8deadSopenharmony_ci 16585bd8deadSopenharmony_ci By addressing arrays or matrices in a shader it is possible to index 16595bd8deadSopenharmony_ci outside the declared extent of a uniform. Thus it could be possible to 16605bd8deadSopenharmony_ci overwrite critical GL data that is stored next to the uniform in memory. 16615bd8deadSopenharmony_ci What this data could be is GL implementation specific. The OpenGL 16625bd8deadSopenharmony_ci Shading Language states that it is undefined what happens in this case. 16635bd8deadSopenharmony_ci 16645bd8deadSopenharmony_ci The system environment the OpenGL implementation runs in can set certain 16655bd8deadSopenharmony_ci rules, or good practices, that restrict certain behavior. For example, 16665bd8deadSopenharmony_ci on a modern OS it is not allowed to overwrite data in someone else's 16675bd8deadSopenharmony_ci address space. Similarly it would therefore not be allowed to overwrite 16685bd8deadSopenharmony_ci GL data that belongs to another process. This could be further 16695bd8deadSopenharmony_ci restricted by disallowing the ability to overwrite data belonging to 16705bd8deadSopenharmony_ci another context within the same process. The GL implementation, in 16715bd8deadSopenharmony_ci combination with the system environment, decides what is acceptable 16725bd8deadSopenharmony_ci behavior; hence the specification leaves results undefined. 16735bd8deadSopenharmony_ci 16745bd8deadSopenharmony_ci 2.17 Required State 16755bd8deadSopenharmony_ci 16765bd8deadSopenharmony_ci The state required to support shader objects consists of: 16775bd8deadSopenharmony_ci 16785bd8deadSopenharmony_ci * The state that must be maintained to indicate which handles are 16795bd8deadSopenharmony_ci currently in use as shader object names. 16805bd8deadSopenharmony_ci 16815bd8deadSopenharmony_ci The state required per shader object consists of: 16825bd8deadSopenharmony_ci 16835bd8deadSopenharmony_ci * A handleARB indicating the shader object name. 16845bd8deadSopenharmony_ci * An array of arrays of type charARB containing the shader strings, 16855bd8deadSopenharmony_ci initially empty. 16865bd8deadSopenharmony_ci * An integer holding the length of the concatenation of the shader 16875bd8deadSopenharmony_ci strings, including one null termination. 16885bd8deadSopenharmony_ci * An array of unsigned integers holding the length of the shader 16895bd8deadSopenharmony_ci strings, initially zero. 16905bd8deadSopenharmony_ci * An integer holding the value of OBJECT_TYPE_ARB 16915bd8deadSopenharmony_ci * An integer holding the value of OBJECT_SUBTYPE_ARB 16925bd8deadSopenharmony_ci * A Boolean holding the status of the last compile. 16935bd8deadSopenharmony_ci * A Boolean holding the delete status. 16945bd8deadSopenharmony_ci * An array of type charARB containing the info log, initially empty. 16955bd8deadSopenharmony_ci * An integer holding the length of the info log, including a null 16965bd8deadSopenharmony_ci termination. 16975bd8deadSopenharmony_ci 16985bd8deadSopenharmony_ci Initially, no shader objects exist. 16995bd8deadSopenharmony_ci 17005bd8deadSopenharmony_ci The state required to support program objects consists of: 17015bd8deadSopenharmony_ci 17025bd8deadSopenharmony_ci * The state that must be maintained to indicate which handles are 17035bd8deadSopenharmony_ci currently in use as program object names. 17045bd8deadSopenharmony_ci * One handleARB to store the handle of the program object currently in 17055bd8deadSopenharmony_ci use. 17065bd8deadSopenharmony_ci 17075bd8deadSopenharmony_ci The state required per program object consists of: 17085bd8deadSopenharmony_ci 17095bd8deadSopenharmony_ci * A handleARB indicating the program object object name. 17105bd8deadSopenharmony_ci * A list of handleARB to keep track of shader objects attached. 17115bd8deadSopenharmony_ci * An integer holding the number of attached shader objects. 17125bd8deadSopenharmony_ci * A Boolean indicating if the program object has been successfully 17135bd8deadSopenharmony_ci linked. 17145bd8deadSopenharmony_ci * A Boolean holding the status of the last validation attempt. 17155bd8deadSopenharmony_ci * A Boolean holding the delete status. 17165bd8deadSopenharmony_ci * An integer holding the value of OBJECT_TYPE_ARB. 17175bd8deadSopenharmony_ci * An array of type charARB containing the info log, initially empty. 17185bd8deadSopenharmony_ci * An integer holding the length of the info log, including a null 17195bd8deadSopenharmony_ci termination. 17205bd8deadSopenharmony_ci * An array of type charARB for each active uniform containing its 17215bd8deadSopenharmony_ci name, initially empty. 17225bd8deadSopenharmony_ci * An integer holding the length of the longest active uniform name, 17235bd8deadSopenharmony_ci including a null termination. 17245bd8deadSopenharmony_ci * An integer holding the number of active uniforms. 17255bd8deadSopenharmony_ci * An integer for each active uniform, containing its size. 17265bd8deadSopenharmony_ci * An integer for each active uniform, containing its type. 17275bd8deadSopenharmony_ci * An integer for each active uniform, holdings its location. 17285bd8deadSopenharmony_ci 17295bd8deadSopenharmony_ci Initially, no program objects exist. 17305bd8deadSopenharmony_ci 17315bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.4 Specification (Rasterization) 17325bd8deadSopenharmony_ci 17335bd8deadSopenharmony_ci None 17345bd8deadSopenharmony_ci 17355bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 1.4 Specification (Per-Fragment 17365bd8deadSopenharmony_ciOperations and the Frame Buffer) 17375bd8deadSopenharmony_ci 17385bd8deadSopenharmony_ci None 17395bd8deadSopenharmony_ci 17405bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 1.4 Specification (Special Functions) 17415bd8deadSopenharmony_ci 17425bd8deadSopenharmony_ci Add to section 5.4, Display Lists. 17435bd8deadSopenharmony_ci 17445bd8deadSopenharmony_ci Commands that are used to create and manage objects are not included in 17455bd8deadSopenharmony_ci display lists, but are executed immediately. These include 17465bd8deadSopenharmony_ci DeleteObjectARB, DetachObjectARB, CreateShaderObjectARB, 17475bd8deadSopenharmony_ci ShaderSourceARB, CompileShaderARB, CreateProgramObjectARB, 17485bd8deadSopenharmony_ci AttachObjectARB, and LinkProgramARB. 17495bd8deadSopenharmony_ci 17505bd8deadSopenharmony_ci Commands that are used to query various pieces of object state are not 17515bd8deadSopenharmony_ci included in display lists, but are executed immediately. These include 17525bd8deadSopenharmony_ci GetHandleARB, GetObjectParameterfvARB, GetObjectParameterivARB, 17535bd8deadSopenharmony_ci GetInfoLogARB, GetUniformfvARB, GetUniformivARB, GetUniformLocationARB, 17545bd8deadSopenharmony_ci GetShaderSourceARB, GetActiveUniformARB, GetAttachedObjectsARB and 17555bd8deadSopenharmony_ci ValidateProgramARB. 17565bd8deadSopenharmony_ci 17575bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 1.4 Specification (State and State Requests) 17585bd8deadSopenharmony_ci 17595bd8deadSopenharmony_ci Add a new section just after section 6.1.11 (p. 214) called 6.1.12 17605bd8deadSopenharmony_ci "Generic Object Queries" and renumber section 6.1.12 as 6.1.13. 17615bd8deadSopenharmony_ci 17625bd8deadSopenharmony_ci The command 17635bd8deadSopenharmony_ci 17645bd8deadSopenharmony_ci handleARB GetHandleARB(enum pname) 17655bd8deadSopenharmony_ci 17665bd8deadSopenharmony_ci returns the handle to an object that is in use as part of current state. 17675bd8deadSopenharmony_ci <pname> specifies the state item for which the current object is to be 17685bd8deadSopenharmony_ci returned and can be one of PROGRAM_OBJECT_ARB. (This list is augmented 17695bd8deadSopenharmony_ci by other extensions.) If <pname> is not a valid state item, 0 is 17705bd8deadSopenharmony_ci returned. 17715bd8deadSopenharmony_ci 17725bd8deadSopenharmony_ci The commands 17735bd8deadSopenharmony_ci 17745bd8deadSopenharmony_ci void GetObjectParameterfvARB(handleARB obj, enum pname, float *params) 17755bd8deadSopenharmony_ci void GetObjectParameterivARB(handleARB obj, enum pname, int *params) 17765bd8deadSopenharmony_ci 17775bd8deadSopenharmony_ci return object specific parameter values for object <obj> in <params>. 17785bd8deadSopenharmony_ci The parameter value to return is specified by <pname>. 17795bd8deadSopenharmony_ci 17805bd8deadSopenharmony_ci If <pname> is OBJECT_TYPE_ARB, GetObjectParameter{if}vARB returns 17815bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB if <obj> references a program object. It returns 17825bd8deadSopenharmony_ci SHADER_OBJECT_ARB if <obj> references any shader object. If <obj> is not 17835bd8deadSopenharmony_ci of type PROGRAM_OBJECT_ARB or SHADER_OBJECT_ARB, the error 17845bd8deadSopenharmony_ci INVALID_OPERATION is generated. 17855bd8deadSopenharmony_ci 17865bd8deadSopenharmony_ci If <pname> is OBJECT_SUBTYPE_ARB, GetObjectParameter{if}vARB returns the 17875bd8deadSopenharmony_ci subtype of a shader object. If <obj> is not of type SHADER_OBJECT_ARB, 17885bd8deadSopenharmony_ci the error INVALID_OPERATION is generated. 17895bd8deadSopenharmony_ci 17905bd8deadSopenharmony_ci If <pname> is OBJECT_DELETE_STATUS_ARB, GetObjectParameter{if}vARB 17915bd8deadSopenharmony_ci returns 1 or 1.0f if status is TRUE and 0 or 0.0f if status is FALSE. If 17925bd8deadSopenharmony_ci <obj> is not of type PROGRAM_OBJECT_ARB or SHADER_OBJECT_ARB, the error 17935bd8deadSopenharmony_ci INVALID_OPERATION is generated. 17945bd8deadSopenharmony_ci 17955bd8deadSopenharmony_ci If <pname> is OBJECT_LINK_STATUS_ARB, GetObjectParameter{if}vARB returns 17965bd8deadSopenharmony_ci 1 or 1.0f if status is TRUE and 0 or 0.0f if status is FALSE. If <obj> 17975bd8deadSopenharmony_ci is not of type PROGRAM_OBJECT_ARB, the error INVALID_OPERATION is 17985bd8deadSopenharmony_ci generated. 17995bd8deadSopenharmony_ci 18005bd8deadSopenharmony_ci If <pname> is OBJECT_VALIDATE_STATUS_ARB, GetObjectParameter{if}vARB 18015bd8deadSopenharmony_ci returns 1 or 1.0f if status is TRUE and 0 or 0.0f if status is FALSE. If 18025bd8deadSopenharmony_ci <obj> is not of type PROGRAM_OBJECT_ARB, the error INVALID_OPERATION is 18035bd8deadSopenharmony_ci generated. 18045bd8deadSopenharmony_ci 18055bd8deadSopenharmony_ci If <pname> is OBJECT_COMPILE_STATUS_ARB, GetObjectParameter{if}vARB 18065bd8deadSopenharmony_ci returns 1 or 1.0f if status is TRUE and 0 or 0.0f if status is FALSE. If 18075bd8deadSopenharmony_ci <obj> is not of type SHADER_OBJECT_ARB, the error INVALID_OPERATION is 18085bd8deadSopenharmony_ci generated. 18095bd8deadSopenharmony_ci 18105bd8deadSopenharmony_ci If <pname> is OBJECT_INFO_LOG_LENGTH_ARB, GetObjectParameter{if}vARB 18115bd8deadSopenharmony_ci returns the length of the info log, including a null termination. If 18125bd8deadSopenharmony_ci there is no info log, 0 or 0.0f is returned. If <obj> is not of type 18135bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB or SHADER_OBJECT_ARB, the error INVALID_OPERATION is 18145bd8deadSopenharmony_ci generated. 18155bd8deadSopenharmony_ci 18165bd8deadSopenharmony_ci If <pname> is OBJECT_ATTACHED_OBJECTS_ARB, GetObjectParameter{if}vARB 18175bd8deadSopenharmony_ci returns the number of objects attached. If no objects are attached, 0 or 18185bd8deadSopenharmony_ci 0.0f is returned. If <obj> is not of type PROGRAM_OBJECT_ARB the error 18195bd8deadSopenharmony_ci INVALID_OPERATION is generated. 18205bd8deadSopenharmony_ci 18215bd8deadSopenharmony_ci If <pname> is OBJECT_ACTIVE_UNIFORMS_ARB, GetObjectParameter{if}vARB 18225bd8deadSopenharmony_ci returns the number of active uniforms. If no active uniforms exist, 0 or 18235bd8deadSopenharmony_ci 0.0f is returned. If <obj> is not of type PROGRAM_OBJECT_ARB the error 18245bd8deadSopenharmony_ci INVALID_OPERATION is generated. 18255bd8deadSopenharmony_ci 18265bd8deadSopenharmony_ci If <pname> is OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB, 18275bd8deadSopenharmony_ci GetObjectParameter{if}vARB returns the length of the longest active 18285bd8deadSopenharmony_ci uniform name, including a null termination. If no active uniforms exist, 18295bd8deadSopenharmony_ci 0 or 0.0f is returned. If <obj> is not of type PROGRAM_OBJECT_ARB the 18305bd8deadSopenharmony_ci error INVALID_OPERATION is generated. 18315bd8deadSopenharmony_ci 18325bd8deadSopenharmony_ci If <pname> is OBJECT_SHADER_SOURCE_LENGTH_ARB, 18335bd8deadSopenharmony_ci GetObjectParameter{if}vARB returns the length of the concatenation of 18345bd8deadSopenharmony_ci the source strings making up the shader source, including a null 18355bd8deadSopenharmony_ci termination. If no source exists, 0 or 0.0f is returned. If <obj> is not 18365bd8deadSopenharmony_ci of type SHADER_OBJECT_ARB the error INVALID_OPERATION is generated. 18375bd8deadSopenharmony_ci 18385bd8deadSopenharmony_ci If an error occurred, the return parameter <params> will be unmodified. 18395bd8deadSopenharmony_ci 18405bd8deadSopenharmony_ci The command 18415bd8deadSopenharmony_ci 18425bd8deadSopenharmony_ci void GetAttachedObjectsARB(handleARB containerObj, sizei maxCount, 18435bd8deadSopenharmony_ci sizei *count, handleARB *obj) 18445bd8deadSopenharmony_ci 18455bd8deadSopenharmony_ci returns the handles of objects attached to <containerObj> in <obj>. The 18465bd8deadSopenharmony_ci actual number of object handles written by the GL into <obj> is returned 18475bd8deadSopenharmony_ci in <count>. If no objects are attached, <count> is set to zero. If 18485bd8deadSopenharmony_ci <count> is NULL then the GL ignores this parameter. The maximum number 18495bd8deadSopenharmony_ci of handles the GL is allowed to write into <obj> is passed in by 18505bd8deadSopenharmony_ci <maxCount>. The number of objects attached to <containerObj> is given by 18515bd8deadSopenharmony_ci OBJECT_ATTACHED_OBJECTS_ARB, which can be queried with 18525bd8deadSopenharmony_ci GetObjectParameter{if}vARB. If <containerObj> is not of type 18535bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB, the error INVALID_OPERATION is generated. If an 18545bd8deadSopenharmony_ci error occurred, the return parameters <count> and <obj> will be 18555bd8deadSopenharmony_ci unmodified. 18565bd8deadSopenharmony_ci 18575bd8deadSopenharmony_ci A string that contains information about the last link or validation 18585bd8deadSopenharmony_ci attempt and last compilation attempt are kept per program or shader 18595bd8deadSopenharmony_ci object. This string is called the info log and can be obtained with the 18605bd8deadSopenharmony_ci command: 18615bd8deadSopenharmony_ci 18625bd8deadSopenharmony_ci void GetInfoLogARB(handleARB obj, sizei maxLength, sizei *length, 18635bd8deadSopenharmony_ci charARB *infoLog) 18645bd8deadSopenharmony_ci 18655bd8deadSopenharmony_ci This command returns the info log string in <infoLog>. This string will 18665bd8deadSopenharmony_ci be null terminated. The actual number of characters written by the GL 18675bd8deadSopenharmony_ci into <infoLog> is returned in <length>, excluding the null termination. 18685bd8deadSopenharmony_ci If <length> is NULL then the GL ignores this parameter. The maximum 18695bd8deadSopenharmony_ci number of characters the GL is allowed to write into <infoLog> is passed 18705bd8deadSopenharmony_ci in by <maxLength>. The number of characters in the info log is given by 18715bd8deadSopenharmony_ci OBJECT_INFO_LOG_LENGTH_ARB, which can be queried with 18725bd8deadSopenharmony_ci GetObjectParameter{fi}vARB. If <obj> is a shader object, the returned 18735bd8deadSopenharmony_ci info log will either be an empty string or it will contain information 18745bd8deadSopenharmony_ci about the last compilation attempt for that object. If <obj> is a 18755bd8deadSopenharmony_ci program object, the returned info log will either be an empty string or 18765bd8deadSopenharmony_ci it will contain information about the last link attempt or last 18775bd8deadSopenharmony_ci validation attempt for that object. If <obj> is not of type 18785bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB or SHADER_OBJECT_ARB, the error INVALID_OPERATION is 18795bd8deadSopenharmony_ci generated. If an error occurred, the return parameters <length> and 18805bd8deadSopenharmony_ci <infoLog> will be unmodified. 18815bd8deadSopenharmony_ci 18825bd8deadSopenharmony_ci The info log is typically only useful during application development and 18835bd8deadSopenharmony_ci an application should not expect different OpenGL implementations to 18845bd8deadSopenharmony_ci produce identical info logs. 18855bd8deadSopenharmony_ci 18865bd8deadSopenharmony_ci The command 18875bd8deadSopenharmony_ci 18885bd8deadSopenharmony_ci void GetShaderSourceARB(handleARB obj, sizei maxLength, 18895bd8deadSopenharmony_ci sizei *length, charARB *source) 18905bd8deadSopenharmony_ci 18915bd8deadSopenharmony_ci will return in <source> the string making up the source code for the 18925bd8deadSopenharmony_ci shader object <obj>. The string <source> will be null terminated. The 18935bd8deadSopenharmony_ci actual number of characters written by the GL into <source> is returned 18945bd8deadSopenharmony_ci in <length>, excluding the null termination. If <length> is NULL then 18955bd8deadSopenharmony_ci the GL ignores this parameter. The maximum number of characters the GL 18965bd8deadSopenharmony_ci is allowed to write into <source> is passed in by <maxLength>. The 18975bd8deadSopenharmony_ci string <source> is a concatenation of the strings passed to OpenGL using 18985bd8deadSopenharmony_ci ShaderSourceARB. The length of this concatenation is given by 18995bd8deadSopenharmony_ci OBJECT_SHADER_SOURCE_LENGTH_ARB, which can be queried with 19005bd8deadSopenharmony_ci GetObjectParameter{if}vARB. If <obj> is not of type SHADER_OBJECT_ARB, 19015bd8deadSopenharmony_ci the error INVALID_OPERATION is generated. If an error occurred, the 19025bd8deadSopenharmony_ci return parameters <length> and <source> will be unmodified. 19035bd8deadSopenharmony_ci 19045bd8deadSopenharmony_ci The commands 19055bd8deadSopenharmony_ci 19065bd8deadSopenharmony_ci void GetUniformfvARB(handleARB programObj, int location, float *params) 19075bd8deadSopenharmony_ci void GetUniformivARB(handleARB programObj, int location, int *params) 19085bd8deadSopenharmony_ci 19095bd8deadSopenharmony_ci return the value or values of the uniform at location <location> for 19105bd8deadSopenharmony_ci program object <programObj> in the array <params>. The type of the 19115bd8deadSopenharmony_ci uniform at <location> determines the number of values returned. The 19125bd8deadSopenharmony_ci error INVALID_OPERATION is generated if <programObj> is not of type 19135bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB or if <programObj> has not been linked successfully 19145bd8deadSopenharmony_ci or if <location> is not a valid location for <programObj>. In order to 19155bd8deadSopenharmony_ci query the values of an array of uniforms a GetUniform*ARB command needs 19165bd8deadSopenharmony_ci to be issued for each array element. If the uniform queried is a matrix, 19175bd8deadSopenharmony_ci the values of the matrix are returned in column major order. If an error 19185bd8deadSopenharmony_ci occurred, the return parameter <params> will be unmodified. 19195bd8deadSopenharmony_ci 19205bd8deadSopenharmony_ci Add to Table 6.3: State Variable Types (p. 217) 19215bd8deadSopenharmony_ci 19225bd8deadSopenharmony_ci H Object handle 19235bd8deadSopenharmony_ci 19245bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 1.4 Specification (Invariance) 19255bd8deadSopenharmony_ci 19265bd8deadSopenharmony_ci None 19275bd8deadSopenharmony_ci 19285bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 19295bd8deadSopenharmony_ci 19305bd8deadSopenharmony_ci Analogous to sharing display lists and texture objects, it is possible 19315bd8deadSopenharmony_ci to share the name space for handles for all objects across a set of 19325bd8deadSopenharmony_ci contexts, as long as the server sides of the contexts share the same 19335bd8deadSopenharmony_ci address space. No change is made to the AGL/GLX/WGL API. If handles are 19345bd8deadSopenharmony_ci shared across contexts the data belonging to those objects are shared as 19355bd8deadSopenharmony_ci well. Changes to objects shared between multiple rendering contexts will 19365bd8deadSopenharmony_ci be serialized (i.e., the changes will occur in a specific order). 19375bd8deadSopenharmony_ci 19385bd8deadSopenharmony_ci Changes to a program object made by one rendering context are not 19395bd8deadSopenharmony_ci guaranteed to take effect in another rendering context until the other 19405bd8deadSopenharmony_ci calls UseProgramObjectARB for that object. 19415bd8deadSopenharmony_ci 19425bd8deadSopenharmony_ci When a program object is deleted by one rendering context, the object 19435bd8deadSopenharmony_ci itself is not destroyed until it is no longer the current program object 19445bd8deadSopenharmony_ci in any context. 19455bd8deadSopenharmony_ci 19465bd8deadSopenharmony_ci When a shader object is deleted by one rendering context, the object 19475bd8deadSopenharmony_ci itself is not destroyed until it is no longer attached to any program 19485bd8deadSopenharmony_ci object in any context. 19495bd8deadSopenharmony_ci 19505bd8deadSopenharmony_ciGLX Protocol 19515bd8deadSopenharmony_ci 19525bd8deadSopenharmony_ci The following rendering commands are sent to the server as part of a 19535bd8deadSopenharmony_ci glXRender request: 19545bd8deadSopenharmony_ci 19555bd8deadSopenharmony_ci DeleteObjectARB 19565bd8deadSopenharmony_ci 19575bd8deadSopenharmony_ci 2 8 rendering command length 19585bd8deadSopenharmony_ci 2 238 rendering command opcode 19595bd8deadSopenharmony_ci 4 CARD32 obj 19605bd8deadSopenharmony_ci 19615bd8deadSopenharmony_ci DetachObjectARB 19625bd8deadSopenharmony_ci 19635bd8deadSopenharmony_ci 2 12 rendering command length 19645bd8deadSopenharmony_ci 2 239 rendering command opcode 19655bd8deadSopenharmony_ci 4 CARD32 containerObj 19665bd8deadSopenharmony_ci 4 CARD32 attachedObj 19675bd8deadSopenharmony_ci 19685bd8deadSopenharmony_ci CompileShaderARB 19695bd8deadSopenharmony_ci 19705bd8deadSopenharmony_ci 2 8 rendering command length 19715bd8deadSopenharmony_ci 2 240 rendering command opcode 19725bd8deadSopenharmony_ci 4 CARD32 shaderObj 19735bd8deadSopenharmony_ci 19745bd8deadSopenharmony_ci AttachObjectARB 19755bd8deadSopenharmony_ci 19765bd8deadSopenharmony_ci 2 12 rendering command length 19775bd8deadSopenharmony_ci 2 241 rendering command opcode 19785bd8deadSopenharmony_ci 4 CARD32 containerObj 19795bd8deadSopenharmony_ci 4 CARD32 obj 19805bd8deadSopenharmony_ci 19815bd8deadSopenharmony_ci LinkProgramARB 19825bd8deadSopenharmony_ci 19835bd8deadSopenharmony_ci 2 8 rendering command length 19845bd8deadSopenharmony_ci 2 242 rendering command opcode 19855bd8deadSopenharmony_ci 4 CARD32 programObj 19865bd8deadSopenharmony_ci 19875bd8deadSopenharmony_ci UseProgramObjectARB 19885bd8deadSopenharmony_ci 19895bd8deadSopenharmony_ci 2 8 rendering command length 19905bd8deadSopenharmony_ci 2 243 rendering command opcode 19915bd8deadSopenharmony_ci 4 CARD32 programObj 19925bd8deadSopenharmony_ci 19935bd8deadSopenharmony_ci ValidateProgramARB 19945bd8deadSopenharmony_ci 19955bd8deadSopenharmony_ci 2 8 rendering command length 19965bd8deadSopenharmony_ci 2 244 rendering command opcode 19975bd8deadSopenharmony_ci 4 CARD32 programObj 19985bd8deadSopenharmony_ci 19995bd8deadSopenharmony_ci Uniform1fARB 20005bd8deadSopenharmony_ci 20015bd8deadSopenharmony_ci 2 12 rendering command length 20025bd8deadSopenharmony_ci 2 245 rendering command opcode 20035bd8deadSopenharmony_ci 4 INT32 location 20045bd8deadSopenharmony_ci 4 FLOAT32 v0 20055bd8deadSopenharmony_ci 20065bd8deadSopenharmony_ci Uniform2fARB 20075bd8deadSopenharmony_ci 20085bd8deadSopenharmony_ci 2 16 rendering command length 20095bd8deadSopenharmony_ci 2 246 rendering command opcode 20105bd8deadSopenharmony_ci 4 INT32 location 20115bd8deadSopenharmony_ci 4 FLOAT32 v0 20125bd8deadSopenharmony_ci 4 FLOAT32 v1 20135bd8deadSopenharmony_ci 20145bd8deadSopenharmony_ci Uniform3fARB 20155bd8deadSopenharmony_ci 20165bd8deadSopenharmony_ci 2 20 rendering command length 20175bd8deadSopenharmony_ci 2 247 rendering command opcode 20185bd8deadSopenharmony_ci 4 INT32 location 20195bd8deadSopenharmony_ci 4 FLOAT32 v0 20205bd8deadSopenharmony_ci 4 FLOAT32 v1 20215bd8deadSopenharmony_ci 4 FLOAT32 v2 20225bd8deadSopenharmony_ci 20235bd8deadSopenharmony_ci Uniform4fARB 20245bd8deadSopenharmony_ci 2 24 rendering command length 20255bd8deadSopenharmony_ci 2 248 rendering command opcode 20265bd8deadSopenharmony_ci 4 INT32 location 20275bd8deadSopenharmony_ci 4 FLOAT32 v0 20285bd8deadSopenharmony_ci 4 FLOAT32 v1 20295bd8deadSopenharmony_ci 4 FLOAT32 v2 20305bd8deadSopenharmony_ci 4 FLOAT32 v3 20315bd8deadSopenharmony_ci 20325bd8deadSopenharmony_ci Uniform1iARB 20335bd8deadSopenharmony_ci 20345bd8deadSopenharmony_ci 2 12 rendering command length 20355bd8deadSopenharmony_ci 2 249 rendering command opcode 20365bd8deadSopenharmony_ci 4 INT32 location 20375bd8deadSopenharmony_ci 4 INT32 v0 20385bd8deadSopenharmony_ci 20395bd8deadSopenharmony_ci Uniform2iARB 20405bd8deadSopenharmony_ci 20415bd8deadSopenharmony_ci 2 16 rendering command length 20425bd8deadSopenharmony_ci 2 250 rendering command opcode 20435bd8deadSopenharmony_ci 4 INT32 location 20445bd8deadSopenharmony_ci 4 INT32 v0 20455bd8deadSopenharmony_ci 4 INT32 v1 20465bd8deadSopenharmony_ci 20475bd8deadSopenharmony_ci Uniform3iARB 20485bd8deadSopenharmony_ci 20495bd8deadSopenharmony_ci 2 20 rendering command length 20505bd8deadSopenharmony_ci 2 251 rendering command opcode 20515bd8deadSopenharmony_ci 4 INT32 location 20525bd8deadSopenharmony_ci 4 INT32 v0 20535bd8deadSopenharmony_ci 4 INT32 v1 20545bd8deadSopenharmony_ci 4 INT32 v2 20555bd8deadSopenharmony_ci 20565bd8deadSopenharmony_ci Uniform4iARB 20575bd8deadSopenharmony_ci 20585bd8deadSopenharmony_ci 2 24 rendering command length 20595bd8deadSopenharmony_ci 2 252 rendering command opcode 20605bd8deadSopenharmony_ci 4 INT32 location 20615bd8deadSopenharmony_ci 4 INT32 v0 20625bd8deadSopenharmony_ci 4 INT32 v1 20635bd8deadSopenharmony_ci 4 INT32 v2 20645bd8deadSopenharmony_ci 4 INT32 v3 20655bd8deadSopenharmony_ci 20665bd8deadSopenharmony_ci The following rendering commands are sent to the server as part of a 20675bd8deadSopenharmony_ci glXRender request or as a glXRenderLarge request: 20685bd8deadSopenharmony_ci 20695bd8deadSopenharmony_ci ShaderSourceARB 20705bd8deadSopenharmony_ci 20715bd8deadSopenharmony_ci 2 12+(count*4)+n+p rendering command length 20725bd8deadSopenharmony_ci 2 253 rendering command opcode 20735bd8deadSopenharmony_ci 4 CARD32 shaderObj 20745bd8deadSopenharmony_ci 4 CARD32 count 20755bd8deadSopenharmony_ci 4*count LISTofINT32 length 20765bd8deadSopenharmony_ci n LISTofBYTE string. n is described below 20775bd8deadSopenharmony_ci p unused, p=pad(n) 20785bd8deadSopenharmony_ci 20795bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 20805bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 20815bd8deadSopenharmony_ci 4 bytes each: 20825bd8deadSopenharmony_ci 20835bd8deadSopenharmony_ci 4 16+(count*4)+n+p rendering command length 20845bd8deadSopenharmony_ci 4 253 rendering command opcode 20855bd8deadSopenharmony_ci 20865bd8deadSopenharmony_ci n is the sum of the length of all the strings in the array passed 20875bd8deadSopenharmony_ci in as <string>. The length of each string i, where i = [0, <count>), 20885bd8deadSopenharmony_ci is strlen(<string[i]>) if <length> is NULL or if <length[i]> is 20895bd8deadSopenharmony_ci negative. Otherwise, the length of string i is <length[i]>. If 20905bd8deadSopenharmony_ci <count> is 0, n is 0. 20915bd8deadSopenharmony_ci 20925bd8deadSopenharmony_ci Uniform1fvARB 20935bd8deadSopenharmony_ci 20945bd8deadSopenharmony_ci 2 12+count*4 rendering command length 20955bd8deadSopenharmony_ci 2 254 rendering command opcode 20965bd8deadSopenharmony_ci 4 INT32 location 20975bd8deadSopenharmony_ci 4 CARD32 count 20985bd8deadSopenharmony_ci 4*count LISTofFLOAT32 value 20995bd8deadSopenharmony_ci 21005bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 21015bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 21025bd8deadSopenharmony_ci 4 bytes each: 21035bd8deadSopenharmony_ci 21045bd8deadSopenharmony_ci 4 16+count*4 rendering command length 21055bd8deadSopenharmony_ci 4 254 rendering command opcode 21065bd8deadSopenharmony_ci 21075bd8deadSopenharmony_ci Uniform2fvARB 21085bd8deadSopenharmony_ci 21095bd8deadSopenharmony_ci 2 12+count*4*2 rendering command length 21105bd8deadSopenharmony_ci 2 255 rendering command opcode 21115bd8deadSopenharmony_ci 4 INT32 location 21125bd8deadSopenharmony_ci 4 CARD32 count 21135bd8deadSopenharmony_ci 4*count*2 LISTofFLOAT32 value 21145bd8deadSopenharmony_ci 21155bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 21165bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 21175bd8deadSopenharmony_ci 4 bytes each: 21185bd8deadSopenharmony_ci 21195bd8deadSopenharmony_ci 4 16+count*4*2 rendering command length 21205bd8deadSopenharmony_ci 4 255 rendering command opcode 21215bd8deadSopenharmony_ci 21225bd8deadSopenharmony_ci Uniform3fvARB 21235bd8deadSopenharmony_ci 21245bd8deadSopenharmony_ci 2 12+count*4*3 rendering command length 21255bd8deadSopenharmony_ci 2 256 rendering command opcode 21265bd8deadSopenharmony_ci 4 INT32 location 21275bd8deadSopenharmony_ci 4 CARD32 count 21285bd8deadSopenharmony_ci 4*count*3 LISTofFLOAT32 value 21295bd8deadSopenharmony_ci 21305bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 21315bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 21325bd8deadSopenharmony_ci 4 bytes each: 21335bd8deadSopenharmony_ci 21345bd8deadSopenharmony_ci 4 16+count*4*3 rendering command length 21355bd8deadSopenharmony_ci 4 256 rendering command opcode 21365bd8deadSopenharmony_ci 21375bd8deadSopenharmony_ci Uniform4fvARB 21385bd8deadSopenharmony_ci 21395bd8deadSopenharmony_ci 2 12+count*4*4 rendering command length 21405bd8deadSopenharmony_ci 2 257 rendering command opcode 21415bd8deadSopenharmony_ci 4 INT32 location 21425bd8deadSopenharmony_ci 4 CARD32 count 21435bd8deadSopenharmony_ci 4*count*4 LISTofFLOAT32 value 21445bd8deadSopenharmony_ci 21455bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 21465bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 21475bd8deadSopenharmony_ci 4 bytes each: 21485bd8deadSopenharmony_ci 21495bd8deadSopenharmony_ci 4 16+count*4*4 rendering command length 21505bd8deadSopenharmony_ci 4 257 rendering command opcode 21515bd8deadSopenharmony_ci 21525bd8deadSopenharmony_ci Uniform1ivARB 21535bd8deadSopenharmony_ci 21545bd8deadSopenharmony_ci 2 12+count*4 rendering command length 21555bd8deadSopenharmony_ci 2 258 rendering command opcode 21565bd8deadSopenharmony_ci 4 INT32 location 21575bd8deadSopenharmony_ci 4 CARD32 count 21585bd8deadSopenharmony_ci 4*count LISTofINT32 value 21595bd8deadSopenharmony_ci 21605bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 21615bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 21625bd8deadSopenharmony_ci 4 bytes each: 21635bd8deadSopenharmony_ci 21645bd8deadSopenharmony_ci 4 16+count*4 rendering command length 21655bd8deadSopenharmony_ci 4 258 rendering command opcode 21665bd8deadSopenharmony_ci 21675bd8deadSopenharmony_ci Uniform2ivARB 21685bd8deadSopenharmony_ci 21695bd8deadSopenharmony_ci 2 12+count*4*2 rendering command length 21705bd8deadSopenharmony_ci 2 259 rendering command opcode 21715bd8deadSopenharmony_ci 4 INT32 location 21725bd8deadSopenharmony_ci 4 CARD32 count 21735bd8deadSopenharmony_ci 4*count*2 LISTofINT32 value 21745bd8deadSopenharmony_ci 21755bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 21765bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 21775bd8deadSopenharmony_ci 4 bytes each: 21785bd8deadSopenharmony_ci 21795bd8deadSopenharmony_ci 4 16+count*4*2 rendering command length 21805bd8deadSopenharmony_ci 4 259 rendering command opcode 21815bd8deadSopenharmony_ci 21825bd8deadSopenharmony_ci Uniform3ivARB 21835bd8deadSopenharmony_ci 21845bd8deadSopenharmony_ci 2 12+count*4*3 rendering command length 21855bd8deadSopenharmony_ci 2 260 rendering command opcode 21865bd8deadSopenharmony_ci 4 INT32 location 21875bd8deadSopenharmony_ci 4 CARD32 count 21885bd8deadSopenharmony_ci 4*count*3 LISTofINT32 value 21895bd8deadSopenharmony_ci 21905bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 21915bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 21925bd8deadSopenharmony_ci 4 bytes each: 21935bd8deadSopenharmony_ci 21945bd8deadSopenharmony_ci 4 16+count*4*3 rendering command length 21955bd8deadSopenharmony_ci 4 260 rendering command opcode 21965bd8deadSopenharmony_ci 21975bd8deadSopenharmony_ci Uniform4ivARB 21985bd8deadSopenharmony_ci 21995bd8deadSopenharmony_ci 2 12+count*4*4 rendering command length 22005bd8deadSopenharmony_ci 2 261 rendering command opcode 22015bd8deadSopenharmony_ci 4 INT32 location 22025bd8deadSopenharmony_ci 4 CARD32 count 22035bd8deadSopenharmony_ci 4*count*4 LISTofINT32 value 22045bd8deadSopenharmony_ci 22055bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 22065bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 22075bd8deadSopenharmony_ci 4 bytes each: 22085bd8deadSopenharmony_ci 22095bd8deadSopenharmony_ci 4 16+count*4*4 rendering command length 22105bd8deadSopenharmony_ci 4 261 rendering command opcode 22115bd8deadSopenharmony_ci 22125bd8deadSopenharmony_ci UniformMatrix2fvARB 22135bd8deadSopenharmony_ci 22145bd8deadSopenharmony_ci 2 16+4*count*2*2 rendering command length 22155bd8deadSopenharmony_ci 2 262 rendering command opcode 22165bd8deadSopenharmony_ci 4 INT32 location 22175bd8deadSopenharmony_ci 4 CARD32 count 22185bd8deadSopenharmony_ci 1 CARD8 transpose 22195bd8deadSopenharmony_ci 3 CARD8 unused 22205bd8deadSopenharmony_ci 4*count*2*2 LISTofFLOAT32 value 22215bd8deadSopenharmony_ci 22225bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 22235bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 22245bd8deadSopenharmony_ci 4 bytes each: 22255bd8deadSopenharmony_ci 22265bd8deadSopenharmony_ci 4 20+4*count*2*2 rendering command length 22275bd8deadSopenharmony_ci 4 262 rendering command opcode 22285bd8deadSopenharmony_ci 22295bd8deadSopenharmony_ci UniformMatrix3fvARB 22305bd8deadSopenharmony_ci 22315bd8deadSopenharmony_ci 2 16+4*count*3*3 rendering command length 22325bd8deadSopenharmony_ci 2 263 rendering command opcode 22335bd8deadSopenharmony_ci 4 INT32 location 22345bd8deadSopenharmony_ci 4 CARD32 count 22355bd8deadSopenharmony_ci 1 CARD8 transpose 22365bd8deadSopenharmony_ci 3 CARD8 unused 22375bd8deadSopenharmony_ci 4*count*3*3 LISTofFLOAT32 value 22385bd8deadSopenharmony_ci 22395bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 22405bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 22415bd8deadSopenharmony_ci 4 bytes each: 22425bd8deadSopenharmony_ci 22435bd8deadSopenharmony_ci 4 20+4*count*3*3 rendering command length 22445bd8deadSopenharmony_ci 4 263 rendering command opcode 22455bd8deadSopenharmony_ci 22465bd8deadSopenharmony_ci UniformMatrix4fvARB 22475bd8deadSopenharmony_ci 22485bd8deadSopenharmony_ci 2 16+4*count*4*4 rendering command length 22495bd8deadSopenharmony_ci 2 264 rendering command opcode 22505bd8deadSopenharmony_ci 4 INT32 location 22515bd8deadSopenharmony_ci 4 CARD32 count 22525bd8deadSopenharmony_ci 1 CARD8 transpose 22535bd8deadSopenharmony_ci 3 CARD8 unused 22545bd8deadSopenharmony_ci 4*count*4*4 LISTofFLOAT32 value 22555bd8deadSopenharmony_ci 22565bd8deadSopenharmony_ci If the command is encoded in a glXRenderLarge request, the 22575bd8deadSopenharmony_ci command opcode and command length fields above are expanded to 22585bd8deadSopenharmony_ci 4 bytes each: 22595bd8deadSopenharmony_ci 22605bd8deadSopenharmony_ci 4 20+4*count*4*4 rendering command length 22615bd8deadSopenharmony_ci 4 264 rendering command opcode 22625bd8deadSopenharmony_ci 22635bd8deadSopenharmony_ci 22645bd8deadSopenharmony_ci The following non-rendering commands are added. 22655bd8deadSopenharmony_ci 22665bd8deadSopenharmony_ci GetHandleARB 22675bd8deadSopenharmony_ci 22685bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 22695bd8deadSopenharmony_ci 1 167 GLX opcode 22705bd8deadSopenharmony_ci 2 3 request length 22715bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 22725bd8deadSopenharmony_ci 4 ENUM pname 22735bd8deadSopenharmony_ci => 22745bd8deadSopenharmony_ci 1 1 reply 22755bd8deadSopenharmony_ci 1 unused 22765bd8deadSopenharmony_ci 2 CARD16 sequence number 22775bd8deadSopenharmony_ci 4 0 reply length 22785bd8deadSopenharmony_ci 4 CARD32 return value 22795bd8deadSopenharmony_ci 20 unused 22805bd8deadSopenharmony_ci 22815bd8deadSopenharmony_ci CreateShaderObjectARB 22825bd8deadSopenharmony_ci 22835bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 22845bd8deadSopenharmony_ci 1 168 GLX opcode 22855bd8deadSopenharmony_ci 2 3 request length 22865bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 22875bd8deadSopenharmony_ci 4 ENUM shaderType 22885bd8deadSopenharmony_ci => 22895bd8deadSopenharmony_ci 1 1 reply 22905bd8deadSopenharmony_ci 1 unused 22915bd8deadSopenharmony_ci 2 CARD16 sequence number 22925bd8deadSopenharmony_ci 4 0 reply length 22935bd8deadSopenharmony_ci 4 CARD32 return value 22945bd8deadSopenharmony_ci 20 unused 22955bd8deadSopenharmony_ci 22965bd8deadSopenharmony_ci CreateProgramObjectARB 22975bd8deadSopenharmony_ci 22985bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 22995bd8deadSopenharmony_ci 1 169 GLX opcode 23005bd8deadSopenharmony_ci 2 2 request length 23015bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 23025bd8deadSopenharmony_ci => 23035bd8deadSopenharmony_ci 1 1 reply 23045bd8deadSopenharmony_ci 1 unused 23055bd8deadSopenharmony_ci 2 CARD16 sequence number 23065bd8deadSopenharmony_ci 4 0 reply length 23075bd8deadSopenharmony_ci 4 CARD32 return value 23085bd8deadSopenharmony_ci 20 unused 23095bd8deadSopenharmony_ci 23105bd8deadSopenharmony_ci GetObjectParameterfvARB 23115bd8deadSopenharmony_ci 23125bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 23135bd8deadSopenharmony_ci 1 170 GLX opcode 23145bd8deadSopenharmony_ci 2 4 request length 23155bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 23165bd8deadSopenharmony_ci 4 CARD32 obj 23175bd8deadSopenharmony_ci 4 ENUM pname 23185bd8deadSopenharmony_ci => 23195bd8deadSopenharmony_ci 1 1 reply 23205bd8deadSopenharmony_ci 1 unused 23215bd8deadSopenharmony_ci 1 CARD16 sequence number 23225bd8deadSopenharmony_ci 4 m reply length, m = ((n == 1) ? 0 : n) 23235bd8deadSopenharmony_ci 4 unused 23245bd8deadSopenharmony_ci 4 CARD32 n 23255bd8deadSopenharmony_ci 23265bd8deadSopenharmony_ci if (n = 1) this follows: 23275bd8deadSopenharmony_ci 23285bd8deadSopenharmony_ci 4 FLOAT32 params 23295bd8deadSopenharmony_ci 12 unused 23305bd8deadSopenharmony_ci 23315bd8deadSopenharmony_ci otherwise this follows: 23325bd8deadSopenharmony_ci 23335bd8deadSopenharmony_ci 16 unused 23345bd8deadSopenharmony_ci n*4 LISTofFLOAT32 params 23355bd8deadSopenharmony_ci 23365bd8deadSopenharmony_ci Note that n may be zero, indicating that a GL error occured. 23375bd8deadSopenharmony_ci 23385bd8deadSopenharmony_ci GetObjectParameterivARB 23395bd8deadSopenharmony_ci 23405bd8deadSopenharmony_ci 1 CARD8 opcode (X assigened) 23415bd8deadSopenharmony_ci 1 171 GLX opcode 23425bd8deadSopenharmony_ci 2 4 request length 23435bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 23445bd8deadSopenharmony_ci 4 CARD32 obj 23455bd8deadSopenharmony_ci 4 ENUM pname 23465bd8deadSopenharmony_ci => 23475bd8deadSopenharmony_ci 1 1 reply 23485bd8deadSopenharmony_ci 1 unused 23495bd8deadSopenharmony_ci 2 CARD16 sequence number 23505bd8deadSopenharmony_ci 4 m reply length, m = ((n == 1) ? 0 : n) 23515bd8deadSopenharmony_ci 4 unused 23525bd8deadSopenharmony_ci 4 CARD32 n 23535bd8deadSopenharmony_ci 23545bd8deadSopenharmony_ci if (n = 1) this follows: 23555bd8deadSopenharmony_ci 23565bd8deadSopenharmony_ci 4 INT32 params 23575bd8deadSopenharmony_ci 12 unused 23585bd8deadSopenharmony_ci 23595bd8deadSopenharmony_ci otherwise this follows: 23605bd8deadSopenharmony_ci 23615bd8deadSopenharmony_ci 16 unused 23625bd8deadSopenharmony_ci n*4 LISTofINT32 params 23635bd8deadSopenharmony_ci 23645bd8deadSopenharmony_ci Note that n may be zero, indicating that a GL error occured. 23655bd8deadSopenharmony_ci 23665bd8deadSopenharmony_ci GetInfoLogARB 23675bd8deadSopenharmony_ci 23685bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 23695bd8deadSopenharmony_ci 1 172 GLX opcode 23705bd8deadSopenharmony_ci 2 4 request length 23715bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 23725bd8deadSopenharmony_ci 4 CARD32 obj 23735bd8deadSopenharmony_ci 4 CARD32 maxLength 23745bd8deadSopenharmony_ci => 23755bd8deadSopenharmony_ci 1 1 reply 23765bd8deadSopenharmony_ci 1 unused 23775bd8deadSopenharmony_ci 2 CARD16 sequence number 23785bd8deadSopenharmony_ci 4 m reply length, m = (n+p)/4 23795bd8deadSopenharmony_ci 4 unused 23805bd8deadSopenharmony_ci 4 CARD32 n, as defined below. 23815bd8deadSopenharmony_ci 16 unused 23825bd8deadSopenharmony_ci n LISTofBYTE infoLog 23835bd8deadSopenharmony_ci p unused, p = pad(n) 23845bd8deadSopenharmony_ci 23855bd8deadSopenharmony_ci n is calculated on the server as strlen(<infoLog>) + 1 on success, or 23865bd8deadSopenharmony_ci 0 if there was an error retrieving the info log. If <length> is not 23875bd8deadSopenharmony_ci NULL, it is set to max(1, n) - 1. 23885bd8deadSopenharmony_ci 23895bd8deadSopenharmony_ci GetAttachedObjectsARB 23905bd8deadSopenharmony_ci 23915bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 23925bd8deadSopenharmony_ci 1 173 GLX opcode 23935bd8deadSopenharmony_ci 2 4 request length 23945bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 23955bd8deadSopenharmony_ci 4 CARD32 containerObj 23965bd8deadSopenharmony_ci 4 CARD32 maxCount 23975bd8deadSopenharmony_ci => 23985bd8deadSopenharmony_ci 1 1 reply 23995bd8deadSopenharmony_ci 1 unused 24005bd8deadSopenharmony_ci 2 CARD16 sequence number 24015bd8deadSopenharmony_ci 4 m reply length, m = (n == 1 ? 0 : n) 24025bd8deadSopenharmony_ci 4 unused 24035bd8deadSopenharmony_ci 4 CARD32 count, n = count 24045bd8deadSopenharmony_ci 24055bd8deadSopenharmony_ci if (n = 1) this follows: 24065bd8deadSopenharmony_ci 24075bd8deadSopenharmony_ci 4 CARD32 obj 24085bd8deadSopenharmony_ci 12 unused 24095bd8deadSopenharmony_ci 24105bd8deadSopenharmony_ci otherwise this follows: 24115bd8deadSopenharmony_ci 24125bd8deadSopenharmony_ci 16 unused 24135bd8deadSopenharmony_ci 4*n LISTofCARD32 obj 24145bd8deadSopenharmony_ci 24155bd8deadSopenharmony_ci Note that n may be zero, indicating that a GL error occured. 24165bd8deadSopenharmony_ci 24175bd8deadSopenharmony_ci GetUniformLocationARB 24185bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 24195bd8deadSopenharmony_ci 1 174 GLX opcode 24205bd8deadSopenharmony_ci 2 (12+n+p)/4 request length 24215bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 24225bd8deadSopenharmony_ci 4 CARD32 programObj 24235bd8deadSopenharmony_ci n LISTofBYTE name, n = strlen(name)+1 24245bd8deadSopenharmony_ci p unused, p = pad(n) 24255bd8deadSopenharmony_ci => 24265bd8deadSopenharmony_ci 1 1 reply 24275bd8deadSopenharmony_ci 1 unused 24285bd8deadSopenharmony_ci 2 CARD16 sequence number 24295bd8deadSopenharmony_ci 4 0 reply length 24305bd8deadSopenharmony_ci 4 CARD32 return value 24315bd8deadSopenharmony_ci 20 unused 24325bd8deadSopenharmony_ci 24335bd8deadSopenharmony_ci GetActiveUniformARB 24345bd8deadSopenharmony_ci 24355bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 24365bd8deadSopenharmony_ci 1 175 GLX opcode 24375bd8deadSopenharmony_ci 2 5 request length 24385bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 24395bd8deadSopenharmony_ci 4 CARD32 programObj 24405bd8deadSopenharmony_ci 4 CARD32 index 24415bd8deadSopenharmony_ci 4 CARD32 maxLength 24425bd8deadSopenharmony_ci => 24435bd8deadSopenharmony_ci 1 1 reply 24445bd8deadSopenharmony_ci 1 unused 24455bd8deadSopenharmony_ci 2 CARD16 sequence number 24465bd8deadSopenharmony_ci 4 m reply length, m = (n+p)/4 24475bd8deadSopenharmony_ci 4 unused 24485bd8deadSopenharmony_ci 4 CARD32 n, n = length+1 24495bd8deadSopenharmony_ci 4 CARD32 size 24505bd8deadSopenharmony_ci 4 ENUM type 24515bd8deadSopenharmony_ci 8 unused 24525bd8deadSopenharmony_ci n LISTofBYTE name 24535bd8deadSopenharmony_ci p unused , p = pad(n) 24545bd8deadSopenharmony_ci 24555bd8deadSopenharmony_ci n is calculated on the server as strlen(<name>) + 1 on success, or 0 24565bd8deadSopenharmony_ci if there was an error retrieving the active uniform's name. If 24575bd8deadSopenharmony_ci <length> is not NULL, it is set to max(1, n) - 1. 24585bd8deadSopenharmony_ci 24595bd8deadSopenharmony_ci GetUniformfvARB 24605bd8deadSopenharmony_ci 24615bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 24625bd8deadSopenharmony_ci 1 176 GLX opcode 24635bd8deadSopenharmony_ci 2 4 request length 24645bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context rag 24655bd8deadSopenharmony_ci 4 CARD32 programObj 24665bd8deadSopenharmony_ci 4 INT32 location 24675bd8deadSopenharmony_ci => 24685bd8deadSopenharmony_ci 1 1 reply 24695bd8deadSopenharmony_ci 1 unused 24705bd8deadSopenharmony_ci 2 CARD16 sequence number 24715bd8deadSopenharmony_ci 4 m reply length, m = ((n == 1) ? 0 : n) 24725bd8deadSopenharmony_ci 4 unused 24735bd8deadSopenharmony_ci 4 CARD32 n 24745bd8deadSopenharmony_ci 24755bd8deadSopenharmony_ci if (n = 1) this follows: 24765bd8deadSopenharmony_ci 24775bd8deadSopenharmony_ci 4 FLOAT32 params 24785bd8deadSopenharmony_ci 12 unused 24795bd8deadSopenharmony_ci 24805bd8deadSopenharmony_ci otherwise this follows: 24815bd8deadSopenharmony_ci 24825bd8deadSopenharmony_ci 16 unused 24835bd8deadSopenharmony_ci 4*n LISTofFLOAT32 params 24845bd8deadSopenharmony_ci 24855bd8deadSopenharmony_ci Note that n may be zero, indicating that a GL error occured. 24865bd8deadSopenharmony_ci 24875bd8deadSopenharmony_ci GetUniformivARB 24885bd8deadSopenharmony_ci 24895bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 24905bd8deadSopenharmony_ci 1 177 GLX opcode 24915bd8deadSopenharmony_ci 2 4 request length 24925bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context rag 24935bd8deadSopenharmony_ci 4 CARD32 programObj 24945bd8deadSopenharmony_ci 4 INT32 location 24955bd8deadSopenharmony_ci => 24965bd8deadSopenharmony_ci 1 1 reply 24975bd8deadSopenharmony_ci 1 unused 24985bd8deadSopenharmony_ci 2 CARD16 sequence number 24995bd8deadSopenharmony_ci 4 m reply length, m = ((n == 1) ? 0 : n) 25005bd8deadSopenharmony_ci 4 unused 25015bd8deadSopenharmony_ci 4 INT32 n 25025bd8deadSopenharmony_ci 25035bd8deadSopenharmony_ci if (n = 1) this follows: 25045bd8deadSopenharmony_ci 25055bd8deadSopenharmony_ci 4 INT32 params 25065bd8deadSopenharmony_ci 12 unused 25075bd8deadSopenharmony_ci 25085bd8deadSopenharmony_ci otherwise this follows: 25095bd8deadSopenharmony_ci 25105bd8deadSopenharmony_ci 16 unused 25115bd8deadSopenharmony_ci 4*n LISTofINT32 params 25125bd8deadSopenharmony_ci 25135bd8deadSopenharmony_ci Note that n may be zero, indicating that a GL error occured. 25145bd8deadSopenharmony_ci 25155bd8deadSopenharmony_ci GetShaderSourceARB 25165bd8deadSopenharmony_ci 25175bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 25185bd8deadSopenharmony_ci 1 178 GLX opcode 25195bd8deadSopenharmony_ci 2 4 request length 25205bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 25215bd8deadSopenharmony_ci 4 CARD32 obj 25225bd8deadSopenharmony_ci 4 CARD32 maxLength 25235bd8deadSopenharmony_ci => 25245bd8deadSopenharmony_ci 1 1 reply 25255bd8deadSopenharmony_ci 1 unused 25265bd8deadSopenharmony_ci 2 CARD16 sequence number 25275bd8deadSopenharmony_ci 4 m reply length, m = (n+p)/4 25285bd8deadSopenharmony_ci 4 unused 25295bd8deadSopenharmony_ci 4 CARD32 length 25305bd8deadSopenharmony_ci 16 unused 25315bd8deadSopenharmony_ci n LISTofBYTE source, n = length+1 25325bd8deadSopenharmony_ci p unused, p = pad(n) 25335bd8deadSopenharmony_ci 25345bd8deadSopenharmony_ci Note that n may be zero, indicating that a GL error occured. 25355bd8deadSopenharmony_ci 25365bd8deadSopenharmony_ciErrors 25375bd8deadSopenharmony_ci 25385bd8deadSopenharmony_ci The error INVALID_VALUE is generated by any command that takes one or 25395bd8deadSopenharmony_ci more handles as input, and one or more of these handles are not an 25405bd8deadSopenharmony_ci object handle generated by OpenGL. Note that this error is also set when 25415bd8deadSopenharmony_ci passing in the value 0 as a handle, except for UseProgramObjectARB and 25425bd8deadSopenharmony_ci DeleteObject. Passing in 0 to UseProgramObjectARB is valid, and ignored 25435bd8deadSopenharmony_ci by DeleteObject. 25445bd8deadSopenharmony_ci 25455bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by AttachObjectARB if <obj> is 25465bd8deadSopenharmony_ci not of type SHADER_OBJECT_ARB or if <containerObj> is not of type 25475bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB. 25485bd8deadSopenharmony_ci 25495bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by AttachObjectARB if <obj> is 25505bd8deadSopenharmony_ci already attached to <containerObj>. 25515bd8deadSopenharmony_ci 25525bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by DetachObjectARB if 25535bd8deadSopenharmony_ci <attachedObj> is not attached to <containerObj>. 25545bd8deadSopenharmony_ci 25555bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by DetachObjectARB if 25565bd8deadSopenharmony_ci <containerObj> is not of type PROGRAM_OBJECT_ARB. 25575bd8deadSopenharmony_ci 25585bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by ShaderSourceARB and 25595bd8deadSopenharmony_ci CompileShaderARB if <shaderObj> is not of type SHADER_OBJECT_ARB. 25605bd8deadSopenharmony_ci 25615bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by LinkProgramARB if 25625bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB. 25635bd8deadSopenharmony_ci 25645bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by UseProgramObjectARB if 25655bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB. 25665bd8deadSopenharmony_ci 25675bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by UseProgramObjectARB if 25685bd8deadSopenharmony_ci <programObj> could not be made part of the current state. 25695bd8deadSopenharmony_ci 25705bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetUniformLocationARB if 25715bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB or if <programObj> has 25725bd8deadSopenharmony_ci not been linked successfully. 25735bd8deadSopenharmony_ci 25745bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetActiveUniformARB if 25755bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB. 25765bd8deadSopenharmony_ci 25775bd8deadSopenharmony_ci The error INVALID_VALUE is generated by GetActiveUniformARB if <index> 25785bd8deadSopenharmony_ci is greater than or equal to OBJECT_ACTIVE_UNIFORMS_ARB. 25795bd8deadSopenharmony_ci 25805bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by the Uniform*ARB commands if 25815bd8deadSopenharmony_ci the size does not match the size of the uniform declared in the shader. 25825bd8deadSopenharmony_ci 25835bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by the Uniform*ARB commands if 25845bd8deadSopenharmony_ci the type does not match the type of the uniform declared in the shader, 25855bd8deadSopenharmony_ci if the uniform is not of type Boolean. 25865bd8deadSopenharmony_ci 25875bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by the Uniform*ARB commands if 25885bd8deadSopenharmony_ci <location> is not -1 and <location> does not exist for the program object 25895bd8deadSopenharmony_ci currently in use. 25905bd8deadSopenharmony_ci 25915bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by the Uniform*ARB commands if 25925bd8deadSopenharmony_ci there is no program object in use. 25935bd8deadSopenharmony_ci 25945bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if a uniform command other than 25955bd8deadSopenharmony_ci Uniform1i{v}ARB is used to load a sampler value. 25965bd8deadSopenharmony_ci 25975bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by ValidateProgramARB if 25985bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB. 25995bd8deadSopenharmony_ci 26005bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetObjectParameter{if}vARB 26015bd8deadSopenharmony_ci if <pname> is OBJECT_TYPE_ARB or OBJECT_DELETE_STATUS_ARB or 26025bd8deadSopenharmony_ci OBJECT_INFO_LOG_LENGTH_ARB and <obj> is not of type PROGRAM_OBJECT_ARB 26035bd8deadSopenharmony_ci or SHADER_OBJECT_ARB. 26045bd8deadSopenharmony_ci 26055bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetObjectParameter{if}vARB 26065bd8deadSopenharmony_ci if <pname> is OBJECT_LINK_STATUS_ARB or OBJECT_VALIDATE_STATUS_ARB or 26075bd8deadSopenharmony_ci OBJECT_ATTACHED_OBJECTS_ARB or OBJECT_ACTIVE_UNIFORMS_ARB or 26085bd8deadSopenharmony_ci OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB and <obj> is not of type 26095bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB. 26105bd8deadSopenharmony_ci 26115bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetObjectParameter{if}vARB 26125bd8deadSopenharmony_ci if <pname> is OBJECT_SUBTYPE_ARB or OBJECT_COMPILE_STATUS_ARB or 26135bd8deadSopenharmony_ci OBJECT_SHADER_SOURCE_LENGTH_ARB and <obj> is not of type 26145bd8deadSopenharmony_ci SHADER_OBJECT_ARB. 26155bd8deadSopenharmony_ci 26165bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetAttachedObjectsARB if 26175bd8deadSopenharmony_ci <containerObj> is not of type PROGRAM_OBJECT_ARB. 26185bd8deadSopenharmony_ci 26195bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetInfoLogARB if <obj> is 26205bd8deadSopenharmony_ci not of type SHADER_OBJECT_ARB or PROGRAM_OBJECT_ARB. 26215bd8deadSopenharmony_ci 26225bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetShaderSourceARB if <obj> 26235bd8deadSopenharmony_ci is not of type SHADER_OBJECT_ARB. 26245bd8deadSopenharmony_ci 26255bd8deadSopenharmony_ci The error INVALID_OPERATION is generated by GetUniform{if}vARB if 26265bd8deadSopenharmony_ci <programObj> is not of type PROGRAM_OBJECT_ARB or if <programObj> has 26275bd8deadSopenharmony_ci not been linked successfully or if <location> is not a valid location 26285bd8deadSopenharmony_ci for <programObj>. 26295bd8deadSopenharmony_ci 26305bd8deadSopenharmony_ci The error INVALID_OPERATION is generated if Begin, RasterPos, or any 26315bd8deadSopenharmony_ci command that performs an explicit Begin is called if: 26325bd8deadSopenharmony_ci 26335bd8deadSopenharmony_ci - One or more samplers of different types in the current program 26345bd8deadSopenharmony_ci object access the same texture image unit. 26355bd8deadSopenharmony_ci - More than the maximum allowable texture image units are accessed 26365bd8deadSopenharmony_ci based on the count of active samplers and the rest of the GL state 26375bd8deadSopenharmony_ci (note that LinkProgramARB can normally resolve this, except for the 26385bd8deadSopenharmony_ci case where an ARB_vertex_shader shader is mixed with an 26395bd8deadSopenharmony_ci ARB_fragment_program shader or mixed with fixed-function fragment 26405bd8deadSopenharmony_ci processing). 26415bd8deadSopenharmony_ci 26425bd8deadSopenharmony_ciNew State 26435bd8deadSopenharmony_ci 26445bd8deadSopenharmony_ci Initial 26455bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 26465bd8deadSopenharmony_ci --------- ---- ------------------------- ------- ----------- ---- --------- 26475bd8deadSopenharmony_ci PROGRAM_OBJECT_ARB H GetHandle 0 Handle of current 2.14.2 - 26485bd8deadSopenharmony_ci program object 26495bd8deadSopenharmony_ci 26505bd8deadSopenharmony_ci Table X. New state introduced. 26515bd8deadSopenharmony_ci 26525bd8deadSopenharmony_ci Initial 26535bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 26545bd8deadSopenharmony_ci --------- ----- ----------------------- ------------- ----------- ---- --------- 26555bd8deadSopenharmony_ci - H object specific object handle 2.14.1 - 26565bd8deadSopenharmony_ci - 0+xchar GetInfoLogARB "" Info log for shader 6.1.12 - 26575bd8deadSopenharmony_ci objects 26585bd8deadSopenharmony_ci - 0+xchar GetShaderSourceARB "" source for a shader 2.14.1 - 26595bd8deadSopenharmony_ci OBJECT_TYPE_ARB Z+ GetObjectParameterivARB SHADER_OBJECT Type of object 2.14.1 - 26605bd8deadSopenharmony_ci OBJECT_SUBTYPE_ARB Z+ GetObjectParameterivARB - Sub type of object 2.14.1 - 26615bd8deadSopenharmony_ci OBJECT_DELETE_STATUS_ARB B GetObjectParameterivARB FALSE Shader deleted 2.14 - 26625bd8deadSopenharmony_ci OBJECT_COMPILE_STATUS_ARB B GetObjectParameterivARB FALSE Compile succeeded 2.14.1 - 26635bd8deadSopenharmony_ci OBJECT_INFO_LOG_LENGTH_ARB Z+ GetObjectParameterivARB 0 Length of info log 6.1.12 - 26645bd8deadSopenharmony_ci OBJECT_SHADER_SOURCE_LENGTH_ARB Z+ GetObjectParameterivARB 0 Length of source code 6.1.12 - 26655bd8deadSopenharmony_ci 26665bd8deadSopenharmony_ci Table X Shader object state. 26675bd8deadSopenharmony_ci 26685bd8deadSopenharmony_ci Initial 26695bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. Attribute 26705bd8deadSopenharmony_ci --------- ----- ----------------------- ------------- ----------- ---- --------- 26715bd8deadSopenharmony_ci - 0+xZ+ GetActiveUniformARB - Size of active uniform 2.14.3 - 26725bd8deadSopenharmony_ci - 0+xZ+ GetActiveUniformARB - Type of active uniform 2.14.3 - 26735bd8deadSopenharmony_ci - 0+xcharARB GetActiveUniformARB "" Name of active uniform 2.14.3 - 26745bd8deadSopenharmony_ci - 0+xZ GetUniformLocationARB - Location of active uniform 2.14.3 - 26755bd8deadSopenharmony_ci - 0+xchar GetInfoLogARB "" Info log for program objects 6.1.12 - 26765bd8deadSopenharmony_ci OBJECT_ATTACHED_OBJECTS_ARB Z+ GetObjectParameterivARB 0 Number of attached objects 6.1.12 - 26775bd8deadSopenharmony_ci OBJECT_ACTIVE_UNIFORMS_ARB Z+ GetObjectParameterivARB 0 Number of active uniforms 2.14.3 - 26785bd8deadSopenharmony_ci OBJECT_DELETE_STATUS_ARB B GetObjectParameterivARB FALSE Program object deleted 2.14 - 26795bd8deadSopenharmony_ci OBJECT_LINK_STATUS_ARB B GetObjectParameterivARB FALSE Link succeeded 2.14.2 - 26805bd8deadSopenharmony_ci OBJECT_VALIDATE_STATUS_ARB B GetObjectParameterivARB FALSE Validate succeeded 2.15 - 26815bd8deadSopenharmony_ci OBJECT_INFO_LOG_LENGTH_ARB Z+ GetObjectParameterivARB 0 Length of info log 6.1.12 - 26825bd8deadSopenharmony_ci OBJECT_TYPE_ARB Z+ GetObjectParameterivARB PROGRAM_OBJECT Type of object 2.14.2 - 26835bd8deadSopenharmony_ci OBJECT_ACTIVE_UNIFORM_ 26845bd8deadSopenharmony_ci MAX_LENGTH_ARB Z+ GetObjectParameterivARB 0 Max uniform name length 6.1.12 - 26855bd8deadSopenharmony_ci - 0+xhandle GetAttachedObjectsARB empty list Shader objects attached 6.1.12 26865bd8deadSopenharmony_ci - H object specific object handle 2.14.2 - 26875bd8deadSopenharmony_ci 26885bd8deadSopenharmony_ci Table X Program object state. 26895bd8deadSopenharmony_ci 26905bd8deadSopenharmony_ciNew Implementation Dependent State 26915bd8deadSopenharmony_ci 26925bd8deadSopenharmony_ci None 26935bd8deadSopenharmony_ci 26945bd8deadSopenharmony_ciSample Usage 26955bd8deadSopenharmony_ci 26965bd8deadSopenharmony_ci For examples on how to use GetUniformLocationARB and the Uniform*ARB 26975bd8deadSopenharmony_ci API, see issue 32. 26985bd8deadSopenharmony_ci 26995bd8deadSopenharmony_ci // 27005bd8deadSopenharmony_ci // Example usage of GetActiveUniformARB. 27015bd8deadSopenharmony_ci // 27025bd8deadSopenharmony_ci GLint maxLength; 27035bd8deadSopenharmony_ci GLint i, uniformCount; 27045bd8deadSopenharmony_ci GLcharARB **name; 27055bd8deadSopenharmony_ci GLsizei *length; 27065bd8deadSopenharmony_ci GLint *size; 27075bd8deadSopenharmony_ci GLenum *type; 27085bd8deadSopenharmony_ci 27095bd8deadSopenharmony_ci // 27105bd8deadSopenharmony_ci // Get the number of uniforms, and the length of the longest name. 27115bd8deadSopenharmony_ci // 27125bd8deadSopenharmony_ci glGetObjectParameterivARB(programObject, 27135bd8deadSopenharmony_ci GL_OBJECTS_ACTIVE_UNIFORM_MAX_LENGTH_ARB, 27145bd8deadSopenharmony_ci &maxLength); 27155bd8deadSopenharmony_ci glGetObjectParameterivARB(programObject, GL_OBJECTS_ACTIVE_UNIFORMS_ARB, 27165bd8deadSopenharmony_ci &uniformCount); 27175bd8deadSopenharmony_ci 27185bd8deadSopenharmony_ci // 27195bd8deadSopenharmony_ci // Allocate arrays to store the answers in. For simplicity, the return 27205bd8deadSopenharmony_ci // from malloc is not checked for NULL. 27215bd8deadSopenharmony_ci // 27225bd8deadSopenharmony_ci size = (GLint *) malloc(uniformCount * sizeof(GLint)); 27235bd8deadSopenharmony_ci type = (GLint *) malloc(uniformCount * sizeof(GLenum)); 27245bd8deadSopenharmony_ci length = (GLsizei *) malloc(uniformCount * sizeof(GLsizei)); 27255bd8deadSopenharmony_ci name = (GLcharARB **) malloc(uniformCount * sizeof(GLcharARB **)); 27265bd8deadSopenharmony_ci 27275bd8deadSopenharmony_ci // 27285bd8deadSopenharmony_ci // Loop over glGetActiveUniformARB and store the results away. 27295bd8deadSopenharmony_ci // 27305bd8deadSopenharmony_ci for (i = 0; i < uniformCount; i++) { 27315bd8deadSopenharmony_ci name[i] = (GLcharARB *) malloc(maxLength * sizeof(GLcharARB)); 27325bd8deadSopenharmony_ci glGetActiveUniformARB(programObject, i, maxLength, &length[i], 27335bd8deadSopenharmony_ci &size[i], &type[i], name[i]); 27345bd8deadSopenharmony_ci } 27355bd8deadSopenharmony_ci 27365bd8deadSopenharmony_ci See the ARB_vertex_shader and ARB_fragment_shader extension documents 27375bd8deadSopenharmony_ci for more examples. 27385bd8deadSopenharmony_ci 27395bd8deadSopenharmony_ciRevision History 27405bd8deadSopenharmony_ci 27415bd8deadSopenharmony_ci Revision: 0.5 6/5/2002 27425bd8deadSopenharmony_ci - First draft for circulation 27435bd8deadSopenharmony_ci Revision: 0.51 27445bd8deadSopenharmony_ci - Started issues section. Added string discussions and uniform 27455bd8deadSopenharmony_ci discussions. 27465bd8deadSopenharmony_ci - Added content to the Contributors, and Errors section 27475bd8deadSopenharmony_ci - Named and explained all parameters to all API calls 27485bd8deadSopenharmony_ci - Added a new GLchar type 27495bd8deadSopenharmony_ci - Load/AppendShaderGL2 take a length argument 27505bd8deadSopenharmony_ci - GetUniformLocationGL2 takes a length argument for the string passed 27515bd8deadSopenharmony_ci in 27525bd8deadSopenharmony_ci - GetInfoLogGL2 now also optionally returns the length of the string 27535bd8deadSopenharmony_ci - Clarified DetachObjectGL2 and DeleteObject(s)GL2 and their 27545bd8deadSopenharmony_ci interaction 27555bd8deadSopenharmony_ci Revision 0.52 27565bd8deadSopenharmony_ci - Removed NULL_HANDLE_GL2 27575bd8deadSopenharmony_ci - Added explanation of what happens when program and shader objects 27585bd8deadSopenharmony_ci are shared among contexts. 27595bd8deadSopenharmony_ci Revision: 0.60 27605bd8deadSopenharmony_ci - Merged GL2_core_objects extension into this one. Core_objects is now 27615bd8deadSopenharmony_ci obsolete. 27625bd8deadSopenharmony_ci Revision: 0.61 27635bd8deadSopenharmony_ci - Took out any reference to 'project'. This term was unnecessary, 27645bd8deadSopenharmony_ci since it meant the same as program object. 27655bd8deadSopenharmony_ci Revision: 0.62 27665bd8deadSopenharmony_ci - Now references V1.0 of OpenGL Shading Language Specification 27675bd8deadSopenharmony_ci - Fixed minor typos 27685bd8deadSopenharmony_ci - Accepted by the GL2 working group 27695bd8deadSopenharmony_ci Revision: 0.63 10/17/2002 27705bd8deadSopenharmony_ci - Removed IsObjectGL2(). It overlaps with GetObjectParameter{if}vGL2. 27715bd8deadSopenharmony_ci - Expanded GetObjectParameter{if}GL2. Added OBJECT_TYPE_GL2. 27725bd8deadSopenharmony_ci Revision: 0.64 10/18/2002 27735bd8deadSopenharmony_ci - Added list of entrypoints that are not compiled into a display list 27745bd8deadSopenharmony_ci to section 5. 27755bd8deadSopenharmony_ci - Updated Errors section. 27765bd8deadSopenharmony_ci Revision: 0.65 10/23/2002 27775bd8deadSopenharmony_ci - Added GetShaderSourceGL2. 27785bd8deadSopenharmony_ci - Added GetUniform{if}vGL2 27795bd8deadSopenharmony_ci - Updated errors section. 27805bd8deadSopenharmony_ci - Moved shader resources section in here from GL2_vertex_shader. 27815bd8deadSopenharmony_ci Revision: 0.7 10/29/2002 27825bd8deadSopenharmony_ci - Added issue number 16. 27835bd8deadSopenharmony_ci - Second distribution to the GL2 working group. 27845bd8deadSopenharmony_ci - Now written against the OpenGL 1.4 specification. 27855bd8deadSopenharmony_ci Revision: 0.71 11/26/2002 27865bd8deadSopenharmony_ci - Added six more issues discussion uniform loading (issues 7-15). 27875bd8deadSopenharmony_ci - Added loadUniform commands to load values for INT and BOOL declared 27885bd8deadSopenharmony_ci uniforms. 27895bd8deadSopenharmony_ci - Changed the behavior for loadUniforms to allow to load the first N 27905bd8deadSopenharmony_ci values if loading into a uniform declared with an extent bigger than 27915bd8deadSopenharmony_ci N. 27925bd8deadSopenharmony_ci - Made a GLhandle an unsigned integer, read and written only by the GL 27935bd8deadSopenharmony_ci - Added high level shading language layering issue 22. This issue came 27945bd8deadSopenharmony_ci from the OpenGL Shading Language document. 27955bd8deadSopenharmony_ci - Updated resource limits issue number 21. 27965bd8deadSopenharmony_ci Revision: 0.72 01/27/2003 27975bd8deadSopenharmony_ci - Added issue 24. 27985bd8deadSopenharmony_ci - Added to the list of contributors. 27995bd8deadSopenharmony_ci - Changed the GLchar type to GLcharGL2 28005bd8deadSopenharmony_ci - Changed GLhandle type to GLhandleGL2 28015bd8deadSopenharmony_ci Revision: 0.73 02/20/2003 28025bd8deadSopenharmony_ci - Updated section 2.14.4. Loading uniforms of the wrong type will 28035bd8deadSopenharmony_ci result in undefined shader results. 28045bd8deadSopenharmony_ci - Loading more or less data than the declared extent of the uniform is 28055bd8deadSopenharmony_ci now handled consistently. 28065bd8deadSopenharmony_ci - Added section 2.14.4.1 'Samplers' 28075bd8deadSopenharmony_ci - Added an extra error condition for LinkProgramGL2 when using too 28085bd8deadSopenharmony_ci many active samplers. 28095bd8deadSopenharmony_ci - Added issue 25, explaining how to use samplers for texture access. 28105bd8deadSopenharmony_ci - Added issue 26, need for a validate command. 28115bd8deadSopenharmony_ci - Added section 2.15, Validation 28125bd8deadSopenharmony_ci Revision: 0.74 02/23/2003 28135bd8deadSopenharmony_ci - Added use of [] and . (dot) operators in GetUniformLocationGL2 28145bd8deadSopenharmony_ci - Refined wording in section 2.14.4.1. 28155bd8deadSopenharmony_ci Revision: 0.75 03/27/2003 28165bd8deadSopenharmony_ci - Begin can generate an error in certain cases. 28175bd8deadSopenharmony_ci - Closed issue 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 and made spec 28185bd8deadSopenharmony_ci changes, if necessary, to reflect the resolutions of these issues. 28195bd8deadSopenharmony_ci - Added issues 27, 28, 29, 30, 31. 28205bd8deadSopenharmony_ci - Changed the loadUniform API. Less entry points, aimed at performance 28215bd8deadSopenharmony_ci of loading uniforms. Also added a transpose flag to the matrix ones. 28225bd8deadSopenharmony_ci - Updated IP Status section to point to the contributors agreement. 28235bd8deadSopenharmony_ci - Removed ObjectParameter*GL2. These are not used anywhere. 28245bd8deadSopenharmony_ci - AttachObjectGL2 no longer returns a Boolean. There is no reason that 28255bd8deadSopenharmony_ci an attach should ever fail, if a valid program object and shader 28265bd8deadSopenharmony_ci object are passed in. 28275bd8deadSopenharmony_ci - Defined the lifetime of the pointers returned by GetInfoLogGL2 and 28285bd8deadSopenharmony_ci GetShaderSourceGL2. 28295bd8deadSopenharmony_ci - Added GetAttachedObjectsGL2. 28305bd8deadSopenharmony_ci Revision: 0.76 03/28/2003 28315bd8deadSopenharmony_ci - UseProgramObjectGL2 no longer returns anything. It can now be 28325bd8deadSopenharmony_ci compiled into a display list. 28335bd8deadSopenharmony_ci - Closed issues 14, 15, 30. 28345bd8deadSopenharmony_ci - Allowed loading more than one element in a uniform array, by just 28355bd8deadSopenharmony_ci querying the location of the first element to be loaded. 28365bd8deadSopenharmony_ci - Added the UNIFORM_ERROR_CHECK_GL2 enable. 28375bd8deadSopenharmony_ci - Changed GetInfoLogGL2 so that GL only has to maintain at least one 28385bd8deadSopenharmony_ci info log for shader objects and at least one for program objects. 28395bd8deadSopenharmony_ci - Added section 2.16, undefined behavior 28405bd8deadSopenharmony_ci Revision: 0.77 04/03/2003 28415bd8deadSopenharmony_ci - AppendShader now takes an array of strings, just like ShaderSource. 28425bd8deadSopenharmony_ci - GetShaderSources returns an array of strings. 28435bd8deadSopenharmony_ci - Closed issues 16, 17, 18, 19, 20. 28445bd8deadSopenharmony_ci Revision: 0.78 04/07/2003 28455bd8deadSopenharmony_ci - Closed issues 21, 22, 23, 24, 25, 26. 28465bd8deadSopenharmony_ci - Added lifetime to the pointer returned by ValidateProgram. Also 28475bd8deadSopenharmony_ci changed ValidateProgram to take a handle to a program object. 28485bd8deadSopenharmony_ci - LinkProgramGL2 will now set all uniforms to zero. 28495bd8deadSopenharmony_ci - Added GetShaderSourceGL2 example code. 28505bd8deadSopenharmony_ci Revision: 0.79 04/09/2003 28515bd8deadSopenharmony_ci - Added section 2.17, required state. 28525bd8deadSopenharmony_ci - Clarified GetInfoLog, especially when sharing objects across 28535bd8deadSopenharmony_ci contexts. 28545bd8deadSopenharmony_ci - Changed ValidateProgramGL2 to store its information in the info log. 28555bd8deadSopenharmony_ci It'll return a Boolean to indicate a successful validation. 28565bd8deadSopenharmony_ci - Clarified the use of the '.' And '[]' operators in 28575bd8deadSopenharmony_ci GetUniformLocation. 28585bd8deadSopenharmony_ci Revision: 0.80 04/17/2003 28595bd8deadSopenharmony_ci - Removed AppendShaderGL2. 28605bd8deadSopenharmony_ci - Closed issues 28, 29, 30 and 31. 28615bd8deadSopenharmony_ci - Clarified GetUniformLocationGL2 based on Folker's feedback. 28625bd8deadSopenharmony_ci - Added GetActiveUniformsGL2. 28635bd8deadSopenharmony_ci Revision: 0.81 04/18/2003 28645bd8deadSopenharmony_ci - GetUniformLocationGL2 only works for active uniforms now. 28655bd8deadSopenharmony_ci - Re-worded GetActiveUniformsGL2 to be more like GetActiveAttribsGL2. 28665bd8deadSopenharmony_ci - Added wording explicitly saying that a failed compile or link is not 28675bd8deadSopenharmony_ci state neutral (does not revert back to the old state). 28685bd8deadSopenharmony_ci - Added a sentence saying that the memory pointer returned by 28695bd8deadSopenharmony_ci GetActiveUniforms, GetInfoLog, GetAttachedObjects and 28705bd8deadSopenharmony_ci GetShaderSource is owned by OpenGL and should not be overwritten by 28715bd8deadSopenharmony_ci the caller. 28725bd8deadSopenharmony_ci Revision: 0.82 04/27/2003 28735bd8deadSopenharmony_ci - Forgot to close issue 27. 28745bd8deadSopenharmony_ci - Changed a few occurances of "char" to charGL2. 28755bd8deadSopenharmony_ci - Updated language describing GetUniformLocationGL2. 28765bd8deadSopenharmony_ci - Changed the location of the Contributors License to a publicly 28775bd8deadSopenharmony_ci accessible place on www.3dlabs.com. 28785bd8deadSopenharmony_ci - GetActiveUniformsGL2 is not display-listable. 28795bd8deadSopenharmony_ci - Removed one error condition for ValidateProgramGL2. 28805bd8deadSopenharmony_ci - Added errors for GetAttachedObjectsGL2. 28815bd8deadSopenharmony_ci - Renamed the following functions: 28825bd8deadSopenharmony_ci - glLoadShader --> glShaderSource 28835bd8deadSopenharmony_ci - glGetShaderString --> glGetShaderSource 28845bd8deadSopenharmony_ci - glAttachShaderObject --> glAttachObject 28855bd8deadSopenharmony_ci - glGetAttachedShaderObjects --> glGetAttachedObjects 28865bd8deadSopenharmony_ci - Clarified that GetActiveUniformsGL2 will return as much information 28875bd8deadSopenharmony_ci as possible. If it has none, it'll return a count of zero. 28885bd8deadSopenharmony_ci - Numerous clarifications and some reordering of paragraphs based on 28895bd8deadSopenharmony_ci Pat's feedback. 28905bd8deadSopenharmony_ci - Spelled out three reasons why LinkProgram can fail. 28915bd8deadSopenharmony_ci - Spelled out that the Uniform*GL2 command used needs to match both 28925bd8deadSopenharmony_ci the type and the size of a uniform declared in a shader. 28935bd8deadSopenharmony_ci - Updated the error checking rules for the Uniform*GL2 commands. 28945bd8deadSopenharmony_ci - Passing in '0', or a handle that is not an object handle generated 28955bd8deadSopenharmony_ci by the GL, results in the error INVALID_VALUE. All other calls that 28965bd8deadSopenharmony_ci get passed a valid handle, but that handle is of the wrong type for 28975bd8deadSopenharmony_ci that operation, set an INVALID_OPERATION error. 28985bd8deadSopenharmony_ci - Added issue 32, explaining GetUniformLocationGL2 and uniform 28995bd8deadSopenharmony_ci loading. 29005bd8deadSopenharmony_ci Revision: 0.83 04/28/2003 29015bd8deadSopenharmony_ci - Added more state tables. 29025bd8deadSopenharmony_ci - Added Kent Lin to the list of contributors. 29035bd8deadSopenharmony_ci Revision: 0.84 04/29/2003 29045bd8deadSopenharmony_ci - Added a few more examples to issue 32. 29055bd8deadSopenharmony_ci - Clarified the Errors section with respect to passing in 0 as a 29065bd8deadSopenharmony_ci handle. 29075bd8deadSopenharmony_ci - Version voted on, and approved, by the ARB-GL2 working group. 29085bd8deadSopenharmony_ci Revision: 0.85 05/09/2003 29095bd8deadSopenharmony_ci - Fixed a mistake in the program object state table for GetInfoLogGL2. 29105bd8deadSopenharmony_ci - Fixed a mistake in the resolution of issue 27. 29115bd8deadSopenharmony_ci - Clarified the resolution of issue 17. 29125bd8deadSopenharmony_ci - Clarified that in case of doubt by the compiler/linker, a uniform 29135bd8deadSopenharmony_ci will be marked as active. Section 2.14.3 (intro). 29145bd8deadSopenharmony_ci - Clarified that you need to pass in three NULL pointers to 29155bd8deadSopenharmony_ci GetActiveUniformsGL2, to only get the count of active uniforms. 29165bd8deadSopenharmony_ci - Clarified the lifetime of the pointers returned by 29175bd8deadSopenharmony_ci GetActiveUniformsGL2, GetShaderSourceGL2 and GetAttachedObjectsGL2. 29185bd8deadSopenharmony_ci - Fixed a typo in the first entry in the Errors section. 29195bd8deadSopenharmony_ci - Changed the count parameter in the Uniform*vGL2 commands to be of 29205bd8deadSopenharmony_ci type sizei. Also did this for ShaderSourceGL2. 29215bd8deadSopenharmony_ci - Expanded the two paragraphs explaining how Uniform*GL2 works into 29225bd8deadSopenharmony_ci several smaller ones. 29235bd8deadSopenharmony_ci - Clarified that GetInfoLogGL2 returns NULL if the handle passed in is 29245bd8deadSopenharmony_ci invalid, or not a program or shader object. 29255bd8deadSopenharmony_ci - Added fourth implicit error rule to section 2.5, GL Errors. Note 29265bd8deadSopenharmony_ci that this rule was already in the Errors section. 29275bd8deadSopenharmony_ci - Added Jon Leech, Evan Hart, Benjamin Lipchak and Jeremy Sandmel to 29285bd8deadSopenharmony_ci the list of contributors. 29295bd8deadSopenharmony_ci - Assigned enum values. 29305bd8deadSopenharmony_ci Revision: 0.86 05/15/2003 29315bd8deadSopenharmony_ci - Assigned missing enum value to SHADER_OBJECT_GL2. 29325bd8deadSopenharmony_ci - Replaced all GL2 occurrences with ARB. Fixed some typos. 29335bd8deadSopenharmony_ci - Added several more to the contributors list. If anyone is still left 29345bd8deadSopenharmony_ci out, let Bill Licea Kane, Jon Leech or myself know. 29355bd8deadSopenharmony_ci Revision: 0.87 06/13/2003 29365bd8deadSopenharmony_ci - Changed resolution of issue 27 and the description of GetInfoLog to 29375bd8deadSopenharmony_ci have an info log per object. Removed the info log language from the 29385bd8deadSopenharmony_ci AGL/GLX/WGL section. 29395bd8deadSopenharmony_ci - Changed the resolution of issue 14, 15, 25 (uniform API name). 29405bd8deadSopenharmony_ci - Changed the discussion and resolution of issue 30. (uniform 29415bd8deadSopenharmony_ci loading). 29425bd8deadSopenharmony_ci - Added issue 33. 29435bd8deadSopenharmony_ci - Changed the uniform API commands. The type of the uniform is no 29445bd8deadSopenharmony_ci longer encoded in the name of the API. 29455bd8deadSopenharmony_ci - Updated section 2.14.4, samplers. 29465bd8deadSopenharmony_ci - Updated the Errors section w.r.t. uniform loading 29475bd8deadSopenharmony_ci - Updated section 2.16, undefined behavior. 29485bd8deadSopenharmony_ci - Deleted DeleteObjectsARB. 29495bd8deadSopenharmony_ci - Removed the Boolean return from CompileShaderARB, LinkProgramARB and 29505bd8deadSopenharmony_ci ValidateProgramARB. 29515bd8deadSopenharmony_ci - Added several new error conditions for GetObjectParameter{if}vARB to 29525bd8deadSopenharmony_ci the Errors section an section 6.1.12. 29535bd8deadSopenharmony_ci - Updated the New State and Required State sections. 29545bd8deadSopenharmony_ci - Changed GetInfoLog to no longer return a pointer to GL memory. 29555bd8deadSopenharmony_ci - Changed GetAttachedObjects to no longer return a pointer to GL 29565bd8deadSopenharmony_ci memory. 29575bd8deadSopenharmony_ci - Changed GetActiveUniform to no longer return a pointer to GL memory. 29585bd8deadSopenharmony_ci This call now returns data for one active uniform, instead of all 29595bd8deadSopenharmony_ci active uniforms. Also added its returns (type, size and name) to the 29605bd8deadSopenharmony_ci state tables and Required State section. 29615bd8deadSopenharmony_ci - Changed GetShaderSource to no longer return a pointer to GL memory. 29625bd8deadSopenharmony_ci - Added OBJECT_SUBTYPE_ARB, OBJECT_DELETE_STATUS_ARB, 29635bd8deadSopenharmony_ci OBJECT_COMPILE_STATUS_ARB, OBJECT_LINK_STATUS_ARB, 29645bd8deadSopenharmony_ci OBJECT_VALIDATE_STATUS_ARB, OBJECT_INFO_LOG_LENGTH_ARB, 29655bd8deadSopenharmony_ci OBJECT_ATTACHED_OBJECTS_ARB, OBJECT_ACTIVE_UNIFORMS_ARB, 29665bd8deadSopenharmony_ci OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB, 29675bd8deadSopenharmony_ci OBJECT_SHADER_SOURCE_LENGTH_ARB as a queriable parameter to 29685bd8deadSopenharmony_ci GetObjectParameter{if}vARB. 29695bd8deadSopenharmony_ci - Modified the introduction to section 2.14 to mention texture and 29705bd8deadSopenharmony_ci display list objects. 29715bd8deadSopenharmony_ci - Added issue 34. 29725bd8deadSopenharmony_ci - Updated the example section with a new example. 29735bd8deadSopenharmony_ci - Re-ordered the Errors section. They are now in the order of API 29745bd8deadSopenharmony_ci calls described in Sections 2-6. 29755bd8deadSopenharmony_ci - Language clean-up throughout the document. 29765bd8deadSopenharmony_ci - Consistently used "OpenGL Shading Language" where appropriate (This 29775bd8deadSopenharmony_ci is the official name). 29785bd8deadSopenharmony_ci - Changed issue 5. This issue is now obsolete, with the new GetInfoLog 29795bd8deadSopenharmony_ci API. 29805bd8deadSopenharmony_ci - Clarified section 2.14.4, Samplers. The values to load range from 0 29815bd8deadSopenharmony_ci to to max available texture image units. 29825bd8deadSopenharmony_ci - ARB approved version. 29835bd8deadSopenharmony_ci Revision: 0.88 03/29/2004 29845bd8deadSopenharmony_ci - Added ARB extension number (31) and edited the status paragraph. 29855bd8deadSopenharmony_ci - GetActiveUniform now returns types for samplers. 29865bd8deadSopenharmony_ci - If at least one element in a uniform array is active, then this 29875bd8deadSopenharmony_ci array will be reported by GetActiveUniform as being active starting 29885bd8deadSopenharmony_ci at element 0 through the highest element used. Added issue 35 29895bd8deadSopenharmony_ci explaining this in detail. 29905bd8deadSopenharmony_ci - Passing in a location of -1 to Uniform*ARB will be silently ignored 29915bd8deadSopenharmony_ci (no GL error will be generated). Also added issue 36 explaining 29925bd8deadSopenharmony_ci this. 29935bd8deadSopenharmony_ci - DeleteObject will silently ignore the value 0. Added issue 37. 29945bd8deadSopenharmony_ci - The current program object handle is no longer part of the 'current' 29955bd8deadSopenharmony_ci state. 29965bd8deadSopenharmony_ci - Specified that GetUniform returns values in column major order for 29975bd8deadSopenharmony_ci matrices. Also clarified that GetUniform returns only one element of 29985bd8deadSopenharmony_ci an array of uniforms. Added issue 38. 29995bd8deadSopenharmony_ci - Specified what happens when ValidateProgramARB fails. This means 30005bd8deadSopenharmony_ci that the program object will not execute, and no fragments will be 30015bd8deadSopenharmony_ci rendered. 30025bd8deadSopenharmony_ci - Added 'const' to the data passed in the Uniform*vARB commands. 30035bd8deadSopenharmony_ci - Clarified that return parameters of the various Get commands are 30045bd8deadSopenharmony_ci unmodified if an error occurred. 30055bd8deadSopenharmony_ci - Added issue 39. 30065bd8deadSopenharmony_ci - Added issue 40, and clarified failed re-link behavior in the spec. 30075bd8deadSopenharmony_ci - Added issue 41. 30085bd8deadSopenharmony_ci - Clarified that the compile status of a shader object does not change 30095bd8deadSopenharmony_ci when source is loaded in it. 30105bd8deadSopenharmony_ci - Clarified that the link status of a program object is not affected 30115bd8deadSopenharmony_ci by attaching or detaching or re-compiling attached shader objects. 30125bd8deadSopenharmony_ci - Few fixes to the Errors section. 30135bd8deadSopenharmony_ci - Clarified GetUniformLocation and GetActiveUniform when addressing 30145bd8deadSopenharmony_ci the first element of an array. Added issue 42 explaining this. 30155bd8deadSopenharmony_ci - Added issue 43, 44 and 45. 30165bd8deadSopenharmony_ci Revision: 0.89 04/06/2004 30175bd8deadSopenharmony_ci - Updated the Shading Language Version referenced to the now official 30185bd8deadSopenharmony_ci version 1.10. 30195bd8deadSopenharmony_ci - Added language describing the Uniform* loading commands that 30205bd8deadSopenharmony_ci Uniform1i{v} is used to load samplers. 30215bd8deadSopenharmony_ci - Clarified issues 36, 42 and 43 based on Pat's feedback. 30225bd8deadSopenharmony_ci - Changed the examples in issue 45 a bit. Hopefully for the better. 30235bd8deadSopenharmony_ci - Added issue 46. 30245bd8deadSopenharmony_ci - Removed an error condition I had added earlier for glBegin(). 30255bd8deadSopenharmony_ci - Expanded section 2.15 to include the exact conditions when 30265bd8deadSopenharmony_ci validation is allowed to fail. Previously these conditions were only 30275bd8deadSopenharmony_ci in the Errors section, listed for glBegin(). 30285bd8deadSopenharmony_ci - ARB-GL2 workgroup approved version. 30295bd8deadSopenharmony_ci Revision: 0.90 12/14/2009 30305bd8deadSopenharmony_ci - Added GLX protocol 30315bd8deadSopenharmony_ci 3032