15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_vertex_shader 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_vertex_shader 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Benj Lipchak, AMD (benj.lipchak 'at' amd.com) 125bd8deadSopenharmony_ci Evan Hart, NVIDIA (ehart 'at' nvidia.com) 135bd8deadSopenharmony_ci Dave Gosselin 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ciVersion 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ci Date: 11/04/2006 185bd8deadSopenharmony_ci Revision: 1.01 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ciNumber 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ci 248 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ciDependencies 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci This spec is written against the 1.2.1 version of the GL spec. 275bd8deadSopenharmony_ci 285bd8deadSopenharmony_ci ARB_imaging affects the definition of this spec. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ciOverview 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ci EXT_vertex_shader adds a flexible way to change the per-vertex 335bd8deadSopenharmony_ci processing in the GL pipeline. It provides a method to replace 345bd8deadSopenharmony_ci the fixed vertex/normal transform and lighting with a user 355bd8deadSopenharmony_ci specified means of generating processed vertices, texture 365bd8deadSopenharmony_ci coordinates, color, and secondary color, along with a primitive's 375bd8deadSopenharmony_ci associated state. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciIssues 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci How should the user be told that their shader doesn't fit and/or 425bd8deadSopenharmony_ci won't run well with the hardware? Some kind of GetError() value or 435bd8deadSopenharmony_ci a return value from EndShader()? 445bd8deadSopenharmony_ci 455bd8deadSopenharmony_ci This is accomplished using GetIntegerv, GetFloatv, and 465bd8deadSopenharmony_ci GetDoubleV to return a maximum value for Instructions, 475bd8deadSopenharmony_ci constants, and volatiles as well as returned the numbers 485bd8deadSopenharmony_ci of these resources consumed by the current shader. 495bd8deadSopenharmony_ci 505bd8deadSopenharmony_ci Is lighting or texture coordinate generation performed when a user 515bd8deadSopenharmony_ci defined vertex shader is enabled. 525bd8deadSopenharmony_ci 535bd8deadSopenharmony_ci No. The shader writer is responsible for generating any 545bd8deadSopenharmony_ci texture coordinates and color values. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci Should we have separate per-vertex calls for SetDataEXT? 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci Yes. Changed to SetVariant and SetShaderState. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci Should SwizzleEXT and WriteMaskEXT be an op-code or possibly 615bd8deadSopenharmony_ci combined into a new API call that takes enums? 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci No, they are different enough to have their own entry point. 645bd8deadSopenharmony_ci 655bd8deadSopenharmony_ci Does there need to be a call to get the size of a potentially 665bd8deadSopenharmony_ci optimized shader, potentially using some kind of proxy 675bd8deadSopenharmony_ci mechanism? 685bd8deadSopenharmony_ci 695bd8deadSopenharmony_ci The implementation dependent state values seem to provide 705bd8deadSopenharmony_ci enough info. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci Should more GL state be available for use by the shader (e.g. 735bd8deadSopenharmony_ci enable/disable states for lights)? 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci No, enough flexibility is already provided. 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci Should we give the opcode enumerants data type names or leave them 785bd8deadSopenharmony_ci generic? 795bd8deadSopenharmony_ci 805bd8deadSopenharmony_ci This presents an interesting question in that the 815bd8deadSopenharmony_ci trade off is a more simple, concise interface for more 825bd8deadSopenharmony_ci difficult validation on the part of the implementation. 835bd8deadSopenharmony_ci 845bd8deadSopenharmony_ci How should client-defined clip planes be handled? 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci Client clip-planes should be applied in the output coordinate 875bd8deadSopenharmony_ci frame. When a vertex shader is invoked, the eye-space 885bd8deadSopenharmony_ci clipping planes are transformed by the current projection 895bd8deadSopenharmony_ci matrix and are applied after the primitive is assembled from 905bd8deadSopenharmony_ci the transformed vertices. 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci What are better names for GenData/SetData? 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci These are misleading, and they should be changed. The primary 955bd8deadSopenharmony_ci hurdle is devising a better set of names. 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci RESOLVED: New names implemented 985bd8deadSopenharmony_ci 995bd8deadSopenharmony_ci Should the *Transform* calls be replaced with a different moniker? 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci Possibly, the term transform is somewhat narrow for the 1025bd8deadSopenharmony_ci functionality. The term shader has been suggested. It seems 1035bd8deadSopenharmony_ci like a good choice as it fits with the RenderMan style 1045bd8deadSopenharmony_ci terminology already in use. 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci RESOLVED: Shader will be used. 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci How should RasterPos be affected by this extension? 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci It is probably confusing to have RasterPos affected by 1115bd8deadSopenharmony_ci this extension, so it should be disallowed. 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci How should the arrays/indexing be handled? 1145bd8deadSopenharmony_ci 1155bd8deadSopenharmony_ci The index operation should be more strictly defined 1165bd8deadSopenharmony_ci to only operate on contiguous name sets allocated by a 1175bd8deadSopenharmony_ci single GenSymbols call. Alternatively, it may be useful to 1185bd8deadSopenharmony_ci enforce that data to be used as arrays be given a special 1195bd8deadSopenharmony_ci designation. 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci Should color-index mode be included? 1225bd8deadSopenharmony_ci 1235bd8deadSopenharmony_ci No, all computations are supported for RGB only. 1245bd8deadSopenharmony_ci 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci 1275bd8deadSopenharmony_ciNew Procedure and Functions 1285bd8deadSopenharmony_ci 1295bd8deadSopenharmony_ci void BeginVertexShaderEXT( void ) 1305bd8deadSopenharmony_ci void EndVertexShaderEXT( void ) 1315bd8deadSopenharmony_ci void BindVertexShaderEXT( GLuint id ) 1325bd8deadSopenharmony_ci uint GenVertexShadersEXT( GLuint range ) 1335bd8deadSopenharmony_ci void DeleteVertexShaderEXT( GLuint id ) 1345bd8deadSopenharmony_ci void ShaderOp1EXT( enum op, uint res, uint arg1 ) 1355bd8deadSopenharmony_ci void ShaderOp2EXT( enum op, uint res, uint arg1, uint arg2 ) 1365bd8deadSopenharmony_ci void ShaderOp3EXT( enum op, uint res, uint arg1, uint arg2, uint arg3 ) 1375bd8deadSopenharmony_ci void SwizzleEXT( uint res, uint in, enum outX, enum outY, enum outZ, 1385bd8deadSopenharmony_ci enum outW ) 1395bd8deadSopenharmony_ci void WriteMaskEXT( uint res, uint in, enum outX, enum outY, enum outZ 1405bd8deadSopenharmony_ci enum outW ) 1415bd8deadSopenharmony_ci void InsertComponentEXT( uint res, uint src, uint num ) 1425bd8deadSopenharmony_ci void ExtractComponentEXT( uint res, uint src, uint num ) 1435bd8deadSopenharmony_ci uint GenSymbolsEXT( enum datatype, enum storagetype, enum range, 1445bd8deadSopenharmony_ci uint components ) 1455bd8deadSopenharmony_ci void SetInvariantEXT( uint id, enum type, void *addr ) 1465bd8deadSopenharmony_ci void SetLocalConstantEXT( uint id, enum type, void *addr ) 1475bd8deadSopenharmony_ci void Variant{bsifd ubusui}vEXT( uint id, T *addr ) 1485bd8deadSopenharmony_ci void VariantPointerEXT( uint id, enum type, uint stride, void *addr ) 1495bd8deadSopenharmony_ci void EnableVariantClientStateEXT( uint id) 1505bd8deadSopenharmony_ci void DisableVariantClientStateEXT( uint id) 1515bd8deadSopenharmony_ci uint BindLightParameterEXT( enum light, enum value) 1525bd8deadSopenharmony_ci uint BindMaterialParameterEXT( enum face, enum value) 1535bd8deadSopenharmony_ci uint BindTexGenParameterEXT( enum unit, enum coord, enum value) 1545bd8deadSopenharmony_ci uint BindTextureUnitParameterEXT( enum unit, enum value) 1555bd8deadSopenharmony_ci uint BindParameterEXT( enum value) 1565bd8deadSopenharmony_ci boolean IsVariantEnabledEXT( uint id, enum cap); 1575bd8deadSopenharmony_ci void GetVariantBooleanvEXT( uint id, enum value, boolean *data); 1585bd8deadSopenharmony_ci void GetVariantIntegervEXT( uint id, enum value, int *data); 1595bd8deadSopenharmony_ci void GetVariantFloatvEXT( uint id, enum value, float *data); 1605bd8deadSopenharmony_ci void GetVariantPointervEXT( uint id, enum value, void **data); 1615bd8deadSopenharmony_ci void GetInvariantBooleanvEXT( uint id, enum value, boolean *data); 1625bd8deadSopenharmony_ci void GetInvariantIntegervEXT( uint id, enum value, int *data); 1635bd8deadSopenharmony_ci void GetInvariantFloatvEXT( uint id, enum value, float *data); 1645bd8deadSopenharmony_ci void GetLocalConstantBooleanvEXT( uint id, enum value, boolean *data); 1655bd8deadSopenharmony_ci void GetLocalConstantIntegervEXT( uint id, enum value, int *data); 1665bd8deadSopenharmony_ci void GetLocalConstantFloatvEXT( uint id, enum value, float *data); 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ciNew Tokens 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci Accepted by the <cap> parameter of Enable, Disable, and IsEnabled, 1715bd8deadSopenharmony_ci and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, 1725bd8deadSopenharmony_ci and GetDoublev: 1735bd8deadSopenharmony_ci 1745bd8deadSopenharmony_ci VERTEX_SHADER_EXT 0x8780 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci Accepted by the <value> parameter of GetVariantBooleanv, GetVariantIntegerv, 1775bd8deadSopenharmony_ci and GetVariantFloatv: 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci VARIANT_VALUE_EXT 0x87E4 1805bd8deadSopenharmony_ci VARIANT_DATATYPE_EXT 0x87E5 1815bd8deadSopenharmony_ci VARIANT_ARRAY_STRIDE_EXT 0x87E6 1825bd8deadSopenharmony_ci VARIANT_ARRAY_TYPE_EXT 0x87E7 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci Accepted by the <cap> parameter of IsVariantEnabled: 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci VARIANT_ARRAY_EXT 0x87E8 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetVariantPointerv: 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ci VARIANT_ARRAY_POINTER_EXT 0x87E9 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci Accepted by the <value> parameter of GetInvariantBooleanv, 1935bd8deadSopenharmony_ci GetInvariantIntegerv, and GetInvariantFloatv: 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci INVARIANT_VALUE_EXT 0x87EA 1965bd8deadSopenharmony_ci INVARIANT_DATATYPE_EXT 0x87EB 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ci Accepted by the <value> parameter of GetLocalConstantBooleanv, 1995bd8deadSopenharmony_ci GetLocalConstantIntegerv, and GetLocalConstantFloatv: 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci LOCAL_CONSTANT_VALUE_EXT 0x87EC 2025bd8deadSopenharmony_ci LOCAL_CONSTANT_DATATYPE_EXT 0x87ED 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ci Accepted by the <op> parameter of ShaderOp[1..3]EXT: 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci OP_INDEX_EXT 0x8782 2075bd8deadSopenharmony_ci OP_NEGATE_EXT 0x8783 2085bd8deadSopenharmony_ci OP_DOT3_EXT 0x8784 2095bd8deadSopenharmony_ci OP_DOT4_EXT 0x8785 2105bd8deadSopenharmony_ci OP_MUL_EXT 0x8786 2115bd8deadSopenharmony_ci OP_ADD_EXT 0x8787 2125bd8deadSopenharmony_ci OP_MADD_EXT 0x8788 2135bd8deadSopenharmony_ci OP_FRAC_EXT 0x8789 2145bd8deadSopenharmony_ci OP_MAX_EXT 0x878A 2155bd8deadSopenharmony_ci OP_MIN_EXT 0x878B 2165bd8deadSopenharmony_ci OP_SET_GE_EXT 0x878C 2175bd8deadSopenharmony_ci OP_SET_LT_EXT 0x878D 2185bd8deadSopenharmony_ci OP_CLAMP_EXT 0x878E 2195bd8deadSopenharmony_ci OP_FLOOR_EXT 0x878F 2205bd8deadSopenharmony_ci OP_ROUND_EXT 0x8790 2215bd8deadSopenharmony_ci OP_EXP_BASE_2_EXT 0x8791 2225bd8deadSopenharmony_ci OP_LOG_BASE_2_EXT 0x8792 2235bd8deadSopenharmony_ci OP_POWER_EXT 0x8793 2245bd8deadSopenharmony_ci OP_RECIP_EXT 0x8794 2255bd8deadSopenharmony_ci OP_RECIP_SQRT_EXT 0x8795 2265bd8deadSopenharmony_ci OP_SUB_EXT 0x8796 2275bd8deadSopenharmony_ci OP_CROSS_PRODUCT_EXT 0x8797 2285bd8deadSopenharmony_ci OP_MULTIPLY_MATRIX_EXT 0x8798 2295bd8deadSopenharmony_ci OP_MOV_EXT 0x8799 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ci Accepted by the <res> parameter of ShaderOp[1..3]EXT, the <res> 2325bd8deadSopenharmony_ci parameter of WriteMaskEXT, or the <res> parameter of SwizzleEXT: 2335bd8deadSopenharmony_ci 2345bd8deadSopenharmony_ci OUTPUT_VERTEX_EXT 0x879A 2355bd8deadSopenharmony_ci OUTPUT_COLOR0_EXT 0x879B 2365bd8deadSopenharmony_ci OUTPUT_COLOR1_EXT 0x879C 2375bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD0_EXT 0x879D 2385bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD1_EXT 0x879E 2395bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD2_EXT 0x879F 2405bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD3_EXT 0x87A0 2415bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD4_EXT 0x87A1 2425bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD5_EXT 0x87A2 2435bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD6_EXT 0x87A3 2445bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD7_EXT 0x87A4 2455bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD8_EXT 0x87A5 2465bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD9_EXT 0x87A6 2475bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD10_EXT 0x87A7 2485bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD11_EXT 0x87A8 2495bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD12_EXT 0x87A9 2505bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD13_EXT 0x87AA 2515bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD14_EXT 0x87AB 2525bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD15_EXT 0x87AC 2535bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD16_EXT 0x87AD 2545bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD17_EXT 0x87AE 2555bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD18_EXT 0x87AF 2565bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD19_EXT 0x87B0 2575bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD20_EXT 0x87B1 2585bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD21_EXT 0x87B2 2595bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD22_EXT 0x87B3 2605bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD23_EXT 0x87B4 2615bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD24_EXT 0x87B5 2625bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD25_EXT 0x87B6 2635bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD26_EXT 0x87B7 2645bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD27_EXT 0x87B8 2655bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD28_EXT 0x87B9 2665bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD29_EXT 0x87BA 2675bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD30_EXT 0x87BB 2685bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD31_EXT 0x87BC 2695bd8deadSopenharmony_ci OUTPUT_FOG_EXT 0x87BD 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci Accepted by the <datatype> parameter of GenSymbolsEXT: 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci SCALAR_EXT 0x87BE 2745bd8deadSopenharmony_ci VECTOR_EXT 0x87BF 2755bd8deadSopenharmony_ci MATRIX_EXT 0x87C0 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci Accepted by the <storagetype> parameter of GenSymbolsEXT: 2785bd8deadSopenharmony_ci 2795bd8deadSopenharmony_ci VARIANT_EXT 0x87C1 2805bd8deadSopenharmony_ci INVARIANT_EXT 0x87C2 2815bd8deadSopenharmony_ci LOCAL_CONSTANT_EXT 0x87C3 2825bd8deadSopenharmony_ci LOCAL_EXT 0x87C4 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ci Accepted by the <pname> parameters of GetIntegerv, GetFloatv, and 2855bd8deadSopenharmony_ci GetDoublev: 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 2885bd8deadSopenharmony_ci MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 2895bd8deadSopenharmony_ci MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 2905bd8deadSopenharmony_ci MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 2915bd8deadSopenharmony_ci MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 2925bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA 2935bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB 2945bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC 2955bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_INARIANTS_EXT 0x87CD 2965bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE 2975bd8deadSopenharmony_ci VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF 2985bd8deadSopenharmony_ci VERTEX_SHADER_VARIANTS_EXT 0x87D0 2995bd8deadSopenharmony_ci VERTEX_SHADER_INVARIANTS_EXT 0x87D1 3005bd8deadSopenharmony_ci VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 3015bd8deadSopenharmony_ci VERTEX_SHADER_LOCALS_EXT 0x87D3 3025bd8deadSopenharmony_ci VERTEX_SHADER_BINDING_EXT 0x8781 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci Accepted by the <pname> parameters of GetBooleanv: 3055bd8deadSopenharmony_ci 3065bd8deadSopenharmony_ci VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci Accepted by the <out[XYZW]> parameters of SwizzleEXT: 3095bd8deadSopenharmony_ci 3105bd8deadSopenharmony_ci X_EXT 0x87D5 3115bd8deadSopenharmony_ci Y_EXT 0x87D6 3125bd8deadSopenharmony_ci Z_EXT 0x87D7 3135bd8deadSopenharmony_ci W_EXT 0x87D8 3145bd8deadSopenharmony_ci NEGATIVE_X_EXT 0x87D9 3155bd8deadSopenharmony_ci NEGATIVE_Y_EXT 0x87DA 3165bd8deadSopenharmony_ci NEGATIVE_Z_EXT 0x87DB 3175bd8deadSopenharmony_ci NEGATIVE_W_EXT 0x87DC 3185bd8deadSopenharmony_ci ZERO_EXT 0x87dd 3195bd8deadSopenharmony_ci ONE_EXT 0x87de 3205bd8deadSopenharmony_ci NEGATIVE_ONE_EXT 0x87DF 3215bd8deadSopenharmony_ci 3225bd8deadSopenharmony_ci Accepted by the <range> parameter of GenSymbolsEXT: 3235bd8deadSopenharmony_ci 3245bd8deadSopenharmony_ci NORMALIZED_RANGE_EXT 0x87E0 3255bd8deadSopenharmony_ci FULL_RANGE_EXT 0x87E1 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci Accepted by the <value> parameter of BindParameterEXT: 3285bd8deadSopenharmony_ci 3295bd8deadSopenharmony_ci CURRENT_VERTEX_EXT 0x87E2 3305bd8deadSopenharmony_ci MVP_MATRIX_EXT 0x87E3 3315bd8deadSopenharmony_ci 3325bd8deadSopenharmony_ci 3335bd8deadSopenharmony_ci 3345bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 1.2.1 Specification (Operation) 3355bd8deadSopenharmony_ci 3365bd8deadSopenharmony_ci - (2.6, p. 12) First paragraph changed to: 3375bd8deadSopenharmony_ci "In the GL, most geometric objects are drawn by enclosing a series 3385bd8deadSopenharmony_ci of coordinate sets that specify vertices and optionally normals, 3395bd8deadSopenharmony_ci texture coordinates, colors, and user defined data between 3405bd8deadSopenharmony_ci Begin/End pairs. There are ten geometric objects that are drawn 3415bd8deadSopenharmony_ci this way: points, line segments, line segment loops, separated 3425bd8deadSopenharmony_ci line segments, polygons, triangle strips, triangle fans, separated 3435bd8deadSopenharmony_ci triangles, quadrilateral strips, and separated quadrilaterals." 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci - (2.6, p. 13) Fourth paragraph changed to: 3465bd8deadSopenharmony_ci "The current values are part of GL state. Vertices and normals are 3475bd8deadSopenharmony_ci transformed, colors may be affected or replaced by lighting, and 3485bd8deadSopenharmony_ci texture coordinates are transformed and possibly affected by a 3495bd8deadSopenharmony_ci texture coordinate generation function. Alternatively the 3505bd8deadSopenharmony_ci vertices, normals, texture coordinates, and colors may be 3515bd8deadSopenharmony_ci transformed or replaced by a vertex shader program. In either case 3525bd8deadSopenharmony_ci the processing indicated for each current value is applied for 3535bd8deadSopenharmony_ci each vertex that is sent to the GL." 3545bd8deadSopenharmony_ci 3555bd8deadSopenharmony_ci - (2.6, p. 14) 3565bd8deadSopenharmony_ci Should replace figure 2.2 with something showing the switch 3575bd8deadSopenharmony_ci between built in vertex/normal transformation and lighting and the 3585bd8deadSopenharmony_ci vertex shader program. 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci - (2.6.3, p. 19) First paragraph changed to: 3615bd8deadSopenharmony_ci "The only GL commands that are allowed within any Begin/End pairs 3625bd8deadSopenharmony_ci are the commands for specifying vertex coordinates, vertex color, 3635bd8deadSopenharmony_ci normal coordinates, and texture coordinates (Vertex, Color, Index, 3645bd8deadSopenharmony_ci Normal, TexCoord), the ArrayElement command (see section 2.8), the 3655bd8deadSopenharmony_ci EvalCoord and EvalPoint commands (see section 5.1), commands for 3665bd8deadSopenharmony_ci specifying lighting material parameters (Material commands; see 3675bd8deadSopenharmony_ci section 2.13.2), display list invocation commands (CallList and 3685bd8deadSopenharmony_ci CallLists; see section 5.4), the EdgeFlag command, and the 3695bd8deadSopenharmony_ci VariantEXT command (see section 2.14). Executing any other GL 3705bd8deadSopenharmony_ci command between the execution of Begin and the corresponding 3715bd8deadSopenharmony_ci execution of End results in the error INVALID_OPERATION. Executing 3725bd8deadSopenharmony_ci Begin after Begin has already been executed but before an End is 3735bd8deadSopenharmony_ci executed generates the INVALID_OPERATION error, as does executing 3745bd8deadSopenharmony_ci End without a previous corresponding Begin. 3755bd8deadSopenharmony_ci 3765bd8deadSopenharmony_ci - (2.8, p. 23) Added after the second paragraph: 3775bd8deadSopenharmony_ci "In addition to the pre-defined GL vertex components, variants 3785bd8deadSopenharmony_ci can be supplied via the vertex array mechanism. Variant arrays are 3795bd8deadSopenharmony_ci specified by the call: 3805bd8deadSopenharmony_ci 3815bd8deadSopenharmony_ci void VariantPointerEXT( uint id, enum type, uint stride, void *addr ) 3825bd8deadSopenharmony_ci 3835bd8deadSopenharmony_ci The type and stride parameters hold the same meaning as all other 3845bd8deadSopenharmony_ci array calls. The size parameter is missing as in NormalPointer, 3855bd8deadSopenharmony_ci and the size is fixed at 4. The id parameter specifies which 3865bd8deadSopenharmony_ci variant this array is to be used with. Finally, variant arrays 3875bd8deadSopenharmony_ci are enabled and disabled by calls to: 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ci void EnableVariantClientStateEXT( uint id) 3905bd8deadSopenharmony_ci void DisableVariantClientStateEXT( uint id) 3915bd8deadSopenharmony_ci 3925bd8deadSopenharmony_ci The id parameter contains the id of the variant array to enable 3935bd8deadSopenharmony_ci or disable. 3945bd8deadSopenharmony_ci 3955bd8deadSopenharmony_ci - (2.10, p. 28) First Paragraph changed to: 3965bd8deadSopenharmony_ci "Vertices, normals, and texture coordinates are transformed before 3975bd8deadSopenharmony_ci their coordinates are used to produce an image in the 3985bd8deadSopenharmony_ci framebuffer. This transformation can be accomplished with either 3995bd8deadSopenharmony_ci the OpenGL Per-Vertex operations or replaced by a vertex shader. 4005bd8deadSopenharmony_ci We begin with a description of how vertex coordinates are 4015bd8deadSopenharmony_ci transformed via the OpenGL Per-Vertex operations and how this 4025bd8deadSopenharmony_ci transformation is controlled. The specification of a vertex shader 4035bd8deadSopenharmony_ci is described in section 2.14." 4045bd8deadSopenharmony_ci 4055bd8deadSopenharmony_ci - (2.10, p. 28) Second Paragraph changed to: 4065bd8deadSopenharmony_ci "Figure 2.6 diagrams the sequence of transformations that are 4075bd8deadSopenharmony_ci applied to vertices in OpenGL vertex processing. The vertex 4085bd8deadSopenharmony_ci coordinates that are presented to the GL are termed object 4095bd8deadSopenharmony_ci coordinates. The model-view matrix is applied to these coordinates 4105bd8deadSopenharmony_ci to yield eye coordinates. Then another matrix, called the 4115bd8deadSopenharmony_ci projection matrix, is applied to eye coordinates to yield clip 4125bd8deadSopenharmony_ci coordinates. A perspective division is carried out on clip 4135bd8deadSopenharmony_ci coordinates to yield normalized device coordinates. A final 4145bd8deadSopenharmony_ci viewport transformation is applied to convert these coordinates 4155bd8deadSopenharmony_ci into window coordinates." 4165bd8deadSopenharmony_ci 4175bd8deadSopenharmony_ci - (2.10.2, p. 33) Eighth Paragraph changed to: 4185bd8deadSopenharmony_ci "There is another 4 x 4 matrix that is applied to texture 4195bd8deadSopenharmony_ci coordinates by the OpenGL per-vertex operations. This matrix 4205bd8deadSopenharmony_ci is applied as 4215bd8deadSopenharmony_ci | m1 m5 m9 m13 | |s| 4225bd8deadSopenharmony_ci | m2 m6 m10 m14 | |t|, 4235bd8deadSopenharmony_ci | m3 m7 m11 m15 | |r| 4245bd8deadSopenharmony_ci | m4 m8 m12 m16 | |q| 4255bd8deadSopenharmony_ci where the left matrix is the current texture matrix. The matrix is 4265bd8deadSopenharmony_ci applied to the coordinates resulting from texture coordinate 4275bd8deadSopenharmony_ci generation (which may simply be the current texture coordinates), 4285bd8deadSopenharmony_ci and the resulting transformed coordinates become the texture 4295bd8deadSopenharmony_ci coordinates associated with a vertex. Setting the matrix mode to 4305bd8deadSopenharmony_ci TEXTURE causes the already described matrix operations to apply to 4315bd8deadSopenharmony_ci the texture matrix." 4325bd8deadSopenharmony_ci 4335bd8deadSopenharmony_ci - (2.11, p. 39) Added after the first paragraph" 4345bd8deadSopenharmony_ci "When the user defined shader is eanbeld as described in section 4355bd8deadSopenharmony_ci 2.14, the ability to clip in eye-space is removed as eye-space is 4365bd8deadSopenharmony_ci now undefined. Instead, client defined clip planes are applied in 4375bd8deadSopenharmony_ci clip-space. The algorithm is identical, except the half-space is 4385bd8deadSopenharmony_ci now defined as: 4395bd8deadSopenharmony_ci 4405bd8deadSopenharmony_ci (x_clip) 4415bd8deadSopenharmony_ci (p'1 p'2 p'3 p'4) P_inv (y_clip) >= 0 4425bd8deadSopenharmony_ci (z_clip) 4435bd8deadSopenharmony_ci (w_clip) 4445bd8deadSopenharmony_ci 4455bd8deadSopenharmony_ci Where P is the projection matrix and x_clip, y_clip, z_clip, and 4465bd8deadSopenharmony_ci w_clip are the clip space vertex coordinates. When P is singular, 4475bd8deadSopenharmony_ci the result of clipping is undefined. 4485bd8deadSopenharmony_ci 4495bd8deadSopenharmony_ci - (2.12, p. 41) Added after the third paragraph: 4505bd8deadSopenharmony_ci "The raster position is not affected by the current vertex shader 4515bd8deadSopenharmony_ci program, instead they are always processed by the OpenGL vertex 4525bd8deadSopenharmony_ci processing." 4535bd8deadSopenharmony_ci 4545bd8deadSopenharmony_ci - (2.13, p. 43) Second paragraph: 4555bd8deadSopenharmony_ci "Next, lighting, if enabled (and vertex shaders are disabled), 4565bd8deadSopenharmony_ci produces either a color index or primary and secondary colors. 4575bd8deadSopenharmony_ci If lighting is disabled, the current color index or color is used 4585bd8deadSopenharmony_ci in further processing (the current color is the primary color, and 4595bd8deadSopenharmony_ci the secondary color is (0; 0; 0; 0)). After lighting or vertex 4605bd8deadSopenharmony_ci shading, RGBA colors are clamped to the range [0; 1]. A color 4615bd8deadSopenharmony_ci index is converted to fixed-point and then its integer portion is 4625bd8deadSopenharmony_ci masked (see section 2.13.6). After clamping or masking, a 4635bd8deadSopenharmony_ci primitive may be flatshaded, indicating that all vertices of the 4645bd8deadSopenharmony_ci primitive are to have the same color. Finally, if a primitive is 4655bd8deadSopenharmony_ci clipped, then colors (and texture coordinates) must be computed 4665bd8deadSopenharmony_ci at the vertices introduced or modified by clipping." 4675bd8deadSopenharmony_ci 4685bd8deadSopenharmony_ci - (2.13.1, p. 44) First paragraph: 4695bd8deadSopenharmony_ci "GL lighting computes colors for each vertex sent to the GL. This 4705bd8deadSopenharmony_ci is accomplished by applying an equation defined by a 4715bd8deadSopenharmony_ci client-specified lighting model to a collection of parameters that 4725bd8deadSopenharmony_ci can include the vertex coordinates, the coordinates of one or more 4735bd8deadSopenharmony_ci light sources, the current normal, and parameters defining the 4745bd8deadSopenharmony_ci characteristics of the light sources and a current material. The 4755bd8deadSopenharmony_ci following discussion assumes that the GL is in RGBA mode. (Color 4765bd8deadSopenharmony_ci index lighting is described in section 2.13.5.) Lighting may be in 4775bd8deadSopenharmony_ci one of two states: 4785bd8deadSopenharmony_ci 1. Lighting Off. In this state, the current color is assigned 4795bd8deadSopenharmony_ci to the vertex primary color. The secondary 4805bd8deadSopenharmony_ci color is (0; 0; 0; 0). Lighting is off if 4815bd8deadSopenharmony_ci vertex shaders are enabled." 4825bd8deadSopenharmony_ci 2. Lighting On. In this state, the vertex primary and secondary 4835bd8deadSopenharmony_ci colors are computed from the current lighting 4845bd8deadSopenharmony_ci parameters. Lighting is turned on or off using 4855bd8deadSopenharmony_ci the generic Enable or Disable commands with the 4865bd8deadSopenharmony_ci symbolic value LIGHTING." 4875bd8deadSopenharmony_ci 4885bd8deadSopenharmony_ci - (2.13.8, p. 55) First paragraph: 4895bd8deadSopenharmony_ci "After lighting or vertex shading, clamping or masking and possible 4905bd8deadSopenharmony_ci flatshading, colors are clipped. Those colors associated with a 4915bd8deadSopenharmony_ci vertex that lies within the clip volume are unaffected by clipping. 4925bd8deadSopenharmony_ci If a primitive is clipped, however, the colors assigned to vertices 4935bd8deadSopenharmony_ci produced by clipping are clipped colors." 4945bd8deadSopenharmony_ci 4955bd8deadSopenharmony_ci - (new section 2.14) Vertex Shaders and Coloring 4965bd8deadSopenharmony_ci "The alternative to OpenGL per-vertex operations is defining a 4975bd8deadSopenharmony_ci vertex shader. This vertex shader replaces the GL per-vertex 4985bd8deadSopenharmony_ci processing by specifying the operations to perform on the 4995bd8deadSopenharmony_ci incoming vertex and associated data. A vertex shader is defined 5005bd8deadSopenharmony_ci between a BeginVertexShaderEXT and EndVertexShaderEXT block. These 5015bd8deadSopenharmony_ci commands are defined as follows: 5025bd8deadSopenharmony_ci 5035bd8deadSopenharmony_ci void BeginVertexShaderEXT( void ); 5045bd8deadSopenharmony_ci void EndVertexShaderEXT( void ); 5055bd8deadSopenharmony_ci 5065bd8deadSopenharmony_ci The only GL operations allowed between BeginShader and 5075bd8deadSopenharmony_ci EndShader are ShaderOp[1..3]EXT, GenSymbolsEXT, SetLocalConstantEXT, 5085bd8deadSopenharmony_ci SwizzleEXT, WriteMaskEXT, InsertComponentEXT, and 5095bd8deadSopenharmony_ci ExtractComponentEXT. Calling BeginVertexShader with a prior call to 5105bd8deadSopenharmony_ci BeginVertexShader and no matching prior call to EndVertexShader 5115bd8deadSopenharmony_ci results in the error INVALID_OPERATION. Likewise, calling 5125bd8deadSopenharmony_ci EndVertexShader without a matching prior call to BeginVertexShader 5135bd8deadSopenharmony_ci results in the error INVALID_OPERATION. 5145bd8deadSopenharmony_ci In addition to a default vertex shader program, named vertex 5155bd8deadSopenharmony_ci shaders can be created. The namespace for vertex shaders is 5165bd8deadSopenharmony_ci unsigned integers with zero reserved by the GL. A vertetx shader is 5175bd8deadSopenharmony_ci created by binding an unused name using: 5185bd8deadSopenharmony_ci 5195bd8deadSopenharmony_ci void BindVertexShaderEXT( uint id ); 5205bd8deadSopenharmony_ci 5215bd8deadSopenharmony_ci where id is the unused name. Once a vertex shader program has been 5225bd8deadSopenharmony_ci created it can be rebound as the active vertex shader program by 5235bd8deadSopenharmony_ci calling BindVertexShaderEXT. Calling BindShaderEXT with an argument 5245bd8deadSopenharmony_ci of zero binds the default vertex shader program. A vertex shader 5255bd8deadSopenharmony_ci program can be deleted, freeing the name, by calling 5265bd8deadSopenharmony_ci 5275bd8deadSopenharmony_ci void DeleteVertexShaderEXT( uint id ); 5285bd8deadSopenharmony_ci 5295bd8deadSopenharmony_ci where id is the name to be deleted. Unique names can be generated 5305bd8deadSopenharmony_ci using: 5315bd8deadSopenharmony_ci 5325bd8deadSopenharmony_ci uint GenShadersEXT( uint range ); 5335bd8deadSopenharmony_ci 5345bd8deadSopenharmony_ci where range is the number of contiguous ids that should be 5355bd8deadSopenharmony_ci created. It returns an integer n such that range contiguous empty 5365bd8deadSopenharmony_ci shader ids, with values n, n+1, ..., n+range -1, are created. 5375bd8deadSopenharmony_ci If range is 0, if there is no group of range contiguous names 5385bd8deadSopenharmony_ci available, or if any error is generated, no vertex shader names 5395bd8deadSopenharmony_ci are generated, and 0 is returned. The currently bound vertex 5405bd8deadSopenharmony_ci shader can be determined by querying VERTEX_SHADER_BINDING_EXT. 5415bd8deadSopenharmony_ci There are four kinds of data available from within a vertex 5425bd8deadSopenharmony_ci shader program: invariant data, local constant data, local data, 5435bd8deadSopenharmony_ci and variant data. Invariant data is data that can only be set 5445bd8deadSopenharmony_ci outside of a vertex shader program definition, it is set before a 5455bd8deadSopenharmony_ci shader is executed and does not change during vertex shader program 5465bd8deadSopenharmony_ci execution. Local constant data is data that is local to the vertex 5475bd8deadSopenharmony_ci shader program, it is set once during the context of the vertex 5485bd8deadSopenharmony_ci shader program definition and does not change either before or 5495bd8deadSopenharmony_ci during execution of the vertex shader program. Local data is data 5505bd8deadSopenharmony_ci that is local to the vertex shader program which can both be read 5515bd8deadSopenharmony_ci from and written to during the execution of the vertex shader 5525bd8deadSopenharmony_ci program but not prior to execution. The contents of local data are 5535bd8deadSopenharmony_ci undefined until the data is written to, and values do not persist 5545bd8deadSopenharmony_ci between executions of the vertex shader program. Variant data is 5555bd8deadSopenharmony_ci data which is specified per vertex, it can only be read from during 5565bd8deadSopenharmony_ci execution of the vertex shader program. 5575bd8deadSopenharmony_ci The GenSymbolsEXT, SetInvariantEXT, SetLocalConstantEXT, 5585bd8deadSopenharmony_ci SetVariantEXT, VariantPointerEXT, commands are used to stage 5595bd8deadSopenharmony_ci these various kinds of data for use in the vertex shader program. 5605bd8deadSopenharmony_ci This staging takes place in two parts. The first part involves 5615bd8deadSopenharmony_ci defining a name and giving it a data type and storage class. 5625bd8deadSopenharmony_ci This is done by calling 5635bd8deadSopenharmony_ci 5645bd8deadSopenharmony_ci uint GenSymbolsEXT( enum datatype, enum storagetype, enum range, 5655bd8deadSopenharmony_ci uint components ); 5665bd8deadSopenharmony_ci 5675bd8deadSopenharmony_ci where datatype can be one of SCALAR_EXT, VECTOR_EXT, MATRIX_EXT, 5685bd8deadSopenharmony_ci and storagetype can be one of VARIANT_EXT, INVARIANT_EXT, 5695bd8deadSopenharmony_ci LOCAL_CONSTANT_EXT, LOCAL_EXT, range can be NORMALIZED_RANGE_EXT 5705bd8deadSopenharmony_ci or FULL_RANGE_EXT, and components determines how many names should 5715bd8deadSopenharmony_ci be generated. It returns an integer that is the first 5725bd8deadSopenharmony_ci name in a contiguous block of names of size components. The three 5735bd8deadSopenharmony_ci datatypes available determine the size of the storage at each 5745bd8deadSopenharmony_ci name: Scalars being one element, vectors being 4 elements, and 5755bd8deadSopenharmony_ci matrices being 16 elements. These are all treated as decimals in 5765bd8deadSopenharmony_ci the computations performed by ShaderOp[1..3]EXT. The storagetype 5775bd8deadSopenharmony_ci determines where and how often a particular named piece of data 5785bd8deadSopenharmony_ci may be set (using SetInvariantEXT, SetLocalConstantEXT, VariantEXT, or 5795bd8deadSopenharmony_ci VariantPointerEXT). If this data is not set before being 5805bd8deadSopenharmony_ci used the values used are undetermined and may result in 5815bd8deadSopenharmony_ci unpredictable values being used in the calculation. The range 5825bd8deadSopenharmony_ci determines the mapping of the data. When specifying input data 5835bd8deadSopenharmony_ci with a storagetype of FULL_RANGE_EXT, the data is allowed to 5845bd8deadSopenharmony_ci occupy the full range of the system's floating point values. 5855bd8deadSopenharmony_ci When specifying input data with a storagetype of 5865bd8deadSopenharmony_ci NORMALIZED_RANGE_EXT, integer values are mapped according to 5875bd8deadSopenharmony_ci table 2.6 and floating point values are clamped to -1 to 1. 5885bd8deadSopenharmony_ci When a result outside the range -1 to 1 is written to a local 5895bd8deadSopenharmony_ci with its storagetype set to NORMALIZED_RANGE_EXT, the results 5905bd8deadSopenharmony_ci are undefined. 5915bd8deadSopenharmony_ci Assigning values to the names generated is the second part of 5925bd8deadSopenharmony_ci the staging process and is accomplished by calling 5935bd8deadSopenharmony_ci 5945bd8deadSopenharmony_ci void SetInvariantEXT( uint id, enum type, void *addr ); 5955bd8deadSopenharmony_ci void SetLocalConstantEXT( uint id, enum type, void *addr ); 5965bd8deadSopenharmony_ci void Variant{bsifd ubusui}vEXT( uint id, T *addr ); 5975bd8deadSopenharmony_ci void VariantPointerEXT( uint id, enum type, uint stride, 5985bd8deadSopenharmony_ci void *addr ); 5995bd8deadSopenharmony_ci 6005bd8deadSopenharmony_ci where id is a name returned by GenSymbolsEXT, and type is DOUBLE, 6015bd8deadSopenharmony_ci FLOAT, BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT, INT, or 6025bd8deadSopenharmony_ci UNSIGNED_INT, and addr is a pointer to 6035bd8deadSopenharmony_ci the value to be assigned to the name. 6045bd8deadSopenharmony_ci SetInvariantEXT is used to set a single scalar, vector, 6055bd8deadSopenharmony_ci or matrix value. It may be used outside of the vertex shader 6065bd8deadSopenharmony_ci program to set invariant data. SetLocalConstantEXT may be used 6075bd8deadSopenharmony_ci inside the vertex shader program to set local constants. Local 6085bd8deadSopenharmony_ci constants may only be set once during the definition of a 6095bd8deadSopenharmony_ci vertex shader program. Attempts to set a local constant more than 6105bd8deadSopenharmony_ci once in a vertex shader program will fail and create the error 6115bd8deadSopenharmony_ci ILLEGAL_OPERATION. VariantEXT data is used within a Begin, End 6125bd8deadSopenharmony_ci pair to set per-vertex data. Alternatively a complete set of 6135bd8deadSopenharmony_ci variant data may specified using arrays by using VariantPointerEXT. 6145bd8deadSopenharmony_ci 6155bd8deadSopenharmony_ci 6165bd8deadSopenharmony_ci The operations to be performed on the vertex, normal, color, 6175bd8deadSopenharmony_ci GL state data, and the staged data in the shader are defined by 6185bd8deadSopenharmony_ci making a sequence of one or more calls (between BeginShader and 6195bd8deadSopenharmony_ci EndShader) to one or more of the following: 6205bd8deadSopenharmony_ci 6215bd8deadSopenharmony_ci void ShaderOp1EXT( enum op, uint res, uint arg1 ); 6225bd8deadSopenharmony_ci void ShaderOp2EXT( enum op, uint res, uint arg1, uint arg2 ); 6235bd8deadSopenharmony_ci void ShaderOp3EXT( enum op, uint res, uint arg1, uint arg2, 6245bd8deadSopenharmony_ci uint arg3); 6255bd8deadSopenharmony_ci 6265bd8deadSopenharmony_ci where op is one of the constants described below, and res is one 6275bd8deadSopenharmony_ci of OUTPUT_VERTEX_EXT, OUTPUT_COLOR#_EXT, OUTPUT_TEXTURE_COORD#_EXT, 6285bd8deadSopenharmony_ci OUTPUT_FOG_EXT, or a data id defined by GenSymbolsEXT (with it's 6295bd8deadSopenharmony_ci storage type set as LOCAL_EXT), and arg[1..3] is a data id defined 6305bd8deadSopenharmony_ci by GenSymbolsEXT. 6315bd8deadSopenharmony_ci 6325bd8deadSopenharmony_ci It should be noted that the OUTPUT_xxx_EXT identifiers are 6335bd8deadSopenharmony_ci special and can only be written. The values propagated forward 6345bd8deadSopenharmony_ci from the vertex shader program are the last values written to 6355bd8deadSopenharmony_ci these identifiers. Partial writes to these identifiers can be 6365bd8deadSopenharmony_ci accomplished by using WriteMaskEXT. 6375bd8deadSopenharmony_ci 6385bd8deadSopenharmony_ci To facilitate the use of GL state values in a vertex shader 6395bd8deadSopenharmony_ci program, a parameter binding mechanism is provided. Items such as 6405bd8deadSopenharmony_ci material properties, light positions, and matrices are bound to 6415bd8deadSopenharmony_ci ids. The functions for binding these parameters mirror the 6425bd8deadSopenharmony_ci functions for retrieving state values from GL. The bind functions 6435bd8deadSopenharmony_ci return an id that can be used as an arg to ShaderOpnEXT. The data 6445bd8deadSopenharmony_ci type and storage type of the id match the semantics of the GL state 6455bd8deadSopenharmony_ci and are provided below. The ids returned from the bind calls may 6465bd8deadSopenharmony_ci not be used with any of the set data calls. Below are the bind 6475bd8deadSopenharmony_ci functions and tables of their associated states: 6485bd8deadSopenharmony_ci 6495bd8deadSopenharmony_ci Light Parameters: 6505bd8deadSopenharmony_ci 6515bd8deadSopenharmony_ci uint BindLightParameterEXT( enum light, enum value) 6525bd8deadSopenharmony_ci 6535bd8deadSopenharmony_ci Value Data Type Storage Type 6545bd8deadSopenharmony_ci --------------------- --------- ------------ 6555bd8deadSopenharmony_ci AMBIENT VECTOR INVARIANT 6565bd8deadSopenharmony_ci DIFFUSE VECTOR INVARIANT 6575bd8deadSopenharmony_ci SPECULAR VECTOR INVARIANT 6585bd8deadSopenharmony_ci POSITION VECTOR INVARIANT 6595bd8deadSopenharmony_ci CONSTANT_ATTENUATION SCALAR INVARIANT 6605bd8deadSopenharmony_ci LINEAR_ATTENUATION SCALAR INVARIANT 6615bd8deadSopenharmony_ci QUADRATIC_ATTENUATION SCALAR INVARIANT 6625bd8deadSopenharmony_ci SPOT_DIRECTION VECTOR INVARIANT 6635bd8deadSopenharmony_ci SPOT_EXPONENT SCALAR INVARIANT 6645bd8deadSopenharmony_ci SPOT_CUTOFF SCALAR INVARIANT 6655bd8deadSopenharmony_ci 6665bd8deadSopenharmony_ci Material Parameters: 6675bd8deadSopenharmony_ci 6685bd8deadSopenharmony_ci uint BindMaterialParameterEXT( enum face, enum value) 6695bd8deadSopenharmony_ci 6705bd8deadSopenharmony_ci Value Data Type Storage Type 6715bd8deadSopenharmony_ci --------------------- --------- ------------ 6725bd8deadSopenharmony_ci AMBIENT VECTOR VARIANT 6735bd8deadSopenharmony_ci DIFFUSE VECTOR VARIANT 6745bd8deadSopenharmony_ci SPECULAR VECTOR VARIANT 6755bd8deadSopenharmony_ci EMISSION VECTOR VARIANT 6765bd8deadSopenharmony_ci SHININESS SCALAR VARIANT 6775bd8deadSopenharmony_ci 6785bd8deadSopenharmony_ci 6795bd8deadSopenharmony_ci TexGen Parameters: 6805bd8deadSopenharmony_ci 6815bd8deadSopenharmony_ci uint BindTexGenParameterEXT( enum unit, enum coord, enum value) 6825bd8deadSopenharmony_ci 6835bd8deadSopenharmony_ci Value Data Type Storage Type 6845bd8deadSopenharmony_ci --------------------- --------- ------------ 6855bd8deadSopenharmony_ci EYE_PLANE VECTOR INVARIANT 6865bd8deadSopenharmony_ci OBJECT_PLANE VECTOR INVARIANT 6875bd8deadSopenharmony_ci 6885bd8deadSopenharmony_ci Texture Unit Parameters 6895bd8deadSopenharmony_ci 6905bd8deadSopenharmony_ci uint BindTextureUnitParameterEXT( enum unit, enum value) 6915bd8deadSopenharmony_ci 6925bd8deadSopenharmony_ci Value Data Type Storage Type 6935bd8deadSopenharmony_ci --------------------- --------- ------------ 6945bd8deadSopenharmony_ci CURRENT_TEXTURE_COORDS VECTOR VARIANT 6955bd8deadSopenharmony_ci TEXTURE_MATRIX MATRIX INVARIANT 6965bd8deadSopenharmony_ci 6975bd8deadSopenharmony_ci 6985bd8deadSopenharmony_ci Standard Parameters: 6995bd8deadSopenharmony_ci 7005bd8deadSopenharmony_ci uint BindParameterEXT( enum value) 7015bd8deadSopenharmony_ci 7025bd8deadSopenharmony_ci Value Data Type Storage Type 7035bd8deadSopenharmony_ci --------------------- --------- ------------ 7045bd8deadSopenharmony_ci CURRENT_VERTEX_EXT VECTOR VARIANT 7055bd8deadSopenharmony_ci CURRENT_NORMAL VECTOR VARIANT 7065bd8deadSopenharmony_ci CURRENT_COLOR VECTOR VARIANT 7075bd8deadSopenharmony_ci MODELVIEW_MATRIX MATRIX INVARIANT 7085bd8deadSopenharmony_ci PROJECTION_MATRIX MATRIX INVARIANT 7095bd8deadSopenharmony_ci MVP_MATRIX_EXT MATRIX INVARIANT 7105bd8deadSopenharmony_ci COLOR_MATRIX MATRIX INVARIANT ** Only supported under imaging subset 7115bd8deadSopenharmony_ci CLIP_PLANEi VECTOR INVARIANT 7125bd8deadSopenharmony_ci FOG_COLOR VECTOR INVARIANT 7135bd8deadSopenharmony_ci FOG_DENSITY SCALAR INVARIANT 7145bd8deadSopenharmony_ci FOG_START SCALAR INVARIANT 7155bd8deadSopenharmony_ci FOG_END SCALAR INVARIANT 7165bd8deadSopenharmony_ci LIGHT_MODEL_AMBIENT VECTOR INVARIANT 7175bd8deadSopenharmony_ci 7185bd8deadSopenharmony_ci 7195bd8deadSopenharmony_ci 7205bd8deadSopenharmony_ci For matrices only the top value of the matrix stack may be 7215bd8deadSopenharmony_ci accessed. 7225bd8deadSopenharmony_ci Binding of the token MVP_MATRIX_EXT provides access to a 7235bd8deadSopenharmony_ci matrix containing the concatenation of the MODELVIEW and 7245bd8deadSopenharmony_ci PROJECTION matrices. Binding the token CURRENT_VERTEX_EXT 7255bd8deadSopenharmony_ci provides access to the coordinates of the vertex being processed. 7265bd8deadSopenharmony_ci A special case of the bindings is CURRENT_NORMAL as it only a 7275bd8deadSopenharmony_ci 3-tuple natively. In this case, it is expanded as a homogeneous 7285bd8deadSopenharmony_ci vector with the fourth component set to 0. 7295bd8deadSopenharmony_ci Each operation is accepted by a particular 7305bd8deadSopenharmony_ci ShaderOp[1..3]EXT based on the number of arguments it 7315bd8deadSopenharmony_ci accepts and it's results are based on the type of arguments (as 7325bd8deadSopenharmony_ci bound by GenSymbolsEXT) it receives. This is described in the 7335bd8deadSopenharmony_ci following table. S denotes a scalar, V denotes a vector, M denotes 7345bd8deadSopenharmony_ci a matrix, [] denotes a particular element of the input or 7355bd8deadSopenharmony_ci output, a1 denotes arg1, a2 denotes arg2, a3 denotes arg3, a4 7365bd8deadSopenharmony_ci denotes arg4, r denotes the result, combinations of input and 7375bd8deadSopenharmony_ci output not shown produce ILLEGAL_OPERATION. 7385bd8deadSopenharmony_ci 7395bd8deadSopenharmony_ci 7405bd8deadSopenharmony_ci Table of operations 7415bd8deadSopenharmony_ci 7425bd8deadSopenharmony_ci 7435bd8deadSopenharmony_ciOperation Number of Inputs res args Output 7445bd8deadSopenharmony_ci------------------- ------------------ ---- ----- ----------------- 7455bd8deadSopenharmony_ciOP_INDEX_EXT 2 S S,S special see below 7465bd8deadSopenharmony_ci V S,V 7475bd8deadSopenharmony_ci M S,M 7485bd8deadSopenharmony_ci 7495bd8deadSopenharmony_ciOP_NEGATE_EXT 1 S S r = -a1 7505bd8deadSopenharmony_ci V S r[0] = -a1 7515bd8deadSopenharmony_ci r[1] = -a1 7525bd8deadSopenharmony_ci r[2] = -a1 7535bd8deadSopenharmony_ci r[3] = -a1 7545bd8deadSopenharmony_ci V V r[0] = -a1[0] 7555bd8deadSopenharmony_ci r[1] = -a1[1] 7565bd8deadSopenharmony_ci r[2] = -a1[2] 7575bd8deadSopenharmony_ci r[3] = -a1[3] 7585bd8deadSopenharmony_ci 7595bd8deadSopenharmony_ciOP_DOT3_EXT 2 S V,V r = a1[0] * a2[0] + 7605bd8deadSopenharmony_ci a1[1] * a2[1] + 7615bd8deadSopenharmony_ci a1[2] * a2[2] 7625bd8deadSopenharmony_ci V V,V r[0] = a1[0] * a2[0] + 7635bd8deadSopenharmony_ci a1[1] * a2[1] + 7645bd8deadSopenharmony_ci a1[2] * a2[2] 7655bd8deadSopenharmony_ci r[1] = a1[0] * a2[0] + 7665bd8deadSopenharmony_ci a1[1] * a2[1] + 7675bd8deadSopenharmony_ci a1[2] * a2[2] 7685bd8deadSopenharmony_ci r[2] = a1[0] * a2[0] + 7695bd8deadSopenharmony_ci a1[1] * a2[1] + 7705bd8deadSopenharmony_ci a1[2] * a2[2] 7715bd8deadSopenharmony_ci r[3] = unchanged 7725bd8deadSopenharmony_ci 7735bd8deadSopenharmony_ciOP_DOT4_EXT 2 S V,V r = a1[0] * a2[0] + 7745bd8deadSopenharmony_ci a1[1] * a2[1] + 7755bd8deadSopenharmony_ci a1[2] * a2[2] + 7765bd8deadSopenharmony_ci a1[3] * a2[3] 7775bd8deadSopenharmony_ci V V,V r[0] = a1[0] * a2[0] + 7785bd8deadSopenharmony_ci a1[1] * a2[1] + 7795bd8deadSopenharmony_ci a1[2] * a2[2] + 7805bd8deadSopenharmony_ci a1[3] * a2[3] 7815bd8deadSopenharmony_ci r[1] = a1[0] * a2[0] + 7825bd8deadSopenharmony_ci a1[1] * a2[1] + 7835bd8deadSopenharmony_ci a1[2] * a2[2] + 7845bd8deadSopenharmony_ci a1[3] * a2[3] 7855bd8deadSopenharmony_ci r[2] = a1[0] * a2[0] + 7865bd8deadSopenharmony_ci a1[1] * a2[1] + 7875bd8deadSopenharmony_ci a1[2] * a2[2] + 7885bd8deadSopenharmony_ci a1[3] * a2[3] 7895bd8deadSopenharmony_ci r[3] = a1[0] * a2[0] + 7905bd8deadSopenharmony_ci a1[1] * a2[1] + 7915bd8deadSopenharmony_ci a1[2] * a2[2] + 7925bd8deadSopenharmony_ci a1[3] * a2[3] 7935bd8deadSopenharmony_ci 7945bd8deadSopenharmony_ciOP_MUL_EXT 2 S S,S r = a1 * a2 7955bd8deadSopenharmony_ci V S,S r[0] = r[1] = r[2] = r[3] = a1 * a2 7965bd8deadSopenharmony_ci r[1] = a1 * a2 7975bd8deadSopenharmony_ci r[2] = a1 * a2 7985bd8deadSopenharmony_ci r[3] = a1 * a2 7995bd8deadSopenharmony_ci V S,V r[0] = a1 * a2[0] 8005bd8deadSopenharmony_ci r[1] = a1 * a2[1] 8015bd8deadSopenharmony_ci r[2] = a1 * a2[2] 8025bd8deadSopenharmony_ci r[3] = a1 * a2[3] 8035bd8deadSopenharmony_ci V V,S r[0] = a1[0] * a2 8045bd8deadSopenharmony_ci r[1] = a1[1] * a2 8055bd8deadSopenharmony_ci r[2] = a1[2] * a2 8065bd8deadSopenharmony_ci r[3] = a1[3] * a2 8075bd8deadSopenharmony_ci V V,V r[0] = a1[0] * a2[0] 8085bd8deadSopenharmony_ci r[1] = a1[1] * a2[1] 8095bd8deadSopenharmony_ci r[2] = a1[2] * a2[2] 8105bd8deadSopenharmony_ci r[3] = a1[3] * a2[3] 8115bd8deadSopenharmony_ci 8125bd8deadSopenharmony_ciOP_MOV_EXT 1 S S r = a1 8135bd8deadSopenharmony_ci V S r[0] = a1 8145bd8deadSopenharmony_ci r[1] = a1 8155bd8deadSopenharmony_ci r[2] = a1 8165bd8deadSopenharmony_ci r[3] = a1 8175bd8deadSopenharmony_ci V V r[0] = a1[0] 8185bd8deadSopenharmony_ci r[1] = a1[1] 8195bd8deadSopenharmony_ci r[2] = a1[2] 8205bd8deadSopenharmony_ci r[3] = a1[3] 8215bd8deadSopenharmony_ci 8225bd8deadSopenharmony_ciOP_ADD_EXT 2 S S,S r = a1 + a2 8235bd8deadSopenharmony_ci V S,S r[0] = a1 + a2 8245bd8deadSopenharmony_ci r[1] = a1 + a2 8255bd8deadSopenharmony_ci r[2] = a1 + a2 8265bd8deadSopenharmony_ci r[3] = a1 + a2 8275bd8deadSopenharmony_ci V S,V r[0] = a1 + a2[0] 8285bd8deadSopenharmony_ci r[1] = a1 + a2[1] 8295bd8deadSopenharmony_ci r[2] = a1 + a2[2] 8305bd8deadSopenharmony_ci r[3] = a1 + a2[3] 8315bd8deadSopenharmony_ci V V,S r[0] = a1[0] + a2 8325bd8deadSopenharmony_ci r[1] = a1[1] + a2 8335bd8deadSopenharmony_ci r[2] = a1[2] + a2 8345bd8deadSopenharmony_ci r[3] = a1[3] + a2 8355bd8deadSopenharmony_ci V V,V r[0] = a1[0] + a2[0] 8365bd8deadSopenharmony_ci r[1] = a1[1] + a2[1] 8375bd8deadSopenharmony_ci r[2] = a1[2] + a2[2] 8385bd8deadSopenharmony_ci r[3] = a1[3] + a2[3] 8395bd8deadSopenharmony_ci 8405bd8deadSopenharmony_ciOP_MADD_EXT 3 S S,S,S r = a1 * a2 + a3 8415bd8deadSopenharmony_ci V S,S,S r[0] = a1 * a2 + a3 8425bd8deadSopenharmony_ci r[1] = a1 * a2 + a3 8435bd8deadSopenharmony_ci r[2] = a1 * a2 + a3 8445bd8deadSopenharmony_ci r[3] = a1 * a2 + a3 8455bd8deadSopenharmony_ci V S,V,V r[0] = a1 * a2[0] +a3[0] 8465bd8deadSopenharmony_ci r[1] = a1 * a2[1] +a3[1] 8475bd8deadSopenharmony_ci r[2] = a1 * a2[2] +a3[2] 8485bd8deadSopenharmony_ci r[3] = a1 * a2[3] +a3[3] 8495bd8deadSopenharmony_ci V V,S,V r[0] = a1[0] * a2 +a3[0] 8505bd8deadSopenharmony_ci r[1] = a1[1] * a2 +a3[1] 8515bd8deadSopenharmony_ci r[2] = a1[2] * a2 +a3[2] 8525bd8deadSopenharmony_ci r[3] = a1[3] * a2 +a3[3] 8535bd8deadSopenharmony_ci V S,S,V r[0] = a1 * a2 +a3[0] 8545bd8deadSopenharmony_ci r[1] = a1 * a2 +a3[1] 8555bd8deadSopenharmony_ci r[2] = a1 * a2 +a3[2] 8565bd8deadSopenharmony_ci r[3] = a1 * a2 +a3[3] 8575bd8deadSopenharmony_ci V V,V,S r[0] = a1[0] * a2[0] +a3 8585bd8deadSopenharmony_ci r[1] = a1[1] * a2[1] +a3 8595bd8deadSopenharmony_ci r[2] = a1[2] * a2[2] +a3 8605bd8deadSopenharmony_ci r[3] = a1[3] * a2[3] +a3 8615bd8deadSopenharmony_ci V V,S,S r[0] = a1[0] * a2 +a3 8625bd8deadSopenharmony_ci r[1] = a1[1] * a2 +a3 8635bd8deadSopenharmony_ci r[2] = a1[2] * a2 +a3 8645bd8deadSopenharmony_ci r[3] = a1[3] * a2 +a3 8655bd8deadSopenharmony_ci V S,V,S r[0] = a1 * a2[0] +a3 8665bd8deadSopenharmony_ci r[1] = a1 * a2[1] +a3 8675bd8deadSopenharmony_ci r[2] = a1 * a2[2] +a3 8685bd8deadSopenharmony_ci r[3] = a1 * a2[3] +a3 8695bd8deadSopenharmony_ci V V,V,V r[0] = a1[0] * a2[0] +a3[0] 8705bd8deadSopenharmony_ci r[1] = a1[1] * a2[1] +a3[1] 8715bd8deadSopenharmony_ci r[2] = a1[2] * a2[2] +a3[2] 8725bd8deadSopenharmony_ci r[3] = a1[3] * a2[3] +a3[3] 8735bd8deadSopenharmony_ci 8745bd8deadSopenharmony_ciOP_FRAC_EXT 1 S S r = a1 - FLOOR(a1) 8755bd8deadSopenharmony_ci V S r[0] = a1 - FLOOR(a1) 8765bd8deadSopenharmony_ci r[1] = a1 - FLOOR(a1) 8775bd8deadSopenharmony_ci r[2] = a1 - FLOOR(a1) 8785bd8deadSopenharmony_ci r[3] = a1 - FLOOR(a1) 8795bd8deadSopenharmony_ci V V r[0] = a1[0] - FLOOR(a1[0]) 8805bd8deadSopenharmony_ci r[1] = a1[1] - FLOOR(a1[1]) 8815bd8deadSopenharmony_ci r[2] = a1[2] - FLOOR(a1[2]) 8825bd8deadSopenharmony_ci r[3] = a1[3] - FLOOR(a1[3]) 8835bd8deadSopenharmony_ci 8845bd8deadSopenharmony_ciOP_MAX_EXT 2 S S,S r = MAX(a1, a2) 8855bd8deadSopenharmony_ci V S,S r[0] = MAX(a1, a2) 8865bd8deadSopenharmony_ci r[1] = MAX(a1, a2) 8875bd8deadSopenharmony_ci r[2] = MAX(a1, a2) 8885bd8deadSopenharmony_ci r[3] = MAX(a1, a2) 8895bd8deadSopenharmony_ci V S,V r[0] = MAX(a1, a2[0]) 8905bd8deadSopenharmony_ci r[1] = MAX(a1, a2[1]) 8915bd8deadSopenharmony_ci r[2] = MAX(a1, a2[2]) 8925bd8deadSopenharmony_ci r[3] = MAX(a1, a2[3]) 8935bd8deadSopenharmony_ci V V,S r[0] = MAX(a1[0], a2) 8945bd8deadSopenharmony_ci r[1] = MAX(a1[1], a2) 8955bd8deadSopenharmony_ci r[2] = MAX(a1[2], a2) 8965bd8deadSopenharmony_ci r[3] = MAX(a1[3], a2) 8975bd8deadSopenharmony_ci V V,V r[0] = MAX(a1[0], a2[0]) 8985bd8deadSopenharmony_ci r[1] = MAX(a1[1], a2[1]) 8995bd8deadSopenharmony_ci r[2] = MAX(a1[2], a2[2]) 9005bd8deadSopenharmony_ci r[3] = MAX(a1[3], a2[3]) 9015bd8deadSopenharmony_ci 9025bd8deadSopenharmony_ciOP_MIN_EXT 2 S S,S r = MIN(a1, a2) 9035bd8deadSopenharmony_ci V S,S r[0] = MIN(a1, a2) 9045bd8deadSopenharmony_ci r[1] = MIN(a1, a2) 9055bd8deadSopenharmony_ci r[2] = MIN(a1, a2) 9065bd8deadSopenharmony_ci r[3] = MIN(a1, a2) 9075bd8deadSopenharmony_ci V S,V r[0] = MIN(a1, a2[0]) 9085bd8deadSopenharmony_ci r[1] = MIN(a1, a2[1]) 9095bd8deadSopenharmony_ci r[2] = MIN(a1, a2[2]) 9105bd8deadSopenharmony_ci r[3] = MIN(a1, a2[3]) 9115bd8deadSopenharmony_ci V V,S r[0] = MIN(a1[0], a2) 9125bd8deadSopenharmony_ci r[1] = MIN(a1[1], a2) 9135bd8deadSopenharmony_ci r[2] = MIN(a1[2], a2) 9145bd8deadSopenharmony_ci r[3] = MIN(a1[3], a2) 9155bd8deadSopenharmony_ci V V,V r[0] = MIN(a1[0], a2[0]) 9165bd8deadSopenharmony_ci r[1] = MIN(a1[1], a2[1]) 9175bd8deadSopenharmony_ci r[2] = MIN(a1[2], a2[2]) 9185bd8deadSopenharmony_ci r[3] = MIN(a1[3], a2[3]) 9195bd8deadSopenharmony_ci 9205bd8deadSopenharmony_ciOP_SET_GE_EXT 2 S S,S r = (a1 >= a2) ? 1 : 0 9215bd8deadSopenharmony_ci V S,S r[0] = (a1 >= a2) ? 1 : 0 9225bd8deadSopenharmony_ci r[1] = (a1 >= a2) ? 1 : 0 9235bd8deadSopenharmony_ci r[2] = (a1 >= a2) ? 1 : 0 9245bd8deadSopenharmony_ci r[3] = (a1 >= a2) ? 1 : 0 9255bd8deadSopenharmony_ci V S,V r[0] = (a1 >= a2[0]) ?1 : 0 9265bd8deadSopenharmony_ci r[1] = (a1 >= a2[1]) ? 1: 0 9275bd8deadSopenharmony_ci r[2] = (a1 >= a2[2]) ? 1: 0 9285bd8deadSopenharmony_ci r[3] = (a1 >= a2[3]) ? 1: 0 9295bd8deadSopenharmony_ci V V,S r[0] = (a1[0] >= a2) ? 1: 0 9305bd8deadSopenharmony_ci r[1] = (a1[1] >= a2) ? 1: 0 9315bd8deadSopenharmony_ci r[2] = (a1[2] >= a2) ? 1: 0 9325bd8deadSopenharmony_ci r[3] = (a1[3] >= a2) ? 1: 0 9335bd8deadSopenharmony_ci V V,V r[0] =(a1[0]>=a2[0]) ?1 : 0 9345bd8deadSopenharmony_ci r[1] =(a1[1]>=a2[1]) ?1 : 0 9355bd8deadSopenharmony_ci r[2] =(a1[2]>=a2[2]) ?1 : 0 9365bd8deadSopenharmony_ci r[3] =(a1[3]>=a2[3]) ?1 : 0 9375bd8deadSopenharmony_ci 9385bd8deadSopenharmony_ciOP_SET_LT_EXT 2 S S,S r = (a1 < a2) ? 1 : 0 9395bd8deadSopenharmony_ci V S,S r[0] = (a1 < a2) ? 1 : 0 9405bd8deadSopenharmony_ci r[1] = (a1 < a2) ? 1 : 0 9415bd8deadSopenharmony_ci r[2] = (a1 < a2) ? 1 : 0 9425bd8deadSopenharmony_ci r[3] = (a1 < a2) ? 1 : 0 9435bd8deadSopenharmony_ci V S,V r[0] = (a1 < a2[0]) ? 1 : 0 9445bd8deadSopenharmony_ci r[1] = (a1 < a2[1]) ? 1 : 0 9455bd8deadSopenharmony_ci r[2] = (a1 < a2[2]) ? 1 : 0 9465bd8deadSopenharmony_ci r[3] = (a1 < a2[3]) ? 1 : 0 9475bd8deadSopenharmony_ci V V,S r[0] = (a1[0] < a2) ? 1 : 0 9485bd8deadSopenharmony_ci r[1] = (a1[1] < a2) ? 1 : 0 9495bd8deadSopenharmony_ci r[2] = (a1[2] < a2) ? 1 : 0 9505bd8deadSopenharmony_ci r[3] = (a1[3] < a2) ? 1 : 0 9515bd8deadSopenharmony_ci V V,V r[0] =(a1[0]< a2[0]) ?1 : 0 9525bd8deadSopenharmony_ci r[1] =(a1[1]< a2[1]) ?1 : 0 9535bd8deadSopenharmony_ci r[2] =(a1[2]< a2[2]) ?1 : 0 9545bd8deadSopenharmony_ci r[3] =(a1[3]< a2[3]) ?1 : 0 9555bd8deadSopenharmony_ci 9565bd8deadSopenharmony_ci 9575bd8deadSopenharmony_ciOP_CLAMP_EXT 3 S S,S,S r = ( a1 <= a2) ? a2 : 9585bd8deadSopenharmony_ci ( (a1>=a3) ? a3 : 9595bd8deadSopenharmony_ci (a1 )) 9605bd8deadSopenharmony_ci V S,S,S r[0]= ( a1 <= a2) ? a2 : 9615bd8deadSopenharmony_ci ( (a1>=a3) ? a3 : 9625bd8deadSopenharmony_ci (a1 )) 9635bd8deadSopenharmony_ci r[1]= ( a1 <= a2) ? a2 : 9645bd8deadSopenharmony_ci ( (a1>=a3) ? a3 : 9655bd8deadSopenharmony_ci (a1 )) 9665bd8deadSopenharmony_ci r[2]= ( a1 <= a2) ? a2 : 9675bd8deadSopenharmony_ci ( (a1>=a3) ? a3 : 9685bd8deadSopenharmony_ci (a1 )) 9695bd8deadSopenharmony_ci r[3]= ( a1 <= a2) ? a2 : 9705bd8deadSopenharmony_ci ( (a1>=a3) ? a3 : 9715bd8deadSopenharmony_ci (a1 )) 9725bd8deadSopenharmony_ci V V,S,S r[0]= ( a1[0] <= a2) ? a2 : 9735bd8deadSopenharmony_ci ( (a1[0]>=a3) ? a3 : 9745bd8deadSopenharmony_ci (a1[0] )) 9755bd8deadSopenharmony_ci r[1]= ( a1[1] <= a2) ? a2 : 9765bd8deadSopenharmony_ci ( (a1[1]>=a3) ? a3 : 9775bd8deadSopenharmony_ci (a1[1] )) 9785bd8deadSopenharmony_ci r[2]= ( a1[2] <= a2) ? a2 : 9795bd8deadSopenharmony_ci ( (a1[2]>=a3) ? a3 : 9805bd8deadSopenharmony_ci (a1[2] )) 9815bd8deadSopenharmony_ci r[3]= ( a1[3] <= a2) ? a2 : 9825bd8deadSopenharmony_ci ( (a1[3]>=a3) ? a3 : 9835bd8deadSopenharmony_ci (a1[3] )) 9845bd8deadSopenharmony_ci V V,V,S r[0]= ( a1[0] <= a2[0]) ? a2[0] : 9855bd8deadSopenharmony_ci ( (a1[0]>=a3) ? a3 : 9865bd8deadSopenharmony_ci (a1[0] )) 9875bd8deadSopenharmony_ci r[1]= ( a1[1] <= a2[1]) ? a2[1] : 9885bd8deadSopenharmony_ci ( (a1[1]>=a3) ? a3 : 9895bd8deadSopenharmony_ci (a1[1] )) 9905bd8deadSopenharmony_ci r[2]= ( a1[2] <= a2[2]) ? a2[2] : 9915bd8deadSopenharmony_ci ( (a1[2]>=a3) ? a3 : 9925bd8deadSopenharmony_ci (a1[2] )) 9935bd8deadSopenharmony_ci r[3]= ( a1[3] <= a2[3]) ? a2[3] : 9945bd8deadSopenharmony_ci ( (a1[3]>=a3) ? a3 : 9955bd8deadSopenharmony_ci (a1[3] )) 9965bd8deadSopenharmony_ci V V,S,V r[0]= ( a1[0] <= a2) ? a2 : 9975bd8deadSopenharmony_ci ( (a1[0]>=a3[0]) ? a3[0] : 9985bd8deadSopenharmony_ci (a1[0] )) 9995bd8deadSopenharmony_ci r[1]= ( a1[1] <= a2) ? a2 : 10005bd8deadSopenharmony_ci ( (a1[1]>=a3[1]) ? a3[1] : 10015bd8deadSopenharmony_ci (a1[1] )) 10025bd8deadSopenharmony_ci r[2]= ( a1[2] <= a2) ? a2 : 10035bd8deadSopenharmony_ci ( (a1[2]>=a3[2]) ? a3[2] : 10045bd8deadSopenharmony_ci (a1[2] )) 10055bd8deadSopenharmony_ci r[3]= ( a1[3] <= a2) ? a2 : 10065bd8deadSopenharmony_ci ( (a1[3]>=a3[3]) ? a3[3] : 10075bd8deadSopenharmony_ci (a1[3] )) 10085bd8deadSopenharmony_ci V V,V,V r[0]= ( a1[0] <= a2[0]) ? a2[0] : 10095bd8deadSopenharmony_ci ( (a1[0]>=a3[0]) ? a3[0] : 10105bd8deadSopenharmony_ci (a1[0] )) 10115bd8deadSopenharmony_ci r[1]= ( a1[1] <= a2[1]) ? a2[1] : 10125bd8deadSopenharmony_ci ( (a1[1]>=a3[1]) ? a3[1] : 10135bd8deadSopenharmony_ci (a1[1] )) 10145bd8deadSopenharmony_ci r[2]= ( a1[2] <= a2[2]) ? a2[2] : 10155bd8deadSopenharmony_ci ( (a1[2]>=a3[2]) ? a3[2] : 10165bd8deadSopenharmony_ci (a1[2] )) 10175bd8deadSopenharmony_ci r[3]= ( a1[3] <= a2[3]) ? a2[3] : 10185bd8deadSopenharmony_ci ( (a1[3]>=a3[3]) ? a3[3] : 10195bd8deadSopenharmony_ci (a1[3] )) 10205bd8deadSopenharmony_ci 10215bd8deadSopenharmony_ciOP_FLOOR_EXT 1 S S r = FLOOR(a1) 10225bd8deadSopenharmony_ci V S r[0] = FLOOR(a1) 10235bd8deadSopenharmony_ci r[1] = FLOOR(a1) 10245bd8deadSopenharmony_ci r[2] = FLOOR(a1) 10255bd8deadSopenharmony_ci r[3] = FLOOR(a1) 10265bd8deadSopenharmony_ci V V r[0] = FLOOR(a1[0]) 10275bd8deadSopenharmony_ci r[1] = FLOOR(a1[1]) 10285bd8deadSopenharmony_ci r[2] = FLOOR(a1[2]) 10295bd8deadSopenharmony_ci r[3] = FLOOR(a1[3]) 10305bd8deadSopenharmony_ci 10315bd8deadSopenharmony_ciOP_ROUND_EXT 1 S S r = FLOOR(a1 + 0.5) 10325bd8deadSopenharmony_ci V S r[0] = FLOOR(a1 + 0.5) 10335bd8deadSopenharmony_ci r[1] = FLOOR(a1 + 0.5) 10345bd8deadSopenharmony_ci r[2] = FLOOR(a1 + 0.5) 10355bd8deadSopenharmony_ci r[3] = FLOOR(a1 + 0.5) 10365bd8deadSopenharmony_ci V V r[0] = FLOOR(a1[0] + 0.5) 10375bd8deadSopenharmony_ci r[1] = FLOOR(a1[1] + 0.5) 10385bd8deadSopenharmony_ci r[2] = FLOOR(a1[2] + 0.5) 10395bd8deadSopenharmony_ci r[3] = FLOOR(a1[3] + 0.5) 10405bd8deadSopenharmony_ci 10415bd8deadSopenharmony_ciOP_EXP_BASE_2_EXT 1 S S r = 2 ^ a1 10425bd8deadSopenharmony_ci 10435bd8deadSopenharmony_ciOP_LOG_BASE_2_EXT 1 S S r = (a1==0) ? MINUS_INF : 10445bd8deadSopenharmony_ci LOG2(a1) 10455bd8deadSopenharmony_ci r is undefined if a1 < 0 10465bd8deadSopenharmony_ci 10475bd8deadSopenharmony_ciOP_POWER_EXT 2 S S,S r = a1 ^ a2 10485bd8deadSopenharmony_ci r is undefined if a1 < 0 10495bd8deadSopenharmony_ci and -1 < a2 < 1 10505bd8deadSopenharmony_ci 10515bd8deadSopenharmony_ciOP_RECIP_EXT 1 S S r = (a1==0) ? INF : 10525bd8deadSopenharmony_ci 1.0 / a1 10535bd8deadSopenharmony_ci 10545bd8deadSopenharmony_ciOP_RECIP_SQRT_EXT 1 S S r = (a1==0) ? INF : 10555bd8deadSopenharmony_ci 1.0 / SQRT(a1) 10565bd8deadSopenharmony_ci r is undefined if a1 < 0 10575bd8deadSopenharmony_ci 10585bd8deadSopenharmony_ciOP_SUB_EXT 2 S S,S r = a1 - a2 10595bd8deadSopenharmony_ci V S,S r[0] = a1 - a2 10605bd8deadSopenharmony_ci r[1] = a1 - a2 10615bd8deadSopenharmony_ci r[2] = a1 - a2 10625bd8deadSopenharmony_ci r[3] = a1 - a2 10635bd8deadSopenharmony_ci V S,V r[0] = a1 - a2[0] 10645bd8deadSopenharmony_ci r[1] = a1 - a2[1] 10655bd8deadSopenharmony_ci r[2] = a1 - a2[1] 10665bd8deadSopenharmony_ci r[3] = a1 - a2[3] 10675bd8deadSopenharmony_ci V V,S r[0] = a1[0] - a2 10685bd8deadSopenharmony_ci r[1] = a1[1] - a2 10695bd8deadSopenharmony_ci r[2] = a1[2] - a2 10705bd8deadSopenharmony_ci r[3] = a1[3] - a2 10715bd8deadSopenharmony_ci V V,V r[0] = a1[0] - a2[0] 10725bd8deadSopenharmony_ci r[1] = a1[1] - a2[1] 10735bd8deadSopenharmony_ci r[2] = a1[2] - a2[2] 10745bd8deadSopenharmony_ci r[3] = a1[3] - a2[3] 10755bd8deadSopenharmony_ci 10765bd8deadSopenharmony_ciOP_CROSS_PRODUCT_EXT 2 V V,V r[0] = a1[1] * a2[2] - 10775bd8deadSopenharmony_ci a2[1] * a1[2] 10785bd8deadSopenharmony_ci r[1] = a1[2] * a2[0] - 10795bd8deadSopenharmony_ci a2[2] * a1[0] 10805bd8deadSopenharmony_ci r[2] = a1[0] * a2[1] - 10815bd8deadSopenharmony_ci a2[0] * a1[1] 10825bd8deadSopenharmony_ci r[3] = 1 10835bd8deadSopenharmony_ci 10845bd8deadSopenharmony_ciOP_MULTIPLY_MATRIX_EXT 2 V M,V r[0] = a2[0] * a1[0] + 10855bd8deadSopenharmony_ci a2[1] * a1[4] + 10865bd8deadSopenharmony_ci a2[2] * a1[8] + 10875bd8deadSopenharmony_ci a2[3] * a1[12] 10885bd8deadSopenharmony_ci r[1] = a2[0] * a1[1] + 10895bd8deadSopenharmony_ci a2[1] * a1[5] + 10905bd8deadSopenharmony_ci a2[2] * a1[9] + 10915bd8deadSopenharmony_ci a2[3] * a1[13] 10925bd8deadSopenharmony_ci r[2] = a2[0] * a1[2] + 10935bd8deadSopenharmony_ci a2[1] * a1[6] + 10945bd8deadSopenharmony_ci a2[2] * a1[10] + 10955bd8deadSopenharmony_ci a2[3] * a1[14] 10965bd8deadSopenharmony_ci r[3] = a2[0] * a1[3] + 10975bd8deadSopenharmony_ci a2[1] * a1[7] + 10985bd8deadSopenharmony_ci a2[2] * a1[11] + 10995bd8deadSopenharmony_ci a2[3] * a1[15] 11005bd8deadSopenharmony_ci 11015bd8deadSopenharmony_ci 11025bd8deadSopenharmony_ci 11035bd8deadSopenharmony_ci 11045bd8deadSopenharmony_ci A special operation is OP_INDEX_EXT. It is special in that it 11055bd8deadSopenharmony_ci indexes a contiguous block of ids generated by a single call to 11065bd8deadSopenharmony_ci GenSymbolsEXT. The value placed in res is the data item 11075bd8deadSopenharmony_ci represented by: 11085bd8deadSopenharmony_ci 11095bd8deadSopenharmony_ci arg2 + int( value(arg1) ) 11105bd8deadSopenharmony_ci 11115bd8deadSopenharmony_ci This allows data to be indexed on a per-vertex basis. The results 11125bd8deadSopenharmony_ci are undefined if the offset is outside the range of the ids 11135bd8deadSopenharmony_ci returned by the single call to GenSymbolsEXT. 11145bd8deadSopenharmony_ci Additionally vector data can be rearranged by using the 11155bd8deadSopenharmony_ci following call: 11165bd8deadSopenharmony_ci 11175bd8deadSopenharmony_ci void SwizzleEXT( uint res, uint in, enum outX, enum outY, enum outZ 11185bd8deadSopenharmony_ci enum outW ) 11195bd8deadSopenharmony_ci 11205bd8deadSopenharmony_ci where in can be any vector value (VARIANT_EXT, 11215bd8deadSopenharmony_ci GLOBAL_CONSTANT_EXT, LOCAL_CONSTANT_EXT, or LOCAL_EXT), and outX, 11225bd8deadSopenharmony_ci outY, outZ, and outW may be one of X_EXT, Y_EXT, Z_EXT, W_EXT, 11235bd8deadSopenharmony_ci NEGATIVE_X_EXT, NEGATIVE_Y_EXT, NEGATIVE_Z_EXT, NEGATIVE_W_EXT, 11245bd8deadSopenharmony_ci ZERO_EXT, ONE_EXT, and NEGATIVE_ONE_EXT, and res is one of 11255bd8deadSopenharmony_ci OUTPUT_VERTEX_EXT, OUTPUT_COLOR#_EXT, OUTPUT_TEXTURE_COORD#_EXT, 11265bd8deadSopenharmony_ci or a data id defined by GenSymbolsEXT (with it's storage type 11275bd8deadSopenharmony_ci set as LOCAL_EXT). The out[XYZW] parameters specify what value 11285bd8deadSopenharmony_ci should be placed in the res vector. 11295bd8deadSopenharmony_ci Vector data can also be masked by using the following call: 11305bd8deadSopenharmony_ci 11315bd8deadSopenharmony_ci void WriteMaskEXT( unint res, uint in, enum outX, enum outY, 11325bd8deadSopenharmony_ci enum outZ, enum outW ) 11335bd8deadSopenharmony_ci 11345bd8deadSopenharmony_ci where in is a vector value out[XYZW] are either GL_TRUE or 11355bd8deadSopenharmony_ci GL_FALSE, and res is one of OUTPUT_VERTEX_EXT, OUTPUT_COLOR#_EXT, 11365bd8deadSopenharmony_ci OUTPUT_TEXTURE_COORD#_EXT, or a data id defined by GenSymbolsEXT 11375bd8deadSopenharmony_ci (with it's storage type set as LOCAL_EXT). For each output 11385bd8deadSopenharmony_ci component marked TRUE, the source is copied into the destination, 11395bd8deadSopenharmony_ci and for all components marked FALSE, the destination component 11405bd8deadSopenharmony_ci is unchanged. 11415bd8deadSopenharmony_ci Individual components of vector and matrix data can be 11425bd8deadSopenharmony_ci accessed and modified by the following operations: 11435bd8deadSopenharmony_ci 11445bd8deadSopenharmony_ci void InsertComponentEXT( uint res, uint src, uint num ) 11455bd8deadSopenharmony_ci void ExtractComponentEXT( uint res, uint src, uint num ) 11465bd8deadSopenharmony_ci 11475bd8deadSopenharmony_ci InsertComponentEXT allows a scalar within a vector or a vector 11485bd8deadSopenharmony_ci within a matrix to be replaced. If src is a scalar, then res must 11495bd8deadSopenharmony_ci be a vector, and if src is a vector, res must be a matrix. The 11505bd8deadSopenharmony_ci num parameter controls which scalar or vector will be replaced. 11515bd8deadSopenharmony_ci The mappings are as follows: 11525bd8deadSopenharmony_ci 11535bd8deadSopenharmony_ci Num Type Operation 11545bd8deadSopenharmony_ci ------ ---- ------------------- 11555bd8deadSopenharmony_ci 0 S res[0] = src 11565bd8deadSopenharmony_ci 0 V res[0] = src[0] 11575bd8deadSopenharmony_ci res[4] = src[1] 11585bd8deadSopenharmony_ci res[8] = src[2] 11595bd8deadSopenharmony_ci res[12] = src[3] 11605bd8deadSopenharmony_ci 11615bd8deadSopenharmony_ci 1 S res[1] = src 11625bd8deadSopenharmony_ci 1 V res[1] = src[0] 11635bd8deadSopenharmony_ci res[5] = src[1] 11645bd8deadSopenharmony_ci res[9] = src[2] 11655bd8deadSopenharmony_ci res[13] = src[3] 11665bd8deadSopenharmony_ci 11675bd8deadSopenharmony_ci 2 S res[2] = src 11685bd8deadSopenharmony_ci 2 V res[2] = src[0] 11695bd8deadSopenharmony_ci res[6] = src[1] 11705bd8deadSopenharmony_ci res[10] = src[2] 11715bd8deadSopenharmony_ci res[14] = src[3] 11725bd8deadSopenharmony_ci 11735bd8deadSopenharmony_ci 3 S res[3] = src 11745bd8deadSopenharmony_ci 3 V res[3] = src[0] 11755bd8deadSopenharmony_ci res[7] = src[1] 11765bd8deadSopenharmony_ci res[11] = src[2] 11775bd8deadSopenharmony_ci res[15] = src[3] 11785bd8deadSopenharmony_ci 11795bd8deadSopenharmony_ci If the num parameter is greater than 3, the error INVALID_VALUE is 11805bd8deadSopenharmony_ci generated. The opposite capability is provided by 11815bd8deadSopenharmony_ci ExtractComponentEXT. Its arguments are either a matrix src and a 11825bd8deadSopenharmony_ci vector res, or a vector src and a scalar res. Other combinations 11835bd8deadSopenharmony_ci result in the error ILLEGAL_OPERATION. As with InsertComponentEXT, 11845bd8deadSopenharmony_ci values for num greater than 3 generate the error INVALID_VALUE. 11855bd8deadSopenharmony_ci 11865bd8deadSopenharmony_ci There are four resources consumed when loading a vertex shader 11875bd8deadSopenharmony_ci program: instruction storage, variant storage, constant storage, 11885bd8deadSopenharmony_ci and local storage. The maximum values for these resources in a 11895bd8deadSopenharmony_ci software implementation may be queried by calling GetIntegerv, 11905bd8deadSopenharmony_ci GetFloatv, and GetDoublev with MAX_VERTEX_SHADER_INSTRUCTIONS_EXT, 11915bd8deadSopenharmony_ci MAX_VERTEX_SHADER_VARIANTS_EXT, MAX_VERTEX_SHADER_INVARIANTS_EXT, 11925bd8deadSopenharmony_ci MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT, and 11935bd8deadSopenharmony_ci MAX_VERTEX_SHADER_LOCALS_EXT respectively. Since a software 11945bd8deadSopenharmony_ci implementation may co-exist with a hardware implementation with 11955bd8deadSopenharmony_ci stricter resource limitations the resources available for a 11965bd8deadSopenharmony_ci hardware implementation may be queried separately using 11975bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT, 11985bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT, 11995bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT, 12005bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT, and 12015bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT. In implementations that 12025bd8deadSopenharmony_ci operate purely in SW or purely in HW, these numbers may be 12035bd8deadSopenharmony_ci identical to the max values. The number of these resources 12045bd8deadSopenharmony_ci consumed by the current vertex shader program may be queried by 12055bd8deadSopenharmony_ci calling GetIntegerv, GetFloatv, and GetDoublev with 12065bd8deadSopenharmony_ci VERTEX_SHADER_INSTRUCTIONS_EXT, VERTEX_SHADER_VARIANTS_EXT, 12075bd8deadSopenharmony_ci VERTEX_SHADER_LOCAL_CONSTANTS_EXT, VERTEX_SHADER_INVARIANTS_EXT, 12085bd8deadSopenharmony_ci and VERTEX_SHADER_LOCALS_EXT. 12095bd8deadSopenharmony_ci Additionally, an implementation reports where a vertex shader 12105bd8deadSopenharmony_ci program falls within all the optimized limits by a query of 12115bd8deadSopenharmony_ci VERTEX_SHADER_OPTIMIZED_EXT. This boolean value will be true 12125bd8deadSopenharmony_ci if the vertex shader program consumes less than the maximum 12135bd8deadSopenharmony_ci optimizable resources in all catagories. This value is provided 12145bd8deadSopenharmony_ci as a convenient shortcut for a common operation. 12155bd8deadSopenharmony_ci Should a vertex shader program not fit within the 12165bd8deadSopenharmony_ci implementation defined limits, then the program is considered 12175bd8deadSopenharmony_ci undefined. When a vertex is submitted to an undefined program 12185bd8deadSopenharmony_ci vertex shaders are implicitly disabled and GL per-vertex 12195bd8deadSopenharmony_ci processing applies. 12205bd8deadSopenharmony_ci The methods employed for counting operations and data 12215bd8deadSopenharmony_ci usage are not intended to be identical from implementation to 12225bd8deadSopenharmony_ci implementation. Instead, the reported totals should be based 12235bd8deadSopenharmony_ci on micro-ops. The micro-ops represent the cost of the operation 12245bd8deadSopenharmony_ci or data-type for the particular implementation. As a result, 12255bd8deadSopenharmony_ci certain operations may take zero or multiple micro-ops. The 12265bd8deadSopenharmony_ci only requirement is that micro-ops always be reported in a 12275bd8deadSopenharmony_ci consistent manner, even if the vertex shader programs can be 12285bd8deadSopenharmony_ci potentially implemented by different hardware." 12295bd8deadSopenharmony_ci 12305bd8deadSopenharmony_ci 12315bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization): 12325bd8deadSopenharmony_ci 12335bd8deadSopenharmony_ci None 12345bd8deadSopenharmony_ci 12355bd8deadSopenharmony_ciAdditions to Chapter 4: 12365bd8deadSopenharmony_ci 12375bd8deadSopenharmony_ci None 12385bd8deadSopenharmony_ci 12395bd8deadSopenharmony_ciAdditions to Chapter 5: 12405bd8deadSopenharmony_ci 12415bd8deadSopenharmony_ci None 12425bd8deadSopenharmony_ci 12435bd8deadSopenharmony_ciAdditions to Chapter 6: 12445bd8deadSopenharmony_ci 12455bd8deadSopenharmony_ci - (New section after 6.1.11) User specified vertex processing queries 12465bd8deadSopenharmony_ci "The commands 12475bd8deadSopenharmony_ci 12485bd8deadSopenharmony_ci boolean IsVariantEnabledEXT( uint id, enum cap); 12495bd8deadSopenharmony_ci void GetVariantBooleanvEXT( uint id, enum value, boolean *data); 12505bd8deadSopenharmony_ci void GetVariantIntegervEXT( uint id, enum value, int *data); 12515bd8deadSopenharmony_ci void GetVariantFloatvEXT( uint id, enum value, float *data); 12525bd8deadSopenharmony_ci void GetVariantPointervEXT( uint id, enum value, void **data); 12535bd8deadSopenharmony_ci void GetInvariantBooleanvEXT( uint id, enum value, boolean *data); 12545bd8deadSopenharmony_ci void GetInvariantIntegervEXT( uint id, enum value, int *data); 12555bd8deadSopenharmony_ci void GetInvariantFloatvEXT( uint id, enum value, float *data); 12565bd8deadSopenharmony_ci void GetLocalConstantBooleanvEXT( uint id, enum value, boolean *data); 12575bd8deadSopenharmony_ci void GetLocalConstantIntegervEXT( uint id, enum value, int *data); 12585bd8deadSopenharmony_ci void GetLocalConstantFloatvEXT( uint id, enum value, float *data); 12595bd8deadSopenharmony_ci 12605bd8deadSopenharmony_ci are used to retrieve state relating to symbols used in vertex 12615bd8deadSopenharmony_ci shader programs. They take the id of the symbol for which 12625bd8deadSopenharmony_ci information is being queried. If the symbol is invalid in the 12635bd8deadSopenharmony_ci present shader or the storage type is inconsistent with the 12645bd8deadSopenharmony_ci called function the error INVALID_VALUE is generated. All 12655bd8deadSopenharmony_ci values returned are in the context of the presently bound vertex 12665bd8deadSopenharmony_ci shader." 12675bd8deadSopenharmony_ci 12685bd8deadSopenharmony_ciAdditions to the GLX Specification 12695bd8deadSopenharmony_ci 12705bd8deadSopenharmony_ci Unknown 12715bd8deadSopenharmony_ci 12725bd8deadSopenharmony_ciGLX Protocol 12735bd8deadSopenharmony_ci 12745bd8deadSopenharmony_ci Unknown 12755bd8deadSopenharmony_ci 12765bd8deadSopenharmony_ciErrors 12775bd8deadSopenharmony_ci 12785bd8deadSopenharmony_ciINVALID_VALUE is generated if the <num> parameter to InsertComponentEXT or 12795bd8deadSopenharmony_ciExtractComponentEXT is grater than 3. 12805bd8deadSopenharmony_ci 12815bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if the <src> parameter to InsertComponentsEXT 12825bd8deadSopenharmony_ciis of type VECTOR_EXT and the <res> parameter is not of type MATRIX_EXT. 12835bd8deadSopenharmony_ci 12845bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if the <src> parameter to InsertComponentsEXT 12855bd8deadSopenharmony_ciis of type SCALAR_EXT and the <res> parameter is not of type VECTOR_EXT. 12865bd8deadSopenharmony_ci 12875bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if the <src> parameter to ExtractComponentsEXT 12885bd8deadSopenharmony_ciis of type VECTOR_EXT and the <res> parameter is not of type SCALAR_EXT. 12895bd8deadSopenharmony_ci 12905bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if the <src> parameter to ExtractComponentsEXT 12915bd8deadSopenharmony_ciis of type MATRIX_EXT and the <res> parameter is not of type VECTOR_EXT. 12925bd8deadSopenharmony_ci 12935bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if the SetLocalConstantEXT is used multiple 12945bd8deadSopenharmony_citimes on a single symbol in the context of defining a shader. 12955bd8deadSopenharmony_ci 12965bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if the arguments provided to ShaderOpEXT are 12975bd8deadSopenharmony_ciinconsistent with the table of operations. An example would be specifying 12985bd8deadSopenharmony_cia SCALAR_EXT result to the addition of 2 vectors. 12995bd8deadSopenharmony_ci 13005bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if the datatype of the <res> or <in> 13015bd8deadSopenharmony_ciparameters to WriteMaskEXT or SwizzleEXT is not VECTOR_EXT. 13025bd8deadSopenharmony_ci 13035bd8deadSopenharmony_ciILLEGAL_OPERATION is generated if if the <res> parameter of ShaderOPEXT, 13045bd8deadSopenharmony_ciSwizzleEXT, or WriteMaskEXT does is not a local or output storage type. 13055bd8deadSopenharmony_ci 13065bd8deadSopenharmony_ciNew State 13075bd8deadSopenharmony_ci 13085bd8deadSopenharmony_ciAdded after Table 6.27 Vertex Shader State: 13095bd8deadSopenharmony_ci 13105bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attribute 13115bd8deadSopenharmony_ci ---------------------------- ------------- ------- --------------- -------------- 13125bd8deadSopenharmony_ci VERTEX_SHADER_INSTRUCTIONS_EXT GetIntegerv Z+ 0 - 13135bd8deadSopenharmony_ci VERTEX_SHADER_VARIANTS_EXT GetIntegerv Z+ 0 - 13145bd8deadSopenharmony_ci VERTEX_SHADER_INVARIANTS_EXT GetIntegerv Z+ 0 - 13155bd8deadSopenharmony_ci VERTEX_SHADER_LOCAL_CONSTANTS_EXT GetIntegerv Z+ 0 - 13165bd8deadSopenharmony_ci VERTEX_SHADER_LOCALS_EXT GetIntegerv Z+ 0 - 13175bd8deadSopenharmony_ci VERTEX_SHADER_OPTIMIZED_EXT GetBooleanv Z+ False - 13185bd8deadSopenharmony_ci VERTEX_SHADER_EXT IsEnabled B False - 13195bd8deadSopenharmony_ci VERTEX_SHADER_BINDING_EXT GetIntegerv Z+ 0 - 13205bd8deadSopenharmony_ci 13215bd8deadSopenharmony_ciAdded new Table Vertex Shader symbol state: 13225bd8deadSopenharmony_ci 13235bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Attribute 13245bd8deadSopenharmony_ci ---------------------------- ------------- ------- --------------- -------------- 13255bd8deadSopenharmony_ci VARIANT_VALUE_EXT GetVariantFloatv n * R Undefined - 13265bd8deadSopenharmony_ci VARIANT_DATATYPE_EXT GetVariantIntegerv Z Undefined - 13275bd8deadSopenharmony_ci VARIANT_ARRAY_STRIDE_EXT GetVariantIntegerv Z 0 - 13285bd8deadSopenharmony_ci VARIANT_ARRAY_TYPE_EXT GetVariantIntegerv Z8 FLOAT - 13295bd8deadSopenharmony_ci VARIANT_ARRAY_POINTER_EXT GetVariantPointerv Y 0 - 13305bd8deadSopenharmony_ci VARIANT_ARRAY_EXT IsEnabled B FALSE - 13315bd8deadSopenharmony_ci INVARIANT_VALUE_EXT GetInvariantFloatv n * R Undefined - 13325bd8deadSopenharmony_ci INVARIANT_DATATYPE_EXT GetInvariantIntegerv Z Undefined - 13335bd8deadSopenharmony_ci LOCAL_CONSTANT_VALUE_EXT GetLocalConstantFloatv n * R Undefined - 13345bd8deadSopenharmony_ci LOCAL_CONSTANT_DATATYPE_EXT GetLocalConstantIntegerv n * R Undefined - 13355bd8deadSopenharmony_ci 13365bd8deadSopenharmony_ci 13375bd8deadSopenharmony_ciNew Implementation Dependent State 13385bd8deadSopenharmony_ci 13395bd8deadSopenharmony_ci Get Value Get Command Type Minimum Value 13405bd8deadSopenharmony_ci --------------------------------------- ------------- ------- --------------- 13415bd8deadSopenharmony_ci MAX_VERTEX_SHADER_INSTRUCTIONS_EXT GetIntegerv Z+ 32 13425bd8deadSopenharmony_ci MAX_VERTEX_SHADER_VARIANTS_EXT GetIntegerv Z+ 4 13435bd8deadSopenharmony_ci MAX_VERTEX_SHADER_INVARIANTS_EXT GetIntegerv Z+ 16 13445bd8deadSopenharmony_ci MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT GetIntegerv Z+ 8 13455bd8deadSopenharmony_ci MAX_VERTEX_SHADER_LOCALS_EXT GetIntegerv Z+ 4 13465bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT GetIntegerv Z+ 32 13475bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT GetIntegerv Z+ 4 13485bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT GetIntegerv Z+ 16 13495bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT GetIntegerv Z+ 8 13505bd8deadSopenharmony_ci MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT GetIntegerv Z+ 4 13515bd8deadSopenharmony_ci 1352