Page MenuHome

Metal: Addressing a number of small outstanding issues across Metal backend.
ClosedPublic

Authored by Jason Fielder (jason_apple) on Dec 14 2022, 6:07 PM.

Details

Summary
  • Support for non-contiguous shader resource bindings for all cases required by create-info
  • Implement missing geometry shader alternative path for edit curve handle.
  • Add support for non-float dummy textures to address all cases where default bindings may be required.

Authored by Apple: Michael Parkin-White
Ref T96261
Depends on D16721

Diff Detail

Repository
rB Blender
Branch
viewport_commits/MetalFinalCleanup_Dec14
Build Status
Buildable 25038
Build 25038: arc lint + arc unit

Event Timeline

Jason Fielder (jason_apple) requested review of this revision.Dec 14 2022, 6:07 PM
Jason Fielder (jason_apple) created this revision.
Clément Foucault (fclem) requested changes to this revision.Dec 18 2022, 11:38 PM

The changes looks fine. I just have a couple of nitpicks.

However, I still wonder why the different default textures are needed. If I remember correctly, theses are only used if there is a missing texture from an Image datablock and thoses texture are always floats as far as I know.

source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl
38

this todo is a quite cryptic

157

inconsistent break placement. Move to inside the code blocks.

This revision now requires changes to proceed.Dec 18 2022, 11:38 PM

The changes looks fine. I just have a couple of nitpicks.

However, I still wonder why the different default textures are needed. If I remember correctly, theses are only used if there is a missing texture from an Image datablock and thoses texture are always floats as far as I know.

Thanks for the review!
As discussed in the meeting, this appears to be purely an issue of satisfying Metal validation being strict about having the correct image formats/types bound to a given sampler, rather than pure correctness. Disabling validation enables the app to work correctly, but the default textures with formats were added as a catch-all to also cover future functionality.

It hadn't been added up until this point, as paths were not triggering errors. I believe the only real problematic case being triggered was for texture buffers, where it appeared some texture buffers wanted floating point format, and others integer.

Though I will confirm the case where a default texture of mis-matched format is needed (hair shaders jump to mind, before data is prepared, or for the cases where a particular set of data is not used).

source/blender/draw/engines/overlay/shaders/overlay_edit_curve_handle_vert_no_geom.glsl
38

Ah my bad, this was a left-over comment, nothing needed changing, as added support for TriangleStrip to the geometry workaround path.

Will remove the line as it's irrelevant now.

Addressing a number of small outstanding issues across Metal backend.

  • Support for non-contiguous shader resource bindings for all cases required by create-info
  • Implement missing geometry shader alternative path for edit curve handle.
  • Add support for non-float dummy textures to address all cases where default bindings may be required.
This revision is now accepted and ready to land.Dec 20 2022, 12:04 PM