15bd8deadSopenharmony_ciName
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ci    NV_draw_texture
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ciName Strings
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ci    GL_NV_draw_texture
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ciContributors
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ci    Steven Holte, NVIDIA Corporation (sholte 'at' nvidia.com)
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ciContact
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ci    Pat Brown, NVIDIA Corporation (pbrown 'at' nvidia.com)
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ciStatus
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ci    Complete
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ciVersion
225bd8deadSopenharmony_ci
235bd8deadSopenharmony_ci    Last Modified Date:         9/19/2012
245bd8deadSopenharmony_ci    NVIDIA Revision:            2
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ciNumber
275bd8deadSopenharmony_ci
285bd8deadSopenharmony_ci    OpenGL Extension #430
295bd8deadSopenharmony_ci    OpenGL ES Extension #126
305bd8deadSopenharmony_ci
315bd8deadSopenharmony_ciDependencies
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    This extension is written against the OpenGL 4.1 Specification
345bd8deadSopenharmony_ci    (Compatibility Profile).
355bd8deadSopenharmony_ci
365bd8deadSopenharmony_ci    This extension can also be used with OpenGL ES 2.0 or later (see the section,
375bd8deadSopenharmony_ci    "Interactions with OpenGL ES," below).
385bd8deadSopenharmony_ci
395bd8deadSopenharmony_ci    This extension interacts with EXT_shadow_samplers.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ciOverview
425bd8deadSopenharmony_ci
435bd8deadSopenharmony_ci    This extension provides a new function, DrawTextureNV(), allowing
445bd8deadSopenharmony_ci    applications to draw an screen-aligned rectangle displaying some or all of
455bd8deadSopenharmony_ci    the contents of a two-dimensional or rectangle texture.  Callers specify a
465bd8deadSopenharmony_ci    texture object, an optional sampler object, window coordinates of the
475bd8deadSopenharmony_ci    rectangle to draw, and texture coordinates corresponding to the corners of
485bd8deadSopenharmony_ci    the rectangle.  For each fragment produced by the rectangle, DrawTextureNV
495bd8deadSopenharmony_ci    interpolates the texture coordinates, performs a texture lookup, and uses
505bd8deadSopenharmony_ci    the texture result as the fragment color.
515bd8deadSopenharmony_ci
525bd8deadSopenharmony_ci    No shaders are used by DrawTextureNV; the results of the texture lookup
535bd8deadSopenharmony_ci    are used in lieu of a fragment shader output.  The fragments generated are
545bd8deadSopenharmony_ci    processed by all per-fragment operations.  In particular,
555bd8deadSopenharmony_ci    DrawTextureNV() fully supports blending and multisampling.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ci    While this functionality can be obtained in unextended OpenGL by drawing a
585bd8deadSopenharmony_ci    rectangle and using a fragment shader to do a texture lookup,
595bd8deadSopenharmony_ci    DrawTextureNV() is likely to have better power efficiency on
605bd8deadSopenharmony_ci    implementations supporting this extension.  Additionally, use of this
615bd8deadSopenharmony_ci    extension frees the application developer from having to set up
625bd8deadSopenharmony_ci    specialized shaders, transformation matrices, vertex attributes, and
635bd8deadSopenharmony_ci    various other state in order to render the rectangle.
645bd8deadSopenharmony_ci
655bd8deadSopenharmony_ciNew Procedures and Functions
665bd8deadSopenharmony_ci
675bd8deadSopenharmony_ci    void DrawTextureNV(GLuint texture, GLuint sampler,
685bd8deadSopenharmony_ci                       GLfloat x0, GLfloat y0, 
695bd8deadSopenharmony_ci                       GLfloat x1, GLfloat y1,
705bd8deadSopenharmony_ci                       GLfloat z,
715bd8deadSopenharmony_ci                       GLfloat s0, GLfloat t0, 
725bd8deadSopenharmony_ci                       GLfloat s1, GLfloat t1);
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ciNew Tokens
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ci    None.
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ciAdditions to Chapter 2 of the OpenGL 4.1 Specification (OpenGL Operation)
795bd8deadSopenharmony_ci
805bd8deadSopenharmony_ci    Modify Section 2.19, Conditional Rendering, p. 183
815bd8deadSopenharmony_ci
825bd8deadSopenharmony_ci    (modify first paragraph to specify that DrawTextureNV is affected by
835bd8deadSopenharmony_ci    conditional rendering) ... is false, all rendering commands between
845bd8deadSopenharmony_ci    BeginConditionalRender and the corresponding EndConditionalRender are
855bd8deadSopenharmony_ci    discarded.  In this case, Begin, End, ...and DrawTextureNV (section 4.3.X)
865bd8deadSopenharmony_ci    have no effect.
875bd8deadSopenharmony_ci
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ciAdditions to Chapter 3 of the OpenGL 4.1 Specification (Rasterization)
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ci    Modify Section 3.1, Discarding Primitives Before Rasterization, p. 204
925bd8deadSopenharmony_ci
935bd8deadSopenharmony_ci    (modify the end of the second paragraph) When enabled, RASTERIZER_DISCARD
945bd8deadSopenharmony_ci    also causes the [[compatibility profile only:  Accum, Bitmap, CopyPixels,
955bd8deadSopenharmony_ci    DrawPixels,]] Clear, ClearBuffer*, and DrawTextureNV commands to be
965bd8deadSopenharmony_ci    ignored.
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ciAdditions to Chapter 4 of the OpenGL 4.1 Specification (Per-Fragment
995bd8deadSopenharmony_ciOperations and the Frame Buffer)
1005bd8deadSopenharmony_ci
1015bd8deadSopenharmony_ci    (Insert new section after Section 4.3.1, Writing to the Stencil or
1025bd8deadSopenharmony_ci    Depth/Stencil Buffers, p. 380)
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ci    Section 4.3.X, Drawing Textures
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    The command:
1075bd8deadSopenharmony_ci
1085bd8deadSopenharmony_ci      void DrawTextureNV(GLuint texture, GLuint sampler,
1095bd8deadSopenharmony_ci                         GLfloat x0, GLfloat y0, 
1105bd8deadSopenharmony_ci                         GLfloat x1, GLfloat y1,
1115bd8deadSopenharmony_ci                         GLfloat z,
1125bd8deadSopenharmony_ci                         GLfloat s0, GLfloat t0, 
1135bd8deadSopenharmony_ci                         GLfloat s1, GLfloat t1);
1145bd8deadSopenharmony_ci
1155bd8deadSopenharmony_ci    is used to draw a screen-aligned rectangle displaying a portion of the
1165bd8deadSopenharmony_ci    contents of the texture <texture>.  The four corners of this
1175bd8deadSopenharmony_ci    screen-aligned rectangle have the floating-point window coordinates
1185bd8deadSopenharmony_ci    (<x0>,<y0>), (<x0>,<y1>), (<x1>,<y1>), and (<x1>,<y0>).  A fragment will
1195bd8deadSopenharmony_ci    be generated for each pixel covered by the rectangle.  Coverage along the
1205bd8deadSopenharmony_ci    edges of the rectangle will be determined according to polygon
1215bd8deadSopenharmony_ci    rasterization rules.  If the framebuffer does not have a multisample
1225bd8deadSopenharmony_ci    buffer, or if MULTISAMPLE is disabled, fragments will be generated
1235bd8deadSopenharmony_ci    according to the polygon rasterization algorithm described in section
1245bd8deadSopenharmony_ci    3.6.1.  Otherwise, fragments will be generated for the rectangle using the
1255bd8deadSopenharmony_ci    multisample polygon rasterization algorithm described in section 3.6.6.
1265bd8deadSopenharmony_ci    In either case, the set of fragments generated is not affected by other
1275bd8deadSopenharmony_ci    state affecting polygon rasterization -- in particular, the CULL_FACE,
1285bd8deadSopenharmony_ci    POLYGON_SMOOTH, and POLYGON_OFFSET_FILL enables and PolygonMode state have
1295bd8deadSopenharmony_ci    no effect.  All fragments generated for the rectangle will have a Z window
1305bd8deadSopenharmony_ci    coordinate of <z>.
1315bd8deadSopenharmony_ci
1325bd8deadSopenharmony_ci    The color associated with each fragment produced will be obtained by using
1335bd8deadSopenharmony_ci    an interpolated source coordinate (s,t) to perform a lookup into <texture>
1345bd8deadSopenharmony_ci    The (s,t) source coordinate for each fragment is interpolated over the
1355bd8deadSopenharmony_ci    rectangle in the manner described in section 3.6.1, where the (s,t)
1365bd8deadSopenharmony_ci    coordinates associated with the four corners of the rectangle are:
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci      (<s0>, <t0>) for the corner at (<x0>, <y0>),
1395bd8deadSopenharmony_ci      (<s1>, <t0>) for the corner at (<x1>, <y0>),
1405bd8deadSopenharmony_ci      (<s1>, <t1>) for the corner at (<x1>, <y1>), and
1415bd8deadSopenharmony_ci      (<s0>, <t1>) for the corner at (<x0>, <y1>).
1425bd8deadSopenharmony_ci
1435bd8deadSopenharmony_ci    The interpolated texture coordinate (s,t) is used to obtain a texture
1445bd8deadSopenharmony_ci    color (Rs,Gs,Bs,As) from the <texture> using the process described in
1455bd8deadSopenharmony_ci    section 3.9.  The sampler state used for the texture access will be taken
1465bd8deadSopenharmony_ci    from the texture object <texture> if <sampler> is zero, or from the
1475bd8deadSopenharmony_ci    sampler object given by <sampler> otherwise.  The filtered texel <tau> is
1485bd8deadSopenharmony_ci    converted to an (Rb,Gb,Bb,Ab) vector according to table 3.25 and swizzled
1495bd8deadSopenharmony_ci    as described in Section 3.9.16.  [[Core Profile Only:  The section
1505bd8deadSopenharmony_ci    referenced here is present only in the compatibility profile; this
1515bd8deadSopenharmony_ci    language should be changed to reference the relevant language in the core
1525bd8deadSopenharmony_ci    profile.]]
1535bd8deadSopenharmony_ci
1545bd8deadSopenharmony_ci    The fragments produced by the rectangle are not processed by fragment
1555bd8deadSopenharmony_ci    shaders [[Compatibility Profile:  or fixed-function texture, color sum, or
1565bd8deadSopenharmony_ci    fog operations]].  These fragments are processed by all of the
1575bd8deadSopenharmony_ci    per-fragment operations in section 4.1.  For the purposes of the scissor
1585bd8deadSopenharmony_ci    test (section 4.1.2), the enable and scissor rectangle for the first
1595bd8deadSopenharmony_ci    element in the array of scissor test enables and rectangles are used.
1605bd8deadSopenharmony_ci
1615bd8deadSopenharmony_ci    The error INVALID_VALUE is generated by DrawTextureNV if <texture> is not
1625bd8deadSopenharmony_ci    the name of a texture object, or if <sampler> is neither zero nor the name
1635bd8deadSopenharmony_ci    of a sampler object.  The error INVALID_OPERATION is generated if the
1645bd8deadSopenharmony_ci    target of <texture> is not TEXTURE_2D or TEXTURE_RECTANGLE, <texture> is
1655bd8deadSopenharmony_ci    not complete, if <sampler> is zero and the TEXTURE_COMPARE_MODE parameter
1665bd8deadSopenharmony_ci    of <texture> is COMPARE_REF_TO_TEXTURE, or if <sampler> is non-zero and
1675bd8deadSopenharmony_ci    the TEXTURE_COMPARE_MODE_PARAMETER of <sampler> is COMPARE_REF_TO_TEXTURE.
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci
1705bd8deadSopenharmony_ciAdditions to Chapter 5 of the OpenGL 4.1 Specification (Special Functions)
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci    None.
1735bd8deadSopenharmony_ci
1745bd8deadSopenharmony_ciAdditions to Chapter 6 of the OpenGL 4.1 Specification (State and
1755bd8deadSopenharmony_ciState Requests)
1765bd8deadSopenharmony_ci
1775bd8deadSopenharmony_ci    None.
1785bd8deadSopenharmony_ci
1795bd8deadSopenharmony_ciAdditions to Appendix A of the OpenGL 4.1 Specification (Invariance)
1805bd8deadSopenharmony_ci
1815bd8deadSopenharmony_ci    None.
1825bd8deadSopenharmony_ci
1835bd8deadSopenharmony_ciAdditions to the AGL/GLX/WGL Specifications
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci    None.
1865bd8deadSopenharmony_ci
1875bd8deadSopenharmony_ciGLX Protocol
1885bd8deadSopenharmony_ci
1895bd8deadSopenharmony_ci    !!! TBD
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ciErrors
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci    INVALID_VALUE is generated by DrawTextureNV if <texture> is not the name
1945bd8deadSopenharmony_ci    of a texture object, or if <sampler> is neither zero nor the name of a
1955bd8deadSopenharmony_ci    sampler object.
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    INVALID_OPERATION is generated by DrawTextureNV if the target of <texture>
1985bd8deadSopenharmony_ci    is not TEXTURE_2D or TEXTURE_RECTANGLE, <texture> is not complete, if
1995bd8deadSopenharmony_ci    <sampler> is zero and the TEXTURE_COMPARE_MODE parameter of <texture> is
2005bd8deadSopenharmony_ci    COMPARE_REF_TO_TEXTURE, or if <sampler> is non-zero and the
2015bd8deadSopenharmony_ci    TEXTURE_COMPARE_MODE_PARAMETER of <sampler> is COMPARE_REF_TO_TEXTURE.
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ciNew State
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci    None.
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ci
2085bd8deadSopenharmony_ciNew Implementation Dependent State
2095bd8deadSopenharmony_ci
2105bd8deadSopenharmony_ci    None.
2115bd8deadSopenharmony_ci
2125bd8deadSopenharmony_ciInteractions with OpenGL ES
2135bd8deadSopenharmony_ci
2145bd8deadSopenharmony_ci    If implemented for OpenGL ES, NV_draw_texture acts as described in this spec,
2155bd8deadSopenharmony_ci    except:
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ci        * Ignore the references to conditional rendering including changes to
2185bd8deadSopenharmony_ci          section 2.19 "Conditional Rendering".
2195bd8deadSopenharmony_ci        * Ignore all references to RASTERIZER_DISCARD including changes to
2205bd8deadSopenharmony_ci          section 3.1 "Discarding Primitives Before Rasterization".
2215bd8deadSopenharmony_ci        * Ignore references to MULTISAMPLE.
2225bd8deadSopenharmony_ci        * Ignore references to POLYGON_SMOOTH and PolygonMode.
2235bd8deadSopenharmony_ci        * Ignore references to TEXTURE_RECTANGLE.
2245bd8deadSopenharmony_ci        * If the version of OpenGL ES is less than 3.0, the sampler parameter
2255bd8deadSopenharmony_ci          must always be 0.
2265bd8deadSopenharmony_ci        * If the version of OpenGL ES is less than 3.0, ignore references to
2275bd8deadSopenharmony_ci          texture swizzles.
2285bd8deadSopenharmony_ci
2295bd8deadSopenharmony_ciInteractions with OpenGL ES and EXT_shadow_samplers
2305bd8deadSopenharmony_ci
2315bd8deadSopenharmony_ci    If implemented for OpenGL ES with the EXT_shadow_samplers extension,
2325bd8deadSopenharmony_ci    replace references to TEXTURE_COMPARE_FUNC, TEXTURE_COMPARE_MODE, and
2335bd8deadSopenharmony_ci    COMPARE_REF_TO_TEXTURE, with references to TEXTURE_COMPARE_FUNC_EXT,
2345bd8deadSopenharmony_ci    TEXTURE_COMPARE_FUNC_EXT and COMPARE_REF_TO_TEXTURE_EXT.
2355bd8deadSopenharmony_ci
2365bd8deadSopenharmony_ci    If implemented for OpenGL ES without the EXT_shadow_samplers extension,
2375bd8deadSopenharmony_ci    ignore references to these symbols.
2385bd8deadSopenharmony_ci
2395bd8deadSopenharmony_ciIssues
2405bd8deadSopenharmony_ci
2415bd8deadSopenharmony_ci    (1) Why provide this extension when you can do the same thing by drawing a
2425bd8deadSopenharmony_ci        quad with a simple fragment shader using texture mapping?
2435bd8deadSopenharmony_ci
2445bd8deadSopenharmony_ci      RESOLVED:  This extension is intended to provide a high-performance
2455bd8deadSopenharmony_ci      power-efficient fixed-function path for drawing the contents of a
2465bd8deadSopenharmony_ci      texture onto the screen.  No vertex shader is required to position the
2475bd8deadSopenharmony_ci      vertices of the quad, and no fragment shader is required to perform a
2485bd8deadSopenharmony_ci      texture lookup.
2495bd8deadSopenharmony_ci
2505bd8deadSopenharmony_ci    (2) Why provide this extension when you can do something similar with
2515bd8deadSopenharmony_ci        DrawPixels?
2525bd8deadSopenharmony_ci
2535bd8deadSopenharmony_ci      RESOLVED:  DrawPixels provides similar functionality, but can only
2545bd8deadSopenharmony_ci      access client memory or a pixel buffer object.  If the data to be drawn
2555bd8deadSopenharmony_ci      on-screen come from a texture, it would be necessary to read the
2565bd8deadSopenharmony_ci      contents of the texture back to client memory or a pixel buffer object
2575bd8deadSopenharmony_ci      before drawing.  
2585bd8deadSopenharmony_ci
2595bd8deadSopenharmony_ci      Additionally, the rendering process for DrawPixels has several
2605bd8deadSopenharmony_ci      limitations.  Addressing a subset of the source data requires either
2615bd8deadSopenharmony_ci      pointer manipulation or the use of the separate PixelStore APIs, and
2625bd8deadSopenharmony_ci      doesn't permit sub-pixel addressing in the source data.  While
2635bd8deadSopenharmony_ci      DrawPixels supports scaling via the PixelZoom, the zooming capability
2645bd8deadSopenharmony_ci      provides only point-sampled filtering.  Additionally, DrawPixels is not
2655bd8deadSopenharmony_ci      supported in the core profile of OpenGL, or in OpenGL ES.
2665bd8deadSopenharmony_ci
2675bd8deadSopenharmony_ci    (3) Why provide this extension when you can do something similar with
2685bd8deadSopenharmony_ci    BlitFramebuffer?
2695bd8deadSopenharmony_ci
2705bd8deadSopenharmony_ci      RESOLVED:  BlitFramebuffer also provides similar functionality, but it
2715bd8deadSopenharmony_ci      does not permit per-fragment operations like blending, which is a
2725bd8deadSopenharmony_ci      significant limitation for some important "2D" use cases of this API
2735bd8deadSopenharmony_ci      (e.g., compositing several images from textures).  Additionally, need to
2745bd8deadSopenharmony_ci      attach the texture to a framebuffer object, set up a read buffer, and
2755bd8deadSopenharmony_ci      bind the framebuffer object as the read framebuffer result in several
2765bd8deadSopenharmony_ci      additional steps not present in the DrawTextureNV API.
2775bd8deadSopenharmony_ci
2785bd8deadSopenharmony_ci    (4) The DrawTextureNV API only supports 2D or rectangle textures.  Should
2795bd8deadSopenharmony_ci        we provide support for accessing other types of texture (1D, 3D, cube
2805bd8deadSopenharmony_ci        maps, arrays)?  Or even for pulling a "2D" image out of a more complex
2815bd8deadSopenharmony_ci        texture (like identifying a texture face, or a layer of a 2D array
2825bd8deadSopenharmony_ci        texture or a 3D texture)?
2835bd8deadSopenharmony_ci
2845bd8deadSopenharmony_ci      RESOLVED:  No, we are choosing to keep the API simple and support only
2855bd8deadSopenharmony_ci      2D/rectangle textures.  Adding in support for 3D or array textures would
2865bd8deadSopenharmony_ci      require additional texture coordinates that would clutter up the "2D"
2875bd8deadSopenharmony_ci      API or a separate "DrawTexture3DNV" API taking (s,t,r) coordinates.
2885bd8deadSopenharmony_ci      Adding in support for pulling out a face/layer of a texture with
2895bd8deadSopenharmony_ci      multiple layers would inject similar clutter or new APIs.
2905bd8deadSopenharmony_ci
2915bd8deadSopenharmony_ci      Note that the face/layer selection could also be handled by a
2925bd8deadSopenharmony_ci      Direct3D-like "resource view" API that would allow callers to create
2935bd8deadSopenharmony_ci      multiple "views" of a source texture.  In particular, one might be able
2945bd8deadSopenharmony_ci      to use such an extension to create a "virtual" 2D texture object that
2955bd8deadSopenharmony_ci      refers to a single face/layer of a cube map, 2D array, or 3D texture.
2965bd8deadSopenharmony_ci
2975bd8deadSopenharmony_ci    (5) Should we support multisample textures (TEXTURE_2D_MULTISAMPLE)?
2985bd8deadSopenharmony_ci
2995bd8deadSopenharmony_ci      RESOLVED:  No.  Current texture mapping support for multisample texture
3005bd8deadSopenharmony_ci      only allows for selection of a single numbered texture.  There are no
3015bd8deadSopenharmony_ci      filtered texture lookup capabilities for these sorts of textures.
3025bd8deadSopenharmony_ci
3035bd8deadSopenharmony_ci      BlitFramebuffer does support sourcing a multisample texture (via a
3045bd8deadSopenharmony_ci      framebuffer object attachement), but its capabilities are also fairly
3055bd8deadSopenharmony_ci      limited -- copies are only supported either by first resolving multiple
3065bd8deadSopenharmony_ci      samples down to a single sample, or doing a straight sample-by-sample
3075bd8deadSopenharmony_ci      copy to a matching multisample buffer.
3085bd8deadSopenharmony_ci
3095bd8deadSopenharmony_ci    (6) What sort of coordinates should be used to access the texture?
3105bd8deadSopenharmony_ci
3115bd8deadSopenharmony_ci      RESOLVED:  We use the same coordinate system as is used for normal
3125bd8deadSopenharmony_ci      texture lookups for a given texture target.  
3135bd8deadSopenharmony_ci
3145bd8deadSopenharmony_ci      For textures with a TEXTURE_RECTANGLE target, we use non-normalized
3155bd8deadSopenharmony_ci      coordinates -- to draw a 640x480 rectangle texture on top of a 640x480
3165bd8deadSopenharmony_ci      window, you would call:
3175bd8deadSopenharmony_ci
3185bd8deadSopenharmony_ci        glDrawTexture(texture, sampler, 
3195bd8deadSopenharmony_ci                      0, 0, 640, 480,  /* destination */
3205bd8deadSopenharmony_ci                      0, 0, 640, 480   /* texture */);
3215bd8deadSopenharmony_ci
3225bd8deadSopenharmony_ci      For textures with a TEXTURE_2D target, we use normalized coordinates.
3235bd8deadSopenharmony_ci      The same example as above with a 640x480 2D texture would use:
3245bd8deadSopenharmony_ci
3255bd8deadSopenharmony_ci        glDrawTexture(texture, sampler, 
3265bd8deadSopenharmony_ci                      0, 0, 640, 480,  /* destination */
3275bd8deadSopenharmony_ci                      0, 0, 1, 1       /* texture */);
3285bd8deadSopenharmony_ci
3295bd8deadSopenharmony_ci    (7) What limitations apply to the texture accesses in DrawTextureNV?
3305bd8deadSopenharmony_ci
3315bd8deadSopenharmony_ci      RESOLVED:  We do not support any texture targets other than TEXTURE_2D
3325bd8deadSopenharmony_ci      and TEXTURE_RECTANGLE.  We also do not support shadow mapping via the
3335bd8deadSopenharmony_ci      TEXTURE_COMPARE_MODE parameter, given that we don't provide any
3345bd8deadSopenharmony_ci      interface for specifying a depth reference value.  In either case, an
3355bd8deadSopenharmony_ci      INVALID_OPERATION error will be generated if an unsupported feature is
3365bd8deadSopenharmony_ci      used.
3375bd8deadSopenharmony_ci
3385bd8deadSopenharmony_ci    (8) Is anisotropic texture filtering supported?
3395bd8deadSopenharmony_ci
3405bd8deadSopenharmony_ci      RESOLVED:  Yes.  However, anisotropic filtering may result in lower
3415bd8deadSopenharmony_ci      performance and power efficiency and should be used only if
3425bd8deadSopenharmony_ci      required. Given that the destination is a screen-aligned rectangle and
3435bd8deadSopenharmony_ci      the portion of texture sampled from is a texture-aligned rectangle, the
3445bd8deadSopenharmony_ci      footprints of pixels in texture space are regular.  Unless the
3455bd8deadSopenharmony_ci      DrawTextureNV command uses a non-uniform scale, anisotropic filtering
3465bd8deadSopenharmony_ci      should provide no benefit.
3475bd8deadSopenharmony_ci
3485bd8deadSopenharmony_ci    (9) Are texture swizzles supported?
3495bd8deadSopenharmony_ci
3505bd8deadSopenharmony_ci      RESOLVED:  Yes.
3515bd8deadSopenharmony_ci
3525bd8deadSopenharmony_ci    (10) Does DrawTextureNV support multisample rasterization?
3535bd8deadSopenharmony_ci
3545bd8deadSopenharmony_ci      RESOLVED:  Yes.  The coordinates of the destination rectangle are
3555bd8deadSopenharmony_ci      floating-point values, allowing for rectangle boundaries not on pixel
3565bd8deadSopenharmony_ci      edges.  When multisample rasterization is enabled, pixels on the edge of
3575bd8deadSopenharmony_ci      the rectangle may be partially covered, in which case only some samples
3585bd8deadSopenharmony_ci      of the pixel will be updated.  This multisample support allows for
3595bd8deadSopenharmony_ci      smoother panning of the drawn rectangles than one could get with the
3605bd8deadSopenharmony_ci      pixel-aligned updates provided by the BlitFramebuffer API.
3615bd8deadSopenharmony_ci
3625bd8deadSopenharmony_ci    (11) Does DrawTextureNV support per-sample shading (i.e., a different
3635bd8deadSopenharmony_ci         color for each sample in the destination rectangle)?
3645bd8deadSopenharmony_ci
3655bd8deadSopenharmony_ci      RESOLVED:  No.
3665bd8deadSopenharmony_ci
3675bd8deadSopenharmony_ci    (12) Should any per-fragment operations be supported by this extension?
3685bd8deadSopenharmony_ci
3695bd8deadSopenharmony_ci      RESOLVED:  Yes, we will all support fragment operations.  In particular,
3705bd8deadSopenharmony_ci      blending is particularly important for "2D" operations such as
3715bd8deadSopenharmony_ci      compositing image layers.  It seems interesting to allow stencil
3725bd8deadSopenharmony_ci      operations to "cut out" portions of the primitive.  It also seems
3735bd8deadSopenharmony_ci      interesting to allow depth testing be used to compare the DrawTextureNV
3745bd8deadSopenharmony_ci      rectangle (at a fixed depth) against previously rendered primitives
3755bd8deadSopenharmony_ci      (either "3D" or "2D").
3765bd8deadSopenharmony_ci
3775bd8deadSopenharmony_ci    (13) Should we provide a mode to override/disable selected per-fragment
3785bd8deadSopenharmony_ci         operations when performing DrawTextureNV?
3795bd8deadSopenharmony_ci
3805bd8deadSopenharmony_ci      RESOLVED:  No.  An override would be useful if we expected applications
3815bd8deadSopenharmony_ci      to be performing operations like toggling between regularly rendered
3825bd8deadSopenharmony_ci      primitives (with depth testing enabled) and "flat" DrawTexture2D output
3835bd8deadSopenharmony_ci      (not wanting depth testing) at a fine granularity.  It's not clear that
3845bd8deadSopenharmony_ci      such usage would be common.  If we expect switching between modes only
3855bd8deadSopenharmony_ci      at a coarse granularity, it would be simpler to require the application
3865bd8deadSopenharmony_ci      to apply the (infrequent) overrides themselves instead of adding clutter
3875bd8deadSopenharmony_ci      to the DrawTextureNV API.
3885bd8deadSopenharmony_ci
3895bd8deadSopenharmony_ci    (14) Is it legal to call DrawTextureNV while transform feedback is active?
3905bd8deadSopenharmony_ci         If so, what is recorded?
3915bd8deadSopenharmony_ci
3925bd8deadSopenharmony_ci      UNRESOLVED:  Yes, it's legal to call DrawTextureNV during transform
3935bd8deadSopenharmony_ci      feedback.  Nothing should be recorded in this case.  This is consistent
3945bd8deadSopenharmony_ci      with the handling of other "special" rendering operations (like
3955bd8deadSopenharmony_ci      DrawPixels and BlitFramebuffer).  This behavior falls out of the
3965bd8deadSopenharmony_ci      definition of transform feedback with no spec changes required; there
3975bd8deadSopenharmony_ci      are no geometric primitives sent through the pipeline for DrawTextureNV
3985bd8deadSopenharmony_ci      that could be recorded.
3995bd8deadSopenharmony_ci
4005bd8deadSopenharmony_ci    (15) How does DrawTextureNV interact with RASTERIZER_DISCARD?
4015bd8deadSopenharmony_ci
4025bd8deadSopenharmony_ci      UNRESOLVED:  If RASTERIZER_DISCARD is enabled, DrawTextureNV will be
4035bd8deadSopenharmony_ci      discarded.  This is consistent with the behavior of DrawPixels.  
4045bd8deadSopenharmony_ci
4055bd8deadSopenharmony_ci      Note:  It appears that BlitFramebuffer is not affected by
4065bd8deadSopenharmony_ci      RASTERIZER_DISCARD, though the extensions that introduced this command
4075bd8deadSopenharmony_ci      don't explicitly address this one way or the other.
4085bd8deadSopenharmony_ci
4095bd8deadSopenharmony_ci    (16) Should samples generated by DrawTextureNV be counted in occlusion
4105bd8deadSopenharmony_ci         queries?
4115bd8deadSopenharmony_ci
4125bd8deadSopenharmony_ci      UNRESOLVED:  Yes.  Occlusion query is just another per-fragment
4135bd8deadSopenharmony_ci      operation, and we support all the other ones.
4145bd8deadSopenharmony_ci
4155bd8deadSopenharmony_ci    (17) How does this extension interact with the DEPTH_CLAMP enable?
4165bd8deadSopenharmony_ci
4175bd8deadSopenharmony_ci      UNRESOLVED:  When enabled, depth clamping will be performed on
4185bd8deadSopenharmony_ci      DrawTextureNV fragments.  This appears to be consistent with the spec
4195bd8deadSopenharmony_ci      language, as applied to DrawPixels.  There are two parts to depth
4205bd8deadSopenharmony_ci      clamping:  (a) clipping to the near/far frustum clip planes are
4215bd8deadSopenharmony_ci      disabled, and (b) clamping is applied to fragment Z as part of the depth
4225bd8deadSopenharmony_ci      test.  There's no language suggesting that (b) doesn't apply to color
4235bd8deadSopenharmony_ci      DrawPixels or Bitmap commands.  (DrawPixels with DEPTH_COMPONENT pixels
4245bd8deadSopenharmony_ci      is a different beast that doesn't go through the regular pixel path, and
4255bd8deadSopenharmony_ci      ARB_depth_clamp says that clamping doesn't apply there.)
4265bd8deadSopenharmony_ci
4275bd8deadSopenharmony_ci      Note that if depth testing is disabled, the depth clamp enable has no
4285bd8deadSopenharmony_ci      effect on DrawTextureNV, since (a) doesn't apply because DrawTextureNV
4295bd8deadSopenharmony_ci      doesn't generate a geometric primitive that could be clipped.
4305bd8deadSopenharmony_ci      
4315bd8deadSopenharmony_ci    (18) How does the rectangle rendered by DrawTextureNV interact with
4325bd8deadSopenharmony_ci         polygon rasterization features (culling, polygon smooth, polygon
4335bd8deadSopenharmony_ci         mode, polygon offset)?
4345bd8deadSopenharmony_ci
4355bd8deadSopenharmony_ci      RESOLVED:  None of these features affect DrawTextureNV.  The spec refers
4365bd8deadSopenharmony_ci      to the polygon rasterization of the spec only because we apply the same
4375bd8deadSopenharmony_ci      coverage computation rules to DrawTextureNV as are used for
4385bd8deadSopenharmony_ci      rasterization of single-sample and multisample polygons.
4395bd8deadSopenharmony_ci
4405bd8deadSopenharmony_ci    (19) How does this extension interact with conditional rendering?
4415bd8deadSopenharmony_ci
4425bd8deadSopenharmony_ci      UNRESOLVED:  If DrawTextureNV is called inside a BeginConditionalRender
4435bd8deadSopenharmony_ci      and EndConditionalRender pair and the query object indicates that
4445bd8deadSopenharmony_ci      rendering should be discarded, the DrawTextureNV command is also
4455bd8deadSopenharmony_ci      discarded.  This is consistent with the behavior of DrawPixels.
4465bd8deadSopenharmony_ci
4475bd8deadSopenharmony_ci
4485bd8deadSopenharmony_ciRevision History
4495bd8deadSopenharmony_ci    
4505bd8deadSopenharmony_ci    Rev.    Date    Author    Changes
4515bd8deadSopenharmony_ci    ----  --------  --------  -----------------------------------------
4525bd8deadSopenharmony_ci     1              pbrown    Internal revisions.
4535bd8deadSopenharmony_ci     2    09/19/12  sholte    Added ES interactions
454