diff options
author | Danylo Piliaiev <danylo.piliaiev@globallogic.com> | 2020-06-12 16:04:44 +0300 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2020-06-24 23:03:51 +0200 |
commit | c80086b4949b428be6072d172595dbb3dd22196e (patch) | |
tree | 8aeb69b055cd907837b70ff576d0b7be36f601ad | |
parent | 94a94e1a09ca262f9b5c8f1bd4be3428cc4ae2fb (diff) |
st/mesa: account for "loose", per-mipmap level textures in CopyImageSubData
We may have "loose", per-image gallium resources. The src_image->Level
may not match the gallium resource texture level. In such case it is
prescribed (in st_AllocTextureImageBuffer) to specify mipmap level
as zero.
Fixes: f04f13622f3e71bee057d60a6be9c53b92b56cc9
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5477>
(cherry picked from commit 8ce8895b69a7523513eceed096233c3a348880a7)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_copyimage.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json index c3e58196b7a..7b88f168b00 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2173,7 +2173,7 @@ "description": "st/mesa: account for \"loose\", per-mipmap level textures in CopyImageSubData", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "f04f13622f3e71bee057d60a6be9c53b92b56cc9" }, diff --git a/src/mesa/state_tracker/st_cb_copyimage.c b/src/mesa/state_tracker/st_cb_copyimage.c index a58cdf62703..5d9c77fdede 100644 --- a/src/mesa/state_tracker/st_cb_copyimage.c +++ b/src/mesa/state_tracker/st_cb_copyimage.c @@ -645,8 +645,9 @@ st_CopyImageSubData(struct gl_context *ctx, if (src_image) { struct st_texture_image *src = st_texture_image(src_image); + struct st_texture_object *stObj = st_texture_object(src_image->TexObject); src_res = src->pt; - src_level = src_image->Level; + src_level = stObj->pt != src_res ? 0 : src_image->Level; src_z += src_image->Face; if (src_image->TexObject->Immutable) { src_level += src_image->TexObject->MinLevel; @@ -660,8 +661,9 @@ st_CopyImageSubData(struct gl_context *ctx, if (dst_image) { struct st_texture_image *dst = st_texture_image(dst_image); + struct st_texture_object *stObj = st_texture_object(dst_image->TexObject); dst_res = dst->pt; - dst_level = dst_image->Level; + dst_level = stObj->pt != dst_res ? 0 : dst_image->Level; dst_z += dst_image->Face; if (dst_image->TexObject->Immutable) { dst_level += dst_image->TexObject->MinLevel; |