mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 10:10:14 +01:00
mesa: only copy the requested teximage faces
Cube maps are special in that they have separate teximages for each
face. We handled that by copying the data to them separately, but in
case zoffset != 0 or depth != 6 we would read off the end of the client
array or modify the wrong images.
zoffset/depth have already been verified by the time the code gets to
this stage, so no need to double-check.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2259b11100)
This commit is contained in:
parent
594388e577
commit
896ef5cb95
1 changed files with 2 additions and 2 deletions
|
|
@ -3711,12 +3711,12 @@ texturesubimage(struct gl_context *ctx, GLuint dims,
|
|||
rowStride = _mesa_image_image_stride(&ctx->Unpack, width, height,
|
||||
format, type);
|
||||
/* Copy in each face. */
|
||||
for (i = 0; i < 6; ++i) {
|
||||
for (i = zoffset; i < zoffset + depth; ++i) {
|
||||
texImage = texObj->Image[i][level];
|
||||
assert(texImage);
|
||||
|
||||
_mesa_texture_sub_image(ctx, 3, texObj, texImage, texObj->Target,
|
||||
level, xoffset, yoffset, zoffset,
|
||||
level, xoffset, yoffset, 0,
|
||||
width, height, 1, format,
|
||||
type, pixels, true);
|
||||
pixels = (GLubyte *) pixels + rowStride;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue