15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_register_combiners2 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_register_combiners2 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Mark J. Kilgard, NVIDIA Corporation (mjk 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Thomas Roell 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciNotice 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Copyright NVIDIA Corporation, 2000, 2001, 2004. 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciIP Status 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci NVIDIA Proprietary. 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciStatus 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci Implemented. 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ciVersion 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ci NVIDIA Date: December 13, 2004 325bd8deadSopenharmony_ci Version 1.2 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ciNumber 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci 227 375bd8deadSopenharmony_ci 385bd8deadSopenharmony_ciDependencies 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci Written based on the wording of the OpenGL 1.2.1 specification. 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci Assumes support for the NV_register_combiners extension (version 1.4). 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ciOverview 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci The NV_register_combiners extension provides a powerful fragment 475bd8deadSopenharmony_ci coloring mechanism. This specification extends the register combiners 485bd8deadSopenharmony_ci functionality to support more color constant values that are unique 495bd8deadSopenharmony_ci for each general combiner stage. 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci The base register combiners functionality supports only two color 525bd8deadSopenharmony_ci constants. These two constants are available in every general 535bd8deadSopenharmony_ci combiner stage and in the final combiner. 545bd8deadSopenharmony_ci 555bd8deadSopenharmony_ci When many general combiner stages are supported, more than two 565bd8deadSopenharmony_ci unique color constants is often required. The obvious way to extend 575bd8deadSopenharmony_ci the register combiners is to add several more color constant 585bd8deadSopenharmony_ci registers. But adding new unique color constant registers is 595bd8deadSopenharmony_ci expensive for hardware implementation because every color constant 605bd8deadSopenharmony_ci register must be available as an input to any stage. 615bd8deadSopenharmony_ci 625bd8deadSopenharmony_ci In practice however, it is the total set of general combiner stages 635bd8deadSopenharmony_ci that requires more color constants, not each and every individual 645bd8deadSopenharmony_ci general combiner stage. Each individual general combiner stage 655bd8deadSopenharmony_ci typically requires only one or two color constants. 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci By keeping two color constant registers but making these two registers 685bd8deadSopenharmony_ci contain two unique color constant values for each general combiner 695bd8deadSopenharmony_ci stage, the hardware expense of supporting multiple color constants 705bd8deadSopenharmony_ci is minimized. Additionally, this scheme scales appropriately as 715bd8deadSopenharmony_ci more general combiner stages are added. 725bd8deadSopenharmony_ci 735bd8deadSopenharmony_ciIssues 745bd8deadSopenharmony_ci 755bd8deadSopenharmony_ci How do is compatibility maintained with the original register 765bd8deadSopenharmony_ci combiners? 775bd8deadSopenharmony_ci 785bd8deadSopenharmony_ci RESOLUTION: Initially, per general combiner stage constants are 795bd8deadSopenharmony_ci disabled and the register combiners operate as described in the 805bd8deadSopenharmony_ci original NV_register_combiners specification. A distinct "per 815bd8deadSopenharmony_ci stage constants" enable exposes this extension's new functionality. 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci Where do the final combiner color constant values come from? 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci RESOLUTION: When "per stage constants" is enabled, the final 865bd8deadSopenharmony_ci combiner color constants continue to use the constant colors set 875bd8deadSopenharmony_ci with glCombinerParameterfvNV. 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci Is the alpha component of the SECONDARY_COLOR_NV register now 905bd8deadSopenharmony_ci initialized with the expected interpolated secondary color's alpha 915bd8deadSopenharmony_ci component. 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci RESOLUTION: Yes, see Revision History for details. 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ciNew Procedures and Functions 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci void CombinerStageParameterfvNV(GLenum stage, 985bd8deadSopenharmony_ci GLenum pname, 995bd8deadSopenharmony_ci const GLfloat *params); 1005bd8deadSopenharmony_ci 1015bd8deadSopenharmony_ci void GetCombinerStageParameterfvNV(GLenum stage, 1025bd8deadSopenharmony_ci GLenum pname, 1035bd8deadSopenharmony_ci GLfloat *params); 1045bd8deadSopenharmony_ci 1055bd8deadSopenharmony_ciNew Tokens 1065bd8deadSopenharmony_ci 1075bd8deadSopenharmony_ci Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, 1085bd8deadSopenharmony_ci and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, 1095bd8deadSopenharmony_ci and GetDoublev: 1105bd8deadSopenharmony_ci 1115bd8deadSopenharmony_ci PER_STAGE_CONSTANTS_NV 0x8535 1125bd8deadSopenharmony_ci 1135bd8deadSopenharmony_ci Accepted by the <pname> parameter of CombinerStageParameterfvNV 1145bd8deadSopenharmony_ci and GetCombinerStageParameterfvNV: 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci CONSTANT_COLOR0_NV (see NV_register_combiners) 1175bd8deadSopenharmony_ci CONSTANT_COLOR1_NV (see NV_register_combiners) 1185bd8deadSopenharmony_ci 1195bd8deadSopenharmony_ci Accepted by the <stage> parameter of CombinerStageParameterfvNV and 1205bd8deadSopenharmony_ci GetCombinerStageParameterfvNV: 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci COMBINER0_NV (see NV_register_combiners) 1235bd8deadSopenharmony_ci COMBINER1_NV (see NV_register_combiners) 1245bd8deadSopenharmony_ci COMBINER2_NV (see NV_register_combiners) 1255bd8deadSopenharmony_ci COMBINER3_NV (see NV_register_combiners) 1265bd8deadSopenharmony_ci COMBINER4_NV (see NV_register_combiners) 1275bd8deadSopenharmony_ci COMBINER5_NV (see NV_register_combiners) 1285bd8deadSopenharmony_ci COMBINER6_NV (see NV_register_combiners) 1295bd8deadSopenharmony_ci COMBINER7_NV (see NV_register_combiners) 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.2 Specification (OpenGL Operation) 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci None 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.2 Specification (Rasterization) 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci -- Section 3.8.12 "Register Combiners Application" 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci Because the alpha component of the SECONDARY_COLOR_NV register is 1405bd8deadSopenharmony_ci well-defined now (see Revision History) to be the alpha value of csec, 1415bd8deadSopenharmony_ci STRIKE this sentence: 1425bd8deadSopenharmony_ci 1435bd8deadSopenharmony_ci "The initial value of the alpha portion of register SECONDARY_COLOR_NV 1445bd8deadSopenharmony_ci is undefined." 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci Add a paragraph immediately before section 3.8.12.1: 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci "The ccc0 and ccc1 values map to particular constant color values. 1495bd8deadSopenharmony_ci The ccc0 and ccc1 mappings depend on whether per-stage constants 1505bd8deadSopenharmony_ci are enabled or not. Per-stage constants are enabled and disabled 1515bd8deadSopenharmony_ci with the Enable and Disable commands using the symbolic constant 1525bd8deadSopenharmony_ci PER_STAGE_CONSTANTS_NV. 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci When per-stage constants are disabled, ccc0 and ccc1 are mapped to 1555bd8deadSopenharmony_ci the register combiners' global color constant values, gccc0 and 1565bd8deadSopenharmony_ci gccc1. 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci When per-stage constants are enabled, ccc0 and ccc1 depend 1595bd8deadSopenharmony_ci on the combiner stage that inputs the COLOR_CONSTANT0_NV and 1605bd8deadSopenharmony_ci COLOR_CONSTANT1_NV registers. Each general combiner stage # maps 1615bd8deadSopenharmony_ci ccc0 and ccc1 to the per-stage values s#ccc0 and s#ccc1 respectively. 1625bd8deadSopenharmony_ci The final combiner maps ccc0 and ccc1 to the values gccc0 and gccc1 1635bd8deadSopenharmony_ci (the same as if per-stage constants are disabled). 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci gccc0, gccc1, s#ccc0, and s#ccc1 are further described in the 1665bd8deadSopenharmony_ci following section." 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci -- Section 3.8.12.1 "Combiner Parameters" 1695bd8deadSopenharmony_ci 1705bd8deadSopenharmony_ci Change Table NV_register_combiners.3 to read "gccc0" instead of 1715bd8deadSopenharmony_ci "ccc0" and "gccc1" instead of "ccc1". 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci Change the first sentence of the last paragraph to read: 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci "The values gccc0 and gccc1 named by CONSTANT_COLOR0_NV and 1765bd8deadSopenharmony_ci CONSTANT_COLOR1_NV are global constant colors available for inputs to 1775bd8deadSopenharmony_ci the final combiner stage and, when per-stage constants is disabled, 1785bd8deadSopenharmony_ci to the general combiner stages." 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci Add the following after the last paragraph in the section: 1815bd8deadSopenharmony_ci 1825bd8deadSopenharmony_ci "Per-stage combiner parameters are specified by 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci void CombinerStageParameterfvNV(GLenum stage, 1855bd8deadSopenharmony_ci GLenum pname, 1865bd8deadSopenharmony_ci const GLfloat *params); 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci The <stage> parameter is a symbolic constant of the form 1895bd8deadSopenharmony_ci COMBINER<#>_NV, indicating the general combiner stage <#> whose 1905bd8deadSopenharmony_ci parameter named by <pname> is to be updated. <pname> must be either 1915bd8deadSopenharmony_ci CONSTANT_COLOR0_NV or CONSTANT_COLOR1_NV. <params> is a pointer 1925bd8deadSopenharmony_ci to a group of four values to which to set the indicated parameter. 1935bd8deadSopenharmony_ci The parameter names CONSTANT_COLOR0_NV and CONSTANT_COLOR1_NV 1945bd8deadSopenharmony_ci update the per-stage color constants s#ccc0 and s#ccc1 respectively 1955bd8deadSopenharmony_ci where # is the number of the specified general combiner stage. 1965bd8deadSopenharmony_ci The floating-point color values are clamped to the range [0,1] 1975bd8deadSopenharmony_ci when specified." 1985bd8deadSopenharmony_ci 1995bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.2 Specification (Per-Fragment Operations 2005bd8deadSopenharmony_ciand the Frame Buffer) 2015bd8deadSopenharmony_ci 2025bd8deadSopenharmony_ci None 2035bd8deadSopenharmony_ci 2045bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.2 Specification (Special Functions) 2055bd8deadSopenharmony_ci 2065bd8deadSopenharmony_ci None 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.2 Specification (State and State Requests) 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci -- Section 6.1.3 "Enumerated Queries" 2115bd8deadSopenharmony_ci 2125bd8deadSopenharmony_ci Add to the bottom of the list of function prototypes (page 183): 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci void GetCombinerStageParameterfvNV(GLenum stage, 2155bd8deadSopenharmony_ci GLenum pname, 2165bd8deadSopenharmony_ci GLfloat *params); 2175bd8deadSopenharmony_ci 2185bd8deadSopenharmony_ci Change the first sentence describing the register combiner queries 2195bd8deadSopenharmony_ci to mention GetCombinerStageParameterfvNV so the sentence reads: 2205bd8deadSopenharmony_ci 2215bd8deadSopenharmony_ci "The GetCombinerInputParameterfvNV, GetCombinerInputParameterivNV, 2225bd8deadSopenharmony_ci GetCombinerOutputParameterfvNV, GetCombinerOutputParameterivNV, 2235bd8deadSopenharmony_ci and GetCombinerStageParameterfvNV parameter <stage> may be one of 2245bd8deadSopenharmony_ci COMBINER0_NV, COMBINER1_NV, and so on, indicating which general 2255bd8deadSopenharmony_ci combiner stage to query." 2265bd8deadSopenharmony_ci 2275bd8deadSopenharmony_ciAdditions to the GLX Specification 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci None 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ciGLX Protocol 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci Two new GL commands are added. 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci The following rendering command is sent to the sever as part of a 2365bd8deadSopenharmony_ci glXRender request: 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci CombinerStageParameterfvNV 2395bd8deadSopenharmony_ci 2 12+4*n rendering command length 2405bd8deadSopenharmony_ci 2 4280 rendering command opcode 2415bd8deadSopenharmony_ci 4 ENUM stage 2425bd8deadSopenharmony_ci 4 ENUM pname 2435bd8deadSopenharmony_ci 0x852A n=4 GL_CONSANT_COLOR0_NV 2445bd8deadSopenharmony_ci 0x852B n=4 GL_CONSANT_COLOR1_NV 2455bd8deadSopenharmony_ci else n=0 2465bd8deadSopenharmony_ci 4*n LISTofFLOAT32 params 2475bd8deadSopenharmony_ci 2485bd8deadSopenharmony_ci The remaining command is a non-rendering command. This commands 2495bd8deadSopenharmony_ci is sent separately (i.e., not as part of a glXRender or glXRenderLarge 2505bd8deadSopenharmony_ci request), using the glXVendorPrivateWithReply request: 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci GetCombinerStageParameterfvNV 2535bd8deadSopenharmony_ci 1 CARD8 opcode (X assigned) 2545bd8deadSopenharmony_ci 1 17 GLX opcode (glXVendorPrivateWithReply) 2555bd8deadSopenharmony_ci 2 5 request length 2565bd8deadSopenharmony_ci 4 1327 vendor specific opcode 2575bd8deadSopenharmony_ci 4 GLX_CONTEXT_TAG context tag 2585bd8deadSopenharmony_ci 4 ENUM stage 2595bd8deadSopenharmony_ci 4 ENUM pname 2605bd8deadSopenharmony_ci => 2615bd8deadSopenharmony_ci 1 1 reply 2625bd8deadSopenharmony_ci 1 unused 2635bd8deadSopenharmony_ci 2 CARD16 sequence number 2645bd8deadSopenharmony_ci 4 m reply length, m = (n==1 ? 0 : n) 2655bd8deadSopenharmony_ci 4 unused 2665bd8deadSopenharmony_ci 4 CARD32 unused 2675bd8deadSopenharmony_ci 2685bd8deadSopenharmony_ci if (n=1) this follows: 2695bd8deadSopenharmony_ci 2705bd8deadSopenharmony_ci 4 FLOAT32 params 2715bd8deadSopenharmony_ci 12 unused 2725bd8deadSopenharmony_ci 2735bd8deadSopenharmony_ci otherwise this follows: 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ci 16 unused 2765bd8deadSopenharmony_ci n*4 LISTofFLOAT32 params 2775bd8deadSopenharmony_ci 2785bd8deadSopenharmony_ciErrors 2795bd8deadSopenharmony_ci 2805bd8deadSopenharmony_ci None 2815bd8deadSopenharmony_ci 2825bd8deadSopenharmony_ciNew State 2835bd8deadSopenharmony_ci 2845bd8deadSopenharmony_ciGet Value Type Get Command Initial Value Description Sec Attribute 2855bd8deadSopenharmony_ci---------------------- ---- ----------------------------- ------------- ------------------ -------- -------------- 2865bd8deadSopenharmony_ciPER_STAGE_CONSTANTS_NV B IsEnabled False enable for 3.8.12 texture/enable 2875bd8deadSopenharmony_ciCONSTANT_COLOR0_NV Cx# GetCombinerStageParameterfvNV 0,0,0,0 per-stage constant 3.8.12.1 texture 2885bd8deadSopenharmony_ci color zero 2895bd8deadSopenharmony_ciCONSTANT_COLOR1_NV Cx# GetCombinerStageParameterfvNV 0,0,0,0 per-stage constant 3.8.12.1 texture 2905bd8deadSopenharmony_ci color one 2915bd8deadSopenharmony_ci 2925bd8deadSopenharmony_ci[ where # is the value of MAX_GENERAL_COMBINERS_NV ] 2935bd8deadSopenharmony_ci 2945bd8deadSopenharmony_ciNew Implementation State 2955bd8deadSopenharmony_ci 2965bd8deadSopenharmony_ci None 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ciRevision History 2995bd8deadSopenharmony_ci 3005bd8deadSopenharmony_ci December 13, 2004: Assigned GLX protocl opcodes and fixed protocol 3015bd8deadSopenharmony_ci with help from Thomas Roell. 3025bd8deadSopenharmony_ci 3035bd8deadSopenharmony_ci Version 1.2 (February 11, 2004) - When describing the 3045bd8deadSopenharmony_ci per-fragment register initialization within the combiners, the 3055bd8deadSopenharmony_ci NV_register_combiners specification says "The initial value of the 3065bd8deadSopenharmony_ci alpha portion of register SECONDARY_COLOR_NV is undefined." While 3075bd8deadSopenharmony_ci this is true of NV1x GPUs, NV2x and beyond GPUs can properly 3085bd8deadSopenharmony_ci initialize the alpha component of the SECONDARY_COLOR_NV 3095bd8deadSopenharmony_ci register with the expected interpolated secondary color alpha. 3105bd8deadSopenharmony_ci Unfortunately, due to a driver bug, the alpha components was always 3115bd8deadSopenharmony_ci initialized to 1.0 in driver versions 56.90 (circa February 2004) 3125bd8deadSopenharmony_ci and before. Drivers subsequent to 56.90 have this problem fixed. 3135bd8deadSopenharmony_ci This specification is updated to indicate that SECONDARY_COLOR_NV 3145bd8deadSopenharmony_ci initialization is well-defined and what you would expect now. 3155bd8deadSopenharmony_ci 3165bd8deadSopenharmony_ci Version 1.1 (April 28, 2003) - The original specification failed 3175bd8deadSopenharmony_ci to specify what should happen if a color component parameter for 3185bd8deadSopenharmony_ci CombinerStageParameter*NV is outside the [0,1] range. Such values 3195bd8deadSopenharmony_ci should be clamped to the [0,1] range. 3205bd8deadSopenharmony_ci 3215bd8deadSopenharmony_ci NVIDIA drivers prior to May 2003 incorrectly failed to clamp color 3225bd8deadSopenharmony_ci component values specified with CombinerStageParameter*NV to [0,1]. 3235bd8deadSopenharmony_ci Instead, approximately "x-floor(x)" where x is a component value 3245bd8deadSopenharmony_ci is used for rendering. 325