Fix compressed texture loads for non-minimal pitches again
My commit eea6a7639f
does a memcpy of height
lines, but that's wrong because the texture has a block layout and we
must thus use the number of vertical blocks instead of the height.
Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
2204447de3
commit
9328f3a670
|
@ -686,9 +686,11 @@ st_TexImage(GLcontext * ctx,
|
|||
{
|
||||
char *dst = texImage->Data;
|
||||
const char *src = pixels;
|
||||
int i;
|
||||
GLuint i, bw, bh, lines;
|
||||
_mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
|
||||
lines = (height + bh - 1) / bh;
|
||||
|
||||
for(i = 0; i < height; ++i)
|
||||
for(i = 0; i < lines; ++i)
|
||||
{
|
||||
memcpy(dst, src, srcImageStride);
|
||||
dst += dstRowStride;
|
||||
|
|
Loading…
Reference in New Issue