textureSize

From OpenGL Reference
Jump to navigation Jump to search

Retrieve the dimensions of a level of a texture.

Declaration[edit]

int textureSize( gsampler1D sampler, int lod );
ivec2 textureSize( gsampler2D sampler, int lod );
ivec3 textureSize( gsampler3D sampler, int lod );
ivec2 textureSize( gsamplerCube sampler, int lod );
int textureSize( sampler1DShadow sampler, int lod );
ivec2 textureSize( sampler2DShadow sampler, int lod );
ivec2 textureSize( samplerCubeShadow sampler, int lod );
ivec3 textureSize( samplerCubeArray sampler, int lod );
ivec3 textureSize( samplerCubeArrayShadow sampler, int lod );
ivec2 textureSize( gsamplerRect sampler );
ivec2 textureSize( gsamplerRectShadow sampler );
ivec2 textureSize( gsampler1DArray sampler, int lod );
ivec3 textureSize( gsampler2DArray sampler, int lod );
ivec2 textureSize( sampler1DArrayShadow sampler, int lod );
ivec3 textureSize( sampler2DArrayShadow sampler, int lod );
int textureSize( gsamplerBuffer sampler );
ivec2 textureSize( gsampler2DMS sampler );
ivec3 textureSize( gsampler2DMSArray sampler );


Parameters[edit]

sampler - Specifies the sampler to which the texture whose dimensions to retrieve is bound.
lod - Specifies the level of the texture for which to retrieve the dimensions.


Description[edit]

 textureSize returns the dimensions of level lod (if present) of the texture bound to sampler . The components in the return value are filled in, in order, with the width, height and depth of the texture. For the array forms, the last component of the return value is the number of layers in the texture array.


Version Support[edit]

textureSize 1.3+
textureSize (samplerBuffer, samplerRect{Shadow}) 1.4+
textureSize (samplerCube{Shadow}) 4.0+

See Also[edit]

 texelFetch , texelFetchOffset , texture , textureGather , textureGatherOffset , textureGatherOffsets , textureGrad , textureGradOffset , textureLod , textureLodOffset , textureOffset , textureProj , textureProjGrad , textureProjGradOffset , textureProjLod , textureProjLodOffset , textureProjOffset , textureQueryLod 


Copyright[edit]

Copyright© 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.