st/mesa: don't affect original st_CompressedTexSubImage parameters

The fallback path is still possible here so let keep them as is.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3952
Fixes: 4b02f165 ("st/mesa: implement PBO upload for glCompressedTex(Sub)Image")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8258>
(cherry picked from commit 5ae7d40648)
This commit is contained in:
Andrii Simiklit 2020-12-28 15:58:24 +02:00 committed by Dylan Baker
parent 773d683a89
commit f121623020
2 changed files with 4 additions and 4 deletions

View file

@ -1372,7 +1372,7 @@
"description": "st/mesa: don't affect original st_CompressedTexSubImage parameters",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "4b02f165375ccff65e117651a9a75920a1b4e502"
},

View file

@ -1881,14 +1881,14 @@ st_CompressedTexSubImage(struct gl_context *ctx, GLuint dims,
? 0 : texImage->TexObject->MinLevel + texImage->Level;
unsigned max_layer = util_max_layer(texture, level);
z += texImage->Face + texImage->TexObject->MinLayer;
GLint layer = z + texImage->Face + texImage->TexObject->MinLayer;
struct pipe_surface templ;
memset(&templ, 0, sizeof(templ));
templ.format = copy_format;
templ.u.tex.level = level;
templ.u.tex.first_layer = MIN2(z, max_layer);
templ.u.tex.last_layer = MIN2(z + d - 1, max_layer);
templ.u.tex.first_layer = MIN2(layer, max_layer);
templ.u.tex.last_layer = MIN2(layer + d - 1, max_layer);
surface = pipe->create_surface(pipe, texture, &templ);
if (!surface)