diff options
author | marha <marha@users.sourceforge.net> | 2011-11-04 08:57:20 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-11-04 08:57:20 +0100 |
commit | 02f377d5e2dd18537d0807ad63675a0970b5a37d (patch) | |
tree | 1814c826db4d95a30ad71431d9c84b8d2611ec18 /mesalib/src/mesa/swrast/s_texture.c | |
parent | 6f4feafd4d22beaabfb0202e66b0dea9047ee084 (diff) | |
download | vcxsrv-02f377d5e2dd18537d0807ad63675a0970b5a37d.tar.gz vcxsrv-02f377d5e2dd18537d0807ad63675a0970b5a37d.tar.bz2 vcxsrv-02f377d5e2dd18537d0807ad63675a0970b5a37d.zip |
xserver pixman mesa git update 4 nov 2011
Diffstat (limited to 'mesalib/src/mesa/swrast/s_texture.c')
-rw-r--r-- | mesalib/src/mesa/swrast/s_texture.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mesalib/src/mesa/swrast/s_texture.c b/mesalib/src/mesa/swrast/s_texture.c index fb1edb318..ba67c6fa4 100644 --- a/mesalib/src/mesa/swrast/s_texture.c +++ b/mesalib/src/mesa/swrast/s_texture.c @@ -359,3 +359,35 @@ _swrast_unmap_renderbuffers(struct gl_context *ctx) if (ctx->ReadBuffer != ctx->DrawBuffer) map_unmap_renderbuffers(ctx, ctx->ReadBuffer, GL_FALSE); } + + + +/** + * Called via ctx->Driver.AllocTextureStorage() + * Just have to allocate memory for the texture images. + */ +GLboolean +_swrast_AllocTextureStorage(struct gl_context *ctx, + struct gl_texture_object *texObj, + GLsizei levels, GLsizei width, + GLsizei height, GLsizei depth) +{ + const GLint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLint face, level; + + for (face = 0; face < numFaces; face++) { + for (level = 0; level < levels; level++) { + struct gl_texture_image *texImage = texObj->Image[face][level]; + if (!_swrast_alloc_texture_image_buffer(ctx, texImage, + texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth)) { + return GL_FALSE; + } + } + } + + return GL_TRUE; +} + |