mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-27 01:20:36 +00:00
mesa: avoid reading back textures from VRAM
This can be very slow on dGPU. I tried a different version that would allocate a full row and then do a single memcpy per row but the performance was similar so I kept the simple version. Cc: mesa-stable Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18484> (cherry picked from commit a5b1a811053eef74e8e0353ebbe2bb9c68e5c26b)
This commit is contained in:
parent
2c56768a2f
commit
6ce21ce910
@ -526,7 +526,7 @@
|
||||
"description": "mesa: avoid reading back textures from VRAM",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
@ -449,7 +449,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS)
|
||||
/* the 24 depth bits will be in the low position: */
|
||||
_mesa_unpack_depth_span(ctx, srcWidth,
|
||||
GL_UNSIGNED_INT, /* dst type */
|
||||
keepstencil ? depth : dstRow, /* dst addr */
|
||||
depth, /* dst addr */
|
||||
depthScale,
|
||||
srcType, src, srcPacking);
|
||||
|
||||
@ -463,7 +463,9 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS)
|
||||
|
||||
/* merge stencil values into depth values */
|
||||
for (i = 0; i < srcWidth; i++) {
|
||||
if (keepstencil)
|
||||
if (!keepstencil && !keepdepth)
|
||||
dstRow[i] = depth[i] | (stencil[i] << 24);
|
||||
else if (keepstencil)
|
||||
dstRow[i] = depth[i] | (dstRow[i] & 0xFF000000);
|
||||
else
|
||||
dstRow[i] = (dstRow[i] & 0xFFFFFF) | (stencil[i] << 24);
|
||||
|
Loading…
Reference in New Issue
Block a user