15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_copy_texture 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GL_EXT_copy_texture 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciVersion 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci $Date: 1995/06/17 03:33:42 $ $Revision: 1.21 $ 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciNumber 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci 10 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciDependencies 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci EXT_texture is required. 205bd8deadSopenharmony_ci EXT_texture3D affects the definition of this extension. 215bd8deadSopenharmony_ci SGIS_texture_filter4 affects the definition of this extension. 225bd8deadSopenharmony_ci EXT_subtexture affects the definition of this extension. 235bd8deadSopenharmony_ci 245bd8deadSopenharmony_ciOverview 255bd8deadSopenharmony_ci 265bd8deadSopenharmony_ci This extension defines methods to load texture images directly from the 275bd8deadSopenharmony_ci framebuffer. Methods are defined for both complete and partial 285bd8deadSopenharmony_ci replacement of a texture image. Because it is not possible to define 295bd8deadSopenharmony_ci an entire 3D texture using a 2D framebuffer image, 3D textures are 305bd8deadSopenharmony_ci supported only for partial replacement. 315bd8deadSopenharmony_ci 325bd8deadSopenharmony_ciNew Procedures and Functions 335bd8deadSopenharmony_ci 345bd8deadSopenharmony_ci void CopyTexImage1DEXT(enum target, 355bd8deadSopenharmony_ci int level, 365bd8deadSopenharmony_ci enum internalformat, 375bd8deadSopenharmony_ci int x, 385bd8deadSopenharmony_ci int y, 395bd8deadSopenharmony_ci sizei width, 405bd8deadSopenharmony_ci int border); 415bd8deadSopenharmony_ci 425bd8deadSopenharmony_ci void CopyTexImage2DEXT(enum target, 435bd8deadSopenharmony_ci int level, 445bd8deadSopenharmony_ci enum internalformat, 455bd8deadSopenharmony_ci int x, 465bd8deadSopenharmony_ci int y, 475bd8deadSopenharmony_ci sizei width, 485bd8deadSopenharmony_ci sizei height, 495bd8deadSopenharmony_ci int border); 505bd8deadSopenharmony_ci 515bd8deadSopenharmony_ci void CopyTexSubImage1DEXT(enum target, 525bd8deadSopenharmony_ci int level, 535bd8deadSopenharmony_ci int xoffset, 545bd8deadSopenharmony_ci int x, 555bd8deadSopenharmony_ci int y, 565bd8deadSopenharmony_ci sizei width); 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ci void CopyTexSubImage2DEXT(enum target, 595bd8deadSopenharmony_ci int level, 605bd8deadSopenharmony_ci int xoffset, 615bd8deadSopenharmony_ci int yoffset, 625bd8deadSopenharmony_ci int x, 635bd8deadSopenharmony_ci int y, 645bd8deadSopenharmony_ci sizei width, 655bd8deadSopenharmony_ci sizei height); 665bd8deadSopenharmony_ci 675bd8deadSopenharmony_ci void CopyTexSubImage3DEXT(enum target, 685bd8deadSopenharmony_ci int level, 695bd8deadSopenharmony_ci int xoffset, 705bd8deadSopenharmony_ci int yoffset, 715bd8deadSopenharmony_ci int zoffset, 725bd8deadSopenharmony_ci int x, 735bd8deadSopenharmony_ci int y, 745bd8deadSopenharmony_ci sizei width, 755bd8deadSopenharmony_ci sizei height); 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ciNew Tokens 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ci None 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation) 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ci None 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization) 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci CopyTexImage1DEXT and CopyTexImage2DEXT are related to TexImage1D and 885bd8deadSopenharmony_ci TexImage2D in exactly the way that CopyPixels is related to DrawPixels. 895bd8deadSopenharmony_ci Rather than accepting image data from memory, they copy image data from 905bd8deadSopenharmony_ci the color buffer specified by the current ReadBuffer mode. 915bd8deadSopenharmony_ci CopyTexImage2DEXT accepts image data from a width+2*border pixel wide by 925bd8deadSopenharmony_ci height+2*border pixel high color buffer region whose lower-left pixel 935bd8deadSopenharmony_ci has window coordinates <x>,<y>. If any pixels within this region are 945bd8deadSopenharmony_ci outside the window that is associated with the GL context, the values 955bd8deadSopenharmony_ci obtained for those pixels are undefined. These pixel values are 965bd8deadSopenharmony_ci processed exactly as if CopyPixels had been called, but the process 975bd8deadSopenharmony_ci stops just before final conversion. Subsequent processing is exactly 985bd8deadSopenharmony_ci as though TexImage2D had be called, beginning with the clamping of the 995bd8deadSopenharmony_ci pixel group components to [0,1]. Pixel ordering is such that lower X 1005bd8deadSopenharmony_ci screen coordinates correspond to lower i texture coordinates, and lower 1015bd8deadSopenharmony_ci Y screen coordinates correspond to lower j texture coordinates (refer to 1025bd8deadSopenharmony_ci Figure 3.10 - A texture image and the coordinates used to access it, GL 1035bd8deadSopenharmony_ci Specification). The semantics and accepted values of the <target>, 1045bd8deadSopenharmony_ci <level>, and <border> parameters are exactly equivalent to their 1055bd8deadSopenharmony_ci TexImage2D counterparts, except that <target> does not accept 1065bd8deadSopenharmony_ci PROXY_TEXTURE_2D_EXT. The semantics of <internalformat> are identical 1075bd8deadSopenharmony_ci to those of the <components> parameter of TexImage2D, except that 1085bd8deadSopenharmony_ci values 1, 2, 3, and 4 are not accepted by CopyTexImage2DEXT. 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci CopyTexImage1DEXT accepts image data from a width+2*border pixel wide 1115bd8deadSopenharmony_ci by 1 pixel high color buffer region whose left-most pixel has window 1125bd8deadSopenharmony_ci coordinates <x>,<y>. If any pixels within this region are outside the 1135bd8deadSopenharmony_ci window that is associated with the GL context, the values obtained for 1145bd8deadSopenharmony_ci those pixels are undefined. The pixels are processed just as those of 1155bd8deadSopenharmony_ci CopyTexImage2DEXT are, and they define a texture such that lower X 1165bd8deadSopenharmony_ci window coordinates correspond to lower i texture coordinates, as per 1175bd8deadSopenharmony_ci Figure 3.10 of the GL Specification. The semantics and accepted values 1185bd8deadSopenharmony_ci of the <level>, <border>, and <internalformat> parameters are exactly 1195bd8deadSopenharmony_ci those of CopyTexImage2DEXT. <target> accepts only TEXTURE_1D. 1205bd8deadSopenharmony_ci 1215bd8deadSopenharmony_ci If EXT_subtexture is supported, this extension also defines 1225bd8deadSopenharmony_ci CopyTexSubImage1DEXT and CopyTexSubImage2DEXT. These commands are 1235bd8deadSopenharmony_ci related to TexSubImage1DEXT and TexSubImage2DEXT in exactly the way 1245bd8deadSopenharmony_ci that CopyPixels is related to DrawPixels. Rather than accepting image 1255bd8deadSopenharmony_ci data from memory, they copy image data from the framebuffer. The 1265bd8deadSopenharmony_ci semantics and accepted values of the <target>, <level>, <xoffset>, and 1275bd8deadSopenharmony_ci <yoffset> parameters are exactly equivalent to their TexSubImage1DEXT 1285bd8deadSopenharmony_ci and TexSubImage2DEXT counterparts. The semantics and accepted values 1295bd8deadSopenharmony_ci of the <x>, <y>, <width>, and <height> parameters are exactly equivalent 1305bd8deadSopenharmony_ci to their CopyTexImage1DEXT and CopyTexImage2DEXT counterparts. 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci If EXT_subtexture and EXT_texture3D are both supported, this extension 1335bd8deadSopenharmony_ci also defines CopyTexSubImage3DEXT. Because framebuffer memory is two- 1345bd8deadSopenharmony_ci dimensional, only a portion of a single s,t slice of a 3D texture is 1355bd8deadSopenharmony_ci replaced by this command. Thus CopyTexSubImage3DEXT is related to 1365bd8deadSopenharmony_ci TexSubImage3DEXT in exactly the way that CopyPixels is related to 1375bd8deadSopenharmony_ci DrawPixels, except that it is as though TexSubImage3DEXT parameter 1385bd8deadSopenharmony_ci <depth> were 1. Rather than accepting image data from memory, 1395bd8deadSopenharmony_ci CopyTexSubImage3DEXT copies image data from the framebuffer. The 1405bd8deadSopenharmony_ci semantics and accepted values of the <target>, <level>, <xoffset>, 1415bd8deadSopenharmony_ci <yoffset>, and <zoffset> parameters are exactly equivalent to their 1425bd8deadSopenharmony_ci TexSubImage3DEXT counterparts. The semantics and accepted values of 1435bd8deadSopenharmony_ci the <x>, <y>, <width>, and <height> parameters are exactly equivalent 1445bd8deadSopenharmony_ci to their CopyTexImage2DEXT counterparts. 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations 1475bd8deadSopenharmony_ciand the Framebuffer) 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci None 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions) 1525bd8deadSopenharmony_ci 1535bd8deadSopenharmony_ci None 1545bd8deadSopenharmony_ci 1555bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests) 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci None 1585bd8deadSopenharmony_ci 1595bd8deadSopenharmony_ciAdditions to the GLX Specification 1605bd8deadSopenharmony_ci 1615bd8deadSopenharmony_ci None 1625bd8deadSopenharmony_ci 1635bd8deadSopenharmony_ciGLX Protocol 1645bd8deadSopenharmony_ci 1655bd8deadSopenharmony_ci Five new GL rendering commands are added. The following commands are sent to the 1665bd8deadSopenharmony_ci server as part of a glXRender request: 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci CopyTexImage1DEXT 1695bd8deadSopenharmony_ci 2 32 rendering command length 1705bd8deadSopenharmony_ci 2 4119 rendering command opcode 1715bd8deadSopenharmony_ci 4 ENUM target 1725bd8deadSopenharmony_ci 4 INT32 level 1735bd8deadSopenharmony_ci 4 ENUM internalformat 1745bd8deadSopenharmony_ci 4 INT32 x 1755bd8deadSopenharmony_ci 4 INT32 y 1765bd8deadSopenharmony_ci 4 INT32 width 1775bd8deadSopenharmony_ci 4 INT32 border 1785bd8deadSopenharmony_ci 1795bd8deadSopenharmony_ci CopyTexImage2DEXT 1805bd8deadSopenharmony_ci 2 36 rendering command length 1815bd8deadSopenharmony_ci 2 4120 rendering command opcode 1825bd8deadSopenharmony_ci 4 ENUM target 1835bd8deadSopenharmony_ci 4 INT32 level 1845bd8deadSopenharmony_ci 4 ENUM internalformat 1855bd8deadSopenharmony_ci 4 INT32 x 1865bd8deadSopenharmony_ci 4 INT32 y 1875bd8deadSopenharmony_ci 4 INT32 width 1885bd8deadSopenharmony_ci 4 INT32 height 1895bd8deadSopenharmony_ci 4 INT32 border 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci CopyTexSubImage1DEXT 1925bd8deadSopenharmony_ci 2 28 rendering command length 1935bd8deadSopenharmony_ci 2 4121 rendering command opcode 1945bd8deadSopenharmony_ci 4 ENUM target 1955bd8deadSopenharmony_ci 4 INT32 level 1965bd8deadSopenharmony_ci 4 INT32 xoffset 1975bd8deadSopenharmony_ci 4 INT32 x 1985bd8deadSopenharmony_ci 4 INT32 y 1995bd8deadSopenharmony_ci 4 INT32 width 2005bd8deadSopenharmony_ci 2015bd8deadSopenharmony_ci CopyTexSubImage2DEXT 2025bd8deadSopenharmony_ci 2 36 rendering command length 2035bd8deadSopenharmony_ci 2 4122 rendering command opcode 2045bd8deadSopenharmony_ci 4 ENUM target 2055bd8deadSopenharmony_ci 4 INT32 level 2065bd8deadSopenharmony_ci 4 INT32 xoffset 2075bd8deadSopenharmony_ci 4 INT32 yoffset 2085bd8deadSopenharmony_ci 4 INT32 x 2095bd8deadSopenharmony_ci 4 INT32 y 2105bd8deadSopenharmony_ci 4 INT32 width 2115bd8deadSopenharmony_ci 4 INT32 height 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ci CopyTexSubImage3DEXT 2145bd8deadSopenharmony_ci 2 40 rendering command length 2155bd8deadSopenharmony_ci 2 4123 rendering command opcode 2165bd8deadSopenharmony_ci 4 ENUM target 2175bd8deadSopenharmony_ci 4 INT32 level 2185bd8deadSopenharmony_ci 4 INT32 xoffset 2195bd8deadSopenharmony_ci 4 INT32 yoffset 2205bd8deadSopenharmony_ci 4 INT32 zoffset 2215bd8deadSopenharmony_ci 4 INT32 x 2225bd8deadSopenharmony_ci 4 INT32 y 2235bd8deadSopenharmony_ci 4 INT32 width 2245bd8deadSopenharmony_ci 4 INT32 height 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ciDependencies on EXT_texture 2275bd8deadSopenharmony_ci 2285bd8deadSopenharmony_ci EXT_texture is required. This extension builds on the notion of 2295bd8deadSopenharmony_ci internal image format, which is defined by EXT_texture. 2305bd8deadSopenharmony_ci 2315bd8deadSopenharmony_ciDependencies on EXT_texture3D 2325bd8deadSopenharmony_ci 2335bd8deadSopenharmony_ci If EXT_texture3D is not supported, CopyTexSubImage3DEXT is not defined 2345bd8deadSopenharmony_ci by this extension. 2355bd8deadSopenharmony_ci 2365bd8deadSopenharmony_ciDependencies on SGIS_texture_filter4 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci If SGIS_texture_filter4 is not supported, 2 is not accepted as a border 2395bd8deadSopenharmony_ci value. 2405bd8deadSopenharmony_ci 2415bd8deadSopenharmony_ciDependencies on EXT_subtexture 2425bd8deadSopenharmony_ci 2435bd8deadSopenharmony_ci If EXT_subtexture is not supported, CopyTexSubImage1DEXT, 2445bd8deadSopenharmony_ci CopyTexSubImage2DEXT, and CopyTexSubImage3DEXT are not defined by this 2455bd8deadSopenharmony_ci extension. 2465bd8deadSopenharmony_ci 2475bd8deadSopenharmony_ciErrors 2485bd8deadSopenharmony_ci 2495bd8deadSopenharmony_ci INVALID_ENUM is generated if CopyTexImage1DEXT or CopyTexSubImage1DEXT 2505bd8deadSopenharmony_ci parameter <target> is not TEXTURE_1D. (The commands defined by this 2515bd8deadSopenharmony_ci extension do not accept PROXY targets.) 2525bd8deadSopenharmony_ci 2535bd8deadSopenharmony_ci INVALID_ENUM is generated if CopyTexImage2DEXT or CopyTexSubImage2DEXT 2545bd8deadSopenharmony_ci parameter <target> is not TEXTURE_2D. 2555bd8deadSopenharmony_ci 2565bd8deadSopenharmony_ci INVALID_ENUM is generated if CopyTexSubImage3DEXT parameter <target> 2575bd8deadSopenharmony_ci is not TEXTURE_3D_EXT. 2585bd8deadSopenharmony_ci 2595bd8deadSopenharmony_ci INVALID_VALUE is generated if CopyTexImage1DEXT or CopyTexImage2DEXT 2605bd8deadSopenharmony_ci parameter <level> is less than zero, or greater than the maximum value 2615bd8deadSopenharmony_ci supported by the implementation. 2625bd8deadSopenharmony_ci 2635bd8deadSopenharmony_ci INVALID_ENUM is generated if CopyTexImage1DEXT or CopyTexImage2DEXT 2645bd8deadSopenharmony_ci parameter <internalformat> is not ALPHA, RGB, RGBA, LUMINANCE, 2655bd8deadSopenharmony_ci LUMINANCE_ALPHA, or one of the token values defined by EXT_texture. 2665bd8deadSopenharmony_ci 2675bd8deadSopenharmony_ci INVALID_VALUE is generated when any of the <width> or <height> 2685bd8deadSopenharmony_ci parameters of CopyTexImage1DEXT or CopyTexImage2DEXT is less than zero, 2695bd8deadSopenharmony_ci or if it cannot be represented as 2**k + 2*border for some integer k. 2705bd8deadSopenharmony_ci 2715bd8deadSopenharmony_ci INVALID_VALUE is generated if CopyTexSubImage1DEXT, CopyTexSubImage2DEXT, 2725bd8deadSopenharmony_ci or CopyTexSubImage3DEXT parameter <xoffset>, CopyTexSubImage2DEXT or 2735bd8deadSopenharmony_ci CopyTexSubImage3DEXT parameter <yoffset>, or CopyTexSubImage3DEXT 2745bd8deadSopenharmony_ci parameter <zoffset> is less than -TEXTURE_BORDER, where TEXTURE_BORDER 2755bd8deadSopenharmony_ci is the border width of the texture array to be modified. 2765bd8deadSopenharmony_ci 2775bd8deadSopenharmony_ci INVALID_VALUE is generated if CopyTexSubImage1DEXT, CopyTexSubImage2DEXT, 2785bd8deadSopenharmony_ci or CopyTexSubImage3DEXT (xoffset + width) > (TEXTURE_WIDTH - 2795bd8deadSopenharmony_ci TEXTURE_BORDER), or if CopyTexSubImage2DEXT or CopyTexSubImage3DEXT 2805bd8deadSopenharmony_ci (yoffset + height) > (TEXTURE_HEIGHT - TEXTURE_BORDER), or if 2815bd8deadSopenharmony_ci CopyTexSubImage3DEXT zoffset >= (TEXTURE_DEPTH_EXT - TEXTURE_BORDER). 2825bd8deadSopenharmony_ci Note that TEXTURE_WIDTH, TEXTURE_HEIGHT, and TEXTURE_DEPTH_EXT include 2835bd8deadSopenharmony_ci twice the border width. 2845bd8deadSopenharmony_ci 2855bd8deadSopenharmony_ci TEXTURE_TOO_LARGE_EXT is generated by CopyTexImage1DEXT or 2865bd8deadSopenharmony_ci CopyTexImage2DEXT if the specified image is too large, for any reason. 2875bd8deadSopenharmony_ci (See EXT_texture for a discussion of how applications can query the 2885bd8deadSopenharmony_ci maximum texture size.) 2895bd8deadSopenharmony_ci 2905bd8deadSopenharmony_ci INVALID_VALUE is generated if CopyTexImage1DEXT or CopyTexImage2DEXT 2915bd8deadSopenharmony_ci parameter <border> is not 0, 1, or 2. 2925bd8deadSopenharmony_ci 2935bd8deadSopenharmony_ci INVALID_OPERATION is generated if CopyTexImage1DEXT, CopyTexImage2DEXT, 2945bd8deadSopenharmony_ci CopyTexSubImage1DEXT, CopyTexSubImage2DEXT, or CopyTexSubImage3DEXT is 2955bd8deadSopenharmony_ci called between execution of Begin and the corresponding execution of 2965bd8deadSopenharmony_ci End. 2975bd8deadSopenharmony_ci 2985bd8deadSopenharmony_ciNew State 2995bd8deadSopenharmony_ci 3005bd8deadSopenharmony_ci None 3015bd8deadSopenharmony_ci 3025bd8deadSopenharmony_ciNew Implementation Dependent State 3035bd8deadSopenharmony_ci 3045bd8deadSopenharmony_ci None 305