• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# gl_ClipDistance extension support in Metal back-end
2
3OpenGL GLSL's `gl_ClipDistance` is equivalent to `[[clip_distance]]` attribute in the Metal Shading
4Language. However, OpenGL supports disabling/enabling individual `gl_ClipDistance[i]` on the API
5level side. Writing to `gl_ClipDistance[i]` in shader will be ignored if it is disabled. Metal
6doesn't have any equivalent API to disable/enable the writing, though writing to a `clip_distance`
7variable automatically enables it.
8
9To emulate this enabling/disabling API, the Metal back-end uses a similar implementation as what
10[Vulkan back-end does](../../vulkan/doc/APPLE_clip_distance.md). Please refer to that document for
11more details.
12