Page MenuHome

Metal: MTLBatch and MTLDrawList implementation.
ClosedPublic

Authored by Thomas Dinges (dingto) on Sep 29 2022, 4:22 PM.

Details

Summary

MTLBatch and MTLDrawList implementation enables use of Metal Viewport for UI and Workbench. Includes Vertex descriptor caching and SSBO Vertex Fetch mode draw call submission.

Authored by Apple: Michael Parkin-White

Ref T96261

Diff Detail

Repository
rB Blender

Event Timeline

Thomas Dinges (dingto) requested review of this revision.Sep 29 2022, 4:22 PM
Thomas Dinges (dingto) created this revision.
Jeroen Bakker (jbakker) added inline comments.
source/blender/gpu/intern/gpu_texture_private.hh
434

Use ELEM macro for better readability.

437

Use ELEM macro for better readability.

Looks good to me. Just have some minor comments.

I will commit that once both my and Jeroen's comments are addressed.

source/blender/gpu/metal/mtl_batch.mm
33–42

These could be omitted and the values could be set as default values in the struct definition.

610–611

Can use Span<MTLVertBuf *> for better safety.

791

I guess this is not a problem for now since most of the emulated cases are for UI drawing. Am I correct in this assumption?

This revision is now accepted and ready to land.Oct 8 2022, 3:31 PM

Looks good to me. Just have some minor comments.
I will commit that once both my and Jeroen's comments are addressed.

Thanks! Will address feedback and re-submit.

source/blender/gpu/metal/mtl_batch.mm
791

Yes, so far this has not shown up as an issue, so I don't know if any paths need to consider this. The TODO was there to acknowledge the potential for an issue should it arise.

Would it be best to remove this, or keep the comment as a hint in case a use case with inverse face winding arises?

Metal: MTLBatch and MTLDrawList implementation.

MTLBatch and MTLDrawList implementation enables use of Metal Viewport for UI and Workbench. Includes Vertex descriptor caching and SSBO Vertex Fetch mode draw call submission.

DIFF Feedback addressed.

Authored by Apple: Michael Parkin-White

Ref T96261