i965/miptree: Use intel_miptree_copy for maps
What we're really doing is copying a texture not blitting it in the sense of glBlitFramebuffers. Also, the intel_miptree_copy function is capable of properly handling compressed textures which intel_miptree_blit is not. Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97473 Cc: "13.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
@@ -2598,12 +2598,10 @@ intel_miptree_map_blit(struct brw_context *brw,
|
|||||||
* temporary buffer back out.
|
* temporary buffer back out.
|
||||||
*/
|
*/
|
||||||
if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
|
if (!(map->mode & GL_MAP_INVALIDATE_RANGE_BIT)) {
|
||||||
if (!intel_miptree_blit(brw,
|
if (!intel_miptree_copy(brw,
|
||||||
mt, level, slice,
|
mt, level, slice, map->x, map->y,
|
||||||
map->x, map->y, false,
|
map->linear_mt, 0, 0, 0, 0,
|
||||||
map->linear_mt, 0, 0,
|
map->w, map->h)) {
|
||||||
0, 0, false,
|
|
||||||
map->w, map->h, GL_COPY)) {
|
|
||||||
fprintf(stderr, "Failed to blit\n");
|
fprintf(stderr, "Failed to blit\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@@ -2636,12 +2634,10 @@ intel_miptree_unmap_blit(struct brw_context *brw,
|
|||||||
intel_miptree_unmap_raw(map->linear_mt);
|
intel_miptree_unmap_raw(map->linear_mt);
|
||||||
|
|
||||||
if (map->mode & GL_MAP_WRITE_BIT) {
|
if (map->mode & GL_MAP_WRITE_BIT) {
|
||||||
bool ok = intel_miptree_blit(brw,
|
bool ok = intel_miptree_copy(brw,
|
||||||
map->linear_mt, 0, 0,
|
map->linear_mt, 0, 0, 0, 0,
|
||||||
0, 0, false,
|
mt, level, slice, map->x, map->y,
|
||||||
mt, level, slice,
|
map->w, map->h);
|
||||||
map->x, map->y, false,
|
|
||||||
map->w, map->h, GL_COPY);
|
|
||||||
WARN_ONCE(!ok, "Failed to blit from linear temporary mapping");
|
WARN_ONCE(!ok, "Failed to blit from linear temporary mapping");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user