Page MenuHome

Fix T103658: Resolve Metal partial texture update overwriting whole image when staging textures are used.
ClosedPublic

Authored by Jason Fielder (jason_apple) on Jan 5 2023, 4:11 PM.

Details

Summary

Staging texture update copied over the entire texture, rather than just the region of the texture which had been updated. Also added early-exit for cases where the net texture update extent was zero, as this was causing validation failures.

Authored by Apple: Michael Parkin-White

Ref T103658
Ref T96261

Diff Detail

Repository
rB Blender

Event Timeline

Jason Fielder (jason_apple) requested review of this revision.Jan 5 2023, 4:11 PM
Jason Fielder (jason_apple) created this revision.

To further this, I'll do another texture usage flags optimisation pass after other issues have been fixed. Using staging textures is a catch-all for all compatibility paths, but it is not the most optimal. For cases where textures will be updated frequently, it is more efficient for these textures to have write support and to be updated directly.
The motivation for avoiding the SHADER_USAGE_WRITE flag is that it disables lossless compression, which will reduce sampling performance. However, this is primarily beneficial for render targets, which are updated within the fragment shading pass. As opposed to all textures.

This revision is now accepted and ready to land.Jan 7 2023, 5:21 PM