15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_sample_locations 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_NV_sample_locations 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContact 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Jeff Bolz, NVIDIA Corporation (jbolz 'at' nvidia.com) 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciContributors 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Pat Brown, NVIDIA 165bd8deadSopenharmony_ci Mathias Heyer, NVIDIA 175bd8deadSopenharmony_ci 185bd8deadSopenharmony_ciStatus 195bd8deadSopenharmony_ci 205bd8deadSopenharmony_ci Shipping 215bd8deadSopenharmony_ci 225bd8deadSopenharmony_ciVersion 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ci Last Modified Date: March 27, 2015 255bd8deadSopenharmony_ci Revision: 2 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL Extension #472 305bd8deadSopenharmony_ci OpenGL ES Extension #235 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciDependencies 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci This extension is written against the OpenGL 4.3 specification 355bd8deadSopenharmony_ci (Compatibility Profile). 365bd8deadSopenharmony_ci 375bd8deadSopenharmony_ci This extension interacts with OpenGL ES 3.1. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ciOverview 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci This extension allows an application to modify the locations of samples 425bd8deadSopenharmony_ci within a pixel used in multisample rasterization. Additionally, it allows 435bd8deadSopenharmony_ci applications to specify different sample locations for each pixel in a 445bd8deadSopenharmony_ci group of adjacent pixels, which may increase antialiasing quality 455bd8deadSopenharmony_ci (particularly if a custom resolve shader is used that takes advantage of 465bd8deadSopenharmony_ci these different locations). 475bd8deadSopenharmony_ci 485bd8deadSopenharmony_ci It is common for implementations to optimize the storage of depth values 495bd8deadSopenharmony_ci by storing values that can be used to reconstruct depth at each sample 505bd8deadSopenharmony_ci location, rather than storing separate depth values for each sample. For 515bd8deadSopenharmony_ci example, the depth values from a single triangle can be represented using 525bd8deadSopenharmony_ci plane equations. When the depth value for a sample is needed, it is 535bd8deadSopenharmony_ci automatically evaluated at the sample location. Modifying the sample 545bd8deadSopenharmony_ci locations causes the reconstruction to no longer evaluate the same depth 555bd8deadSopenharmony_ci values as when the samples were originally generated. This extension 565bd8deadSopenharmony_ci provides a command to "resolve" and store per-sample depth values using 575bd8deadSopenharmony_ci the currently programmed sample locations, which allows the application to 585bd8deadSopenharmony_ci manage this issue if/when necessary. 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci The programmable sample locations are used during rasterization and for 615bd8deadSopenharmony_ci evaluation of depth functions during normal geometric rendering. The 625bd8deadSopenharmony_ci programmable locations are associated with a framebuffer object rather 635bd8deadSopenharmony_ci than an individual depth buffer, so if the depth buffer is used as a 645bd8deadSopenharmony_ci texture the texture sampling may be done at the standard sample 655bd8deadSopenharmony_ci locations. Additionally, commands that do not render geometric primitives 665bd8deadSopenharmony_ci (e.g. ReadPixels, BlitFramebuffer, CopyTexSubImage2D, etc.) may use the 675bd8deadSopenharmony_ci standard sample locations to resolve depth functions rather than the 685bd8deadSopenharmony_ci programmable locations. If a single depth buffer is used at different 695bd8deadSopenharmony_ci times with different sample locations, the depth functions may be 705bd8deadSopenharmony_ci interpreted using the current sample locations. 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ciNew Procedures and Functions 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci void FramebufferSampleLocationsfvNV(enum target, uint start, 755bd8deadSopenharmony_ci sizei count, const float *v); 765bd8deadSopenharmony_ci void NamedFramebufferSampleLocationsfvNV(uint framebuffer, uint start, 775bd8deadSopenharmony_ci sizei count, const float *v); 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci void ResolveDepthValuesNV(void); 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ciNew Tokens 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, 845bd8deadSopenharmony_ci GetInteger64v, GetFloatv, and GetDoublev: 855bd8deadSopenharmony_ci 865bd8deadSopenharmony_ci SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D 875bd8deadSopenharmony_ci SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E 885bd8deadSopenharmony_ci SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F 895bd8deadSopenharmony_ci PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 905bd8deadSopenharmony_ci 915bd8deadSopenharmony_ci Accepted by the <pname> parameter of GetMultisamplefv: 925bd8deadSopenharmony_ci 935bd8deadSopenharmony_ci // Alias of SAMPLE_POSITION. Before NV_expms, the spec used "location". 945bd8deadSopenharmony_ci SAMPLE_LOCATION_NV 0x8E50 955bd8deadSopenharmony_ci PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 965bd8deadSopenharmony_ci 975bd8deadSopenharmony_ci Accepted by the <pname> parameter of FramebufferParameteri, 985bd8deadSopenharmony_ci GetFramebufferParameteriv: 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 1015bd8deadSopenharmony_ci FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 1025bd8deadSopenharmony_ci 1035bd8deadSopenharmony_ciAdditions to Chapter 14 of the OpenGL 4.3 (Compatibility Profile) Specification 1045bd8deadSopenharmony_ci(Fixed-Function Primitive Assembly and Rasterization) 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci Modify Section 9.2.1 (Framebuffer Object Parameters), p. 297 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci Change the error: 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci "An INVALID_OPERATION error is generated if the default framebuffer is 1115bd8deadSopenharmony_ci bound to <target>." into "An INVALID_OPERATION error is generated if the 1125bd8deadSopenharmony_ci default framebuffer is bound to <target> and <pname> is neither 1135bd8deadSopenharmony_ci FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV nor 1145bd8deadSopenharmony_ci FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV." 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci Modify Section 9.2.3 (Framebuffer Object Queries), p. 298 1175bd8deadSopenharmony_ci 1185bd8deadSopenharmony_ci Change the error: 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci "An INVALID_OPERATION error is generated if the default framebuffer is 1215bd8deadSopenharmony_ci bound to <target>." into "An INVALID_OPERATION error is generated if the 1225bd8deadSopenharmony_ci default framebuffer is bound to <target> and <pname> is neither 1235bd8deadSopenharmony_ci FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV nor 1245bd8deadSopenharmony_ci FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV." 1255bd8deadSopenharmony_ci 1265bd8deadSopenharmony_ci Modify Section 14.3.1 (Multisampling), p. 478 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci Remove the paragraph describing "GetMultisamplefv", and append the 1295bd8deadSopenharmony_ci following to the section. 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci Each framebuffer has a set of default sample locations, depending on the 1325bd8deadSopenharmony_ci number of samples in the attachments or the value of FRAMEBUFFER_DEFAULT_- 1335bd8deadSopenharmony_ci SAMPLES (for framebuffer objects) or the number of samples in the pixel 1345bd8deadSopenharmony_ci format (for the default framebuffer). Each framebuffer also has a set of 1355bd8deadSopenharmony_ci programmable sample locations, which may be used instead of the default 1365bd8deadSopenharmony_ci sample locations. The programmable sample locations are controlled by the 1375bd8deadSopenharmony_ci commands: 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci void FramebufferSampleLocationsfvNV(enum target, uint start, 1405bd8deadSopenharmony_ci sizei count, const float *v); 1415bd8deadSopenharmony_ci void NamedFramebufferSampleLocationsfvNV(uint framebuffer, uint start, 1425bd8deadSopenharmony_ci sizei count, const float *v); 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci <target> or <framebuffer> selects the framebuffer whose programmable 1455bd8deadSopenharmony_ci sample locations are modified. There are <N> pairs of programmable sample 1465bd8deadSopenharmony_ci locations values in a framebuffer, where <N> is the value of 1475bd8deadSopenharmony_ci PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV. Each programmable sample 1485bd8deadSopenharmony_ci location is specified as a pair of floating point values in the range 1495bd8deadSopenharmony_ci [0,1], corresponding to the x and y locations respectively in GL pixel 1505bd8deadSopenharmony_ci space. (0.5, 0.5) thus corresponds to the pixel center. Sample locations 1515bd8deadSopenharmony_ci outside of [0,1] result in undefined behavior. These commands accept 1525bd8deadSopenharmony_ci <count> pairs of values in <v> and update locations for samples <start> to 1535bd8deadSopenharmony_ci <start>+<count>-1. The location for sample <i> is taken from 1545bd8deadSopenharmony_ci v[2*(i-start)] and v[2*(i-start)+1]. 1555bd8deadSopenharmony_ci 1565bd8deadSopenharmony_ci Errors: 1575bd8deadSopenharmony_ci 1585bd8deadSopenharmony_ci An INVALID_VALUE error is generated if the sum of <start> and <count> is 1595bd8deadSopenharmony_ci greater than PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV. 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci Default and programmable sample locations may be queried with the command: 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ci void GetMultisamplefv(enum pname, uint index, float *val); 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci <index> corresponds to which sample location should be returned, and the 1665bd8deadSopenharmony_ci sample location is returned as two floating-point values in val[0] and 1675bd8deadSopenharmony_ci val[1]. If <pname> is SAMPLE_LOCATION_NV (aliasing SAMPLE_POSITION), 1685bd8deadSopenharmony_ci a default sample location is returned and <index> must be less than 1695bd8deadSopenharmony_ci the value of SAMPLES. If <pname> is PROGRAMMABLE_SAMPLE_LOCATION_NV, 1705bd8deadSopenharmony_ci a programmable sample location is returned and <index> must be less 1715bd8deadSopenharmony_ci than the value of PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV. 1725bd8deadSopenharmony_ci 1735bd8deadSopenharmony_ci Sample locations are rounded on use to the precision indicated by the value 1745bd8deadSopenharmony_ci of SAMPLE_LOCATION_SUBPIXEL_BITS_NV (i.e. rounded to the nearest 1755bd8deadSopenharmony_ci 2^{-subpixelbits}). This precision may depend on the number of samples in 1765bd8deadSopenharmony_ci the framebuffer. The initial programmable sample locations are all 1775bd8deadSopenharmony_ci (0.5,0.5). 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci Errors: 1805bd8deadSopenharmony_ci 1815bd8deadSopenharmony_ci An INVALID_ENUM error is generated if <target> is not 1825bd8deadSopenharmony_ci DRAW_FRAMEBUFFER, READ_FRAMEBUFFER, or FRAMEBUFFER. 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ci An INVALID_OPERATION error is generated by 1855bd8deadSopenharmony_ci NamedFramebufferSampleLocationsfvNV if <framebuffer> is not 1865bd8deadSopenharmony_ci the name of an existing framebuffer object. 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci An INVALID_VALUE error is generated if <pname> is SAMPLE_LOCATION_NV 1895bd8deadSopenharmony_ci and <index> is greater than or equal to the value of SAMPLES. 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci An INVALID_VALUE error is generated if <pname> is 1925bd8deadSopenharmony_ci PROGRAMMABLE_SAMPLE_LOCATION_NV and <index> is greater than or equal 1935bd8deadSopenharmony_ci to the value of PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV. 1945bd8deadSopenharmony_ci 1955bd8deadSopenharmony_ci An INVALID_ENUM error is generated if <pname> is not 1965bd8deadSopenharmony_ci SAMPLE_LOCATION_NV or PROGRAMMABLE_SAMPLE_LOCATION_NV. 1975bd8deadSopenharmony_ci 1985bd8deadSopenharmony_ci Programmable sample locations are enabled by calling FramebufferParameteri 1995bd8deadSopenharmony_ci with a <pname> of FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV and a 2005bd8deadSopenharmony_ci non-zero value of <param>. The initial value of FRAMEBUFFER_PROGRAMMABLE_- 2015bd8deadSopenharmony_ci SAMPLE_LOCATIONS_NV is zero. 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ci Programmable sample locations can vary across pixels, based on the pixel x 2045bd8deadSopenharmony_ci and y coordinate. A framebuffer has a sample location pixel grid which may 2055bd8deadSopenharmony_ci depend on the number of samples. This grid size can be queried by calling 2065bd8deadSopenharmony_ci GetIntegerv with a <pname> of SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV and 2075bd8deadSopenharmony_ci SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV, which returns the grid dimensions for 2085bd8deadSopenharmony_ci the draw framebuffer. 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci If FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV is enabled and the 2115bd8deadSopenharmony_ci framebuffer parameter FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV is enabled 2125bd8deadSopenharmony_ci (non-zero), sample locations are selected as follows: 2135bd8deadSopenharmony_ci 2145bd8deadSopenharmony_ci grid_x = value of SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV; 2155bd8deadSopenharmony_ci grid_y = value of SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV; 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ci pixel_x = <window x coordinate> mod grid_x; 2185bd8deadSopenharmony_ci pixel_y = <window y coordinate> mod grid_y; 2195bd8deadSopenharmony_ci 2205bd8deadSopenharmony_ci num_samples = value of SAMPLES; 2215bd8deadSopenharmony_ci sample_i = (pixel_y*grid_x + pixel_x)*num_samples + sample_index; 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci float *table = FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV; 2245bd8deadSopenharmony_ci sample_location.xy = (table[2*sample_i], table[2*sample_i+1]); 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci If FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV is enabled and 2275bd8deadSopenharmony_ci FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV is disabled, sample locations are 2285bd8deadSopenharmony_ci selected as follows: 2295bd8deadSopenharmony_ci 2305bd8deadSopenharmony_ci sample_i = sample_index; 2315bd8deadSopenharmony_ci 2325bd8deadSopenharmony_ci float *table = FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV; 2335bd8deadSopenharmony_ci sample_location.xy = (table[2*sample_i], table[2*sample_i+1]); 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci If a framebuffer is incomplete, querying the value of 2365bd8deadSopenharmony_ci SAMPLE_LOCATION_SUBPIXEL_BITS_NV, SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV, and 2375bd8deadSopenharmony_ci SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV will return zero. 2385bd8deadSopenharmony_ci 2395bd8deadSopenharmony_ci Add new Subsection 14.3.1.X (Resolving Depth Values) 2405bd8deadSopenharmony_ci 2415bd8deadSopenharmony_ci It is common for implementations to optimize the storage of depth values 2425bd8deadSopenharmony_ci by storing values that can be used to reconstruct depth at each sample 2435bd8deadSopenharmony_ci location, rather than storing separate depth values for each sample. For 2445bd8deadSopenharmony_ci example, the depth values from a single triangle can be represented using 2455bd8deadSopenharmony_ci plane equations. When the depth value for a sample is needed, it is 2465bd8deadSopenharmony_ci automatically evaluated at the sample location. Modifying the sample 2475bd8deadSopenharmony_ci locations causes the reconstruction to no longer evaluate the same depth 2485bd8deadSopenharmony_ci values as when the samples were originally generated. The choice of using 2495bd8deadSopenharmony_ci separate depth values for each sample or some other reconstruction method 2505bd8deadSopenharmony_ci is implementation-dependent and may not be queried. 2515bd8deadSopenharmony_ci 2525bd8deadSopenharmony_ci If per-sample depth values need to be reconstructed, some commands may 2535bd8deadSopenharmony_ci evaluate depth values using default sample locations even if programmable 2545bd8deadSopenharmony_ci sample locations are enabled. This evaluation can occur either when 2555bd8deadSopenharmony_ci reading sample values or when updating one sample requires the 2565bd8deadSopenharmony_ci implementation to reconstruct depth values for a group of neighboring 2575bd8deadSopenharmony_ci samples. These commands include ReadPixels, DrawPixels, CopyPixels, 2585bd8deadSopenharmony_ci GetTexImage, CopyTexImage, CopyTexSubImage, TexImage, TexSubImage, and 2595bd8deadSopenharmony_ci BlitFramebuffer. Texturing from a depth texture whose values need to be 2605bd8deadSopenharmony_ci reconstructed may also evaluate depth functions as the default sample 2615bd8deadSopenharmony_ci locations. 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci The command 2645bd8deadSopenharmony_ci 2655bd8deadSopenharmony_ci void ResolveDepthValuesNV(); 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci evaluates depth values for all samples in the current depth buffer 2685bd8deadSopenharmony_ci (subject to the pixel ownership and scissor tests) and stores each value 2695bd8deadSopenharmony_ci in the depth buffer. This can be used to ensure that later accesses will 2705bd8deadSopenharmony_ci use depth values consistent with the sample locations used when the 2715bd8deadSopenharmony_ci samples were generated. If the current framebuffer has no depth buffer, 2725bd8deadSopenharmony_ci ResolveDepthValuesNV will have no effect. 2735bd8deadSopenharmony_ci 2745bd8deadSopenharmony_ci 2755bd8deadSopenharmony_ciNew Implementation Dependent State 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci Minimum 2785bd8deadSopenharmony_ci Get Value Type Get Command Value Description Sec. 2795bd8deadSopenharmony_ci --------- ------- ----------- ------- ------------------------ ------ 2805bd8deadSopenharmony_ci PROGRAMMABLE_SAMPLE_- Z+ GetIntegerv 2 Size of programmable sample 14.3.1 2815bd8deadSopenharmony_ci LOCATION_TABLE_SIZE_NV location table 2825bd8deadSopenharmony_ci 2835bd8deadSopenharmony_ciNew State 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci Table 23.84 (Framebuffer Dependent Values): 2865bd8deadSopenharmony_ci 2875bd8deadSopenharmony_ci Get Value Get Command Type Minimum Value Description Sec. Attribute 2885bd8deadSopenharmony_ci --------- ----------- ---- ------------- ----------- ---- --------- 2895bd8deadSopenharmony_ci SAMPLE_LOCATION_SUBPIXEL_BITS_NV GetIntegerv Z+ 4 Precision of sample 14.3.1 - 2905bd8deadSopenharmony_ci locations 2915bd8deadSopenharmony_ci SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV GetIntegerv Z+ 1 Size of programmable 14.3.1 - 2925bd8deadSopenharmony_ci location grid 2935bd8deadSopenharmony_ci SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV GetIntegerv Z+ 1 Size of programmable 14.3.1 - 2945bd8deadSopenharmony_ci location grid 2955bd8deadSopenharmony_ci SAMPLE_LOCATION_NV GetMultisamplefv n*2*R[0,1] impl-dependent Default sample 14.3.1 - 2965bd8deadSopenharmony_ci positions 2975bd8deadSopenharmony_ci Table 23.30. (Framebuffer): 2985bd8deadSopenharmony_ci 2995bd8deadSopenharmony_ci Get Value Get Command Type Initial Value Description Sec. Attribute 3005bd8deadSopenharmony_ci --------- ----------- ---- ------------- ----------- ---- --------- 3015bd8deadSopenharmony_ci FRAMEBUFFER_PROGRAMMABLE_- GetFramebuffer- B FALSE Enable programmable 14.3.1 - 3025bd8deadSopenharmony_ci SAMPLE_LOCATIONS_NV Parameteriv sample locations 3035bd8deadSopenharmony_ci FRAMEBUFFER_SAMPLE_LOCATION_- GetFramebuffer- B FALSE Enable varying 14.3.1 - 3045bd8deadSopenharmony_ci PIXEL_GRID_NV Parameteriv locations per pixel 3055bd8deadSopenharmony_ci PROGRAMMABLE_SAMPLE_LOCATION_NV GetMultisamplefv n*2*R[0,1] (0.5,0.5) Programmable sample 14.3.1 - 3065bd8deadSopenharmony_ci locations 3075bd8deadSopenharmony_ci 3085bd8deadSopenharmony_ci 3095bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications 3105bd8deadSopenharmony_ci 3115bd8deadSopenharmony_ci None. 3125bd8deadSopenharmony_ci 3135bd8deadSopenharmony_ciGLX Protocol 3145bd8deadSopenharmony_ci 3155bd8deadSopenharmony_ci None. 3165bd8deadSopenharmony_ci 3175bd8deadSopenharmony_ciModifications to the OpenGL Shading Language Specification, Version 4.30 3185bd8deadSopenharmony_ci 3195bd8deadSopenharmony_ci None. 3205bd8deadSopenharmony_ci 3215bd8deadSopenharmony_ciErrors 3225bd8deadSopenharmony_ci 3235bd8deadSopenharmony_ci INVALID_VALUE is generated by FramebufferSampleLocationsfvNV or 3245bd8deadSopenharmony_ci NamedFramebufferSampleLocationsfvNV if the sum of <start> and <count> is 3255bd8deadSopenharmony_ci greater than PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV. 3265bd8deadSopenharmony_ci 3275bd8deadSopenharmony_ci INVALID_VALUE is generated by GetMultisamplefv if <pname> is 3285bd8deadSopenharmony_ci PROGRAMMABLE_SAMPLE_LOCATION_NV and <index> is greater than or equal to 3295bd8deadSopenharmony_ci the value of PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV. 3305bd8deadSopenharmony_ci 3315bd8deadSopenharmony_ci Some errors in the original specification are relaxed to allow for new 3325bd8deadSopenharmony_ci functionality provided by this extension (e.g., allowing programmable 3335bd8deadSopenharmony_ci sample location framebuffer parameters to be set on the default 3345bd8deadSopenharmony_ci framebuffer). 3355bd8deadSopenharmony_ci 3365bd8deadSopenharmony_ciInteractions with OpenGL ES 3.1 3375bd8deadSopenharmony_ci 3385bd8deadSopenharmony_ci If implemented in OpenGL ES 3.1, remove references to GetDoublev, 3395bd8deadSopenharmony_ci DrawPixels, CopyPixels and GetTexImage. 3405bd8deadSopenharmony_ci 3415bd8deadSopenharmony_ciIssues 3425bd8deadSopenharmony_ci 3435bd8deadSopenharmony_ci (1) Why is SAMPLE_LOCATION_NV added? 3445bd8deadSopenharmony_ci 3455bd8deadSopenharmony_ci RESOLVED: Prior to the NV_explicit_multisample spec (and its incorporation 3465bd8deadSopenharmony_ci into ARB_texture_multisample), the spec used the word "location" to 3475bd8deadSopenharmony_ci describe the placement of the sample within a pixel, rather than 3485bd8deadSopenharmony_ci "position". This alias of SAMPLE_POSITION is added to return to that 3495bd8deadSopenharmony_ci convention. 3505bd8deadSopenharmony_ci 3515bd8deadSopenharmony_ci (2) How should values that depend on the number of samples be handled for 3525bd8deadSopenharmony_ci incomplete framebuffers? 3535bd8deadSopenharmony_ci 3545bd8deadSopenharmony_ci RESOLVED: Return zero. Other such queries (e.g. RED_BITS) are undefined 3555bd8deadSopenharmony_ci but do not generate an error. Let's be more well-defined, but still not 3565bd8deadSopenharmony_ci generate an error. 3575bd8deadSopenharmony_ci 3585bd8deadSopenharmony_ci (3) Should programmable sample locations affect non-multisample rendering? 3595bd8deadSopenharmony_ci 3605bd8deadSopenharmony_ci RESOLVED: No, the programmable sample locations only apply to multisample 3615bd8deadSopenharmony_ci rasterization rules. Non-multisample rasterization is generally defined by 3625bd8deadSopenharmony_ci rules involving "fragment centers" or (for lines) a diamond around the 3635bd8deadSopenharmony_ci fragment center. Multisample rasterization is defined by rules involving 3645bd8deadSopenharmony_ci sample points being inside or outside of a region defined by the primitive. 3655bd8deadSopenharmony_ci Thus, only multisample rasterization rules are affected by modifying the 3665bd8deadSopenharmony_ci sample locations. 3675bd8deadSopenharmony_ci 3685bd8deadSopenharmony_ci (4) How does this extension differ from AMD_sample_positions? 3695bd8deadSopenharmony_ci 3705bd8deadSopenharmony_ci RESOLVED: There are a few differences between this extension and 3715bd8deadSopenharmony_ci AMD_sample_positions: 3725bd8deadSopenharmony_ci 3735bd8deadSopenharmony_ci - This extension allows the sample locations to vary per-pixel within a 3745bd8deadSopenharmony_ci grid of adjacent pixels. 3755bd8deadSopenharmony_ci 3765bd8deadSopenharmony_ci - This extension specifies some limitations on texturing on various copy 3775bd8deadSopenharmony_ci operations when a source image was generated with programmable 3785bd8deadSopenharmony_ci locations, or to existing samples the framebuffer when the sample 3795bd8deadSopenharmony_ci locations change. It also provides an explicit "resolve" operation that 3805bd8deadSopenharmony_ci allows one to ensure that correct values are stored in all samples when 3815bd8deadSopenharmony_ci non-framebuffer operations not supporting the programmable locations are 3825bd8deadSopenharmony_ci used. This issue is not explicitly handled in the AMD extension. 3835bd8deadSopenharmony_ci 3845bd8deadSopenharmony_ci - This extension has explicit framebuffer parameters enabling programmable 3855bd8deadSopenharmony_ci sample locations and multi-pixel grid support. The AMD extension lets 3865bd8deadSopenharmony_ci you effectively delete all programmable sample locations and revert to 3875bd8deadSopenharmony_ci default locations via programming a new location using a NULL pointer. 3885bd8deadSopenharmony_ci 3895bd8deadSopenharmony_ci - The sample locations in this extension are explicitly framebuffer object 3905bd8deadSopenharmony_ci state, with separate state available for the default framebuffer (zero). 3915bd8deadSopenharmony_ci It's unclear from the AMD extension whether the state is global or per 3925bd8deadSopenharmony_ci framebuffer object, though a note in comment (1) ("Any other fbos will 3935bd8deadSopenharmony_ci not be affected by this change") suggests it might also be framebuffer 3945bd8deadSopenharmony_ci object state. 3955bd8deadSopenharmony_ci 3965bd8deadSopenharmony_ciRevision History 3975bd8deadSopenharmony_ci 3985bd8deadSopenharmony_ci Revision 2, 2015/03/27 3995bd8deadSopenharmony_ci - Add ES interactions 4005bd8deadSopenharmony_ci 4015bd8deadSopenharmony_ci Revision 1 4025bd8deadSopenharmony_ci - Internal revisions. 403