-/*
+/**
* This is the software fallback for Driver.TexImage1D()
* and Driver.CopyTexImage1D().
* \sa _mesa_store_teximage2d()
+ * Note that the width may not be the actual texture width since it may
+ * be changed by convolution w/ GL_REDUCE. The texImage->Width field will
+ * have the actual texture size.
*/
void
_mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- GLint postConvWidth = width;
GLint sizeInBytes;
(void) border;
- if (_mesa_is_color_format(internalFormat)) {
- _mesa_adjust_image_for_convolution(ctx, 1, &postConvWidth, NULL);
- }
-
choose_texture_format(ctx, texImage, 1, format, type, internalFormat);
/* allocate memory */
if (texImage->IsCompressed)
sizeInBytes = texImage->CompressedSize;
else
- sizeInBytes = postConvWidth * texImage->TexFormat->TexelBytes;
+ sizeInBytes = texImage->Width * texImage->TexFormat->TexelBytes;
texImage->Data = _mesa_alloc_texmemory(sizeInBytes);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D");
struct gl_texture_object *texObj,
struct gl_texture_image *texImage)
{
- GLint postConvWidth = width, postConvHeight = height;
GLint texelBytes, sizeInBytes;
(void) border;
- if (_mesa_is_color_format(internalFormat)) {
- _mesa_adjust_image_for_convolution(ctx, 2, &postConvWidth,
- &postConvHeight);
- }
-
choose_texture_format(ctx, texImage, 2, format, type, internalFormat);
texelBytes = texImage->TexFormat->TexelBytes;
if (texImage->IsCompressed)
sizeInBytes = texImage->CompressedSize;
else
- sizeInBytes = postConvWidth * postConvHeight * texelBytes;
+ sizeInBytes = texImage->Width * texImage->Height * texelBytes;
texImage->Data = _mesa_alloc_texmemory(sizeInBytes);
if (!texImage->Data) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D");