Skip to content

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: f04f1362

Passes Intel CI: https://mesa-ci.01.org/global_logic/builds/274/group/63a9f0ea7bb98050796b649e85481845

Found by replaying a renderdoc of Warthunder (it crashed).
Piglit test: piglit!313 (merged)

In short, the crash fixed by this commit could be reproduced by initializing mipmap levels from the lowest to zero.

Edited by Danylo Piliaiev

Merge request reports