Metal: Implement suppot for clip plane toggling via GPU_clip_distances.
The Metal backend already supports output for the 6 clipping planes via gl_ClipDistances equivalent, however, functionality to toggle clipping plane enablement was missing. Authored by Apple: Michael Parkin-White Ref T96261 Depends on D16777 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D16813
This commit is contained in:
@@ -42,6 +42,22 @@ constant int MTL_AttributeConvert15 [[function_constant(17)]];
|
||||
* Unused if function constant not set. */
|
||||
constant int MTL_transform_feedback_buffer_index [[function_constant(18)]];
|
||||
|
||||
/** Clip distance enablement. */
|
||||
/* General toggle to control whether any clipping distanes are written at all.
|
||||
* This is an optimization to avoid having the clipping distance shader output
|
||||
* paramter if it is not needed. */
|
||||
constant int MTL_clip_distances_enabled [[function_constant(19)]];
|
||||
|
||||
/* If clipping planes are enabled at all, then we require an enablement
|
||||
* flag per clipping plane. If enabled, then gl_ClipDistances[N] will
|
||||
* control clipping for a given plane, otherwise the value is ignored. */
|
||||
constant int MTL_clip_distance_enabled0 [[function_constant(20)]];
|
||||
constant int MTL_clip_distance_enabled1 [[function_constant(21)]];
|
||||
constant int MTL_clip_distance_enabled2 [[function_constant(22)]];
|
||||
constant int MTL_clip_distance_enabled3 [[function_constant(23)]];
|
||||
constant int MTL_clip_distance_enabled4 [[function_constant(24)]];
|
||||
constant int MTL_clip_distance_enabled5 [[function_constant(25)]];
|
||||
|
||||
/** Internal attribute conversion functionality. */
|
||||
/* Following descriptions in mtl_shader.hh, Metal only supports some implicit
|
||||
* attribute type conversions. These conversions occur when there is a difference
|
||||
|
||||
Reference in New Issue
Block a user