MTLContext provides functionality for command encoding, binding management and graphics device management. MTLImmediate provides simple draw enablement with dynamically encoded data. These draws utilise temporary scratch buffer memory to provide minimal bandwidth overhead during workload submission.
This patch also contains empty placeholders for MTLBatch and MTLDrawList to enable testing of first pixels on-screen without failure.
The Metal API also requires access to the GHOST_Context to ensure the same pre-initialized Metal GPU device is used by the viewport. Given the explicit nature of Metal, explicit control is also needed over presentation, to ensure correct work scheduling and rendering pipeline state.
Authored by Apple: Michael Parkin-White
Ref T96261
(The diff is based on 043f59cb3b)
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15953
21 lines
718 B
C++
21 lines
718 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#ifndef __MTL_COMMON
|
|
#define __MTL_COMMON
|
|
|
|
/** -- Renderer Options -- */
|
|
/* Number of frames over which rolling averages are taken. */
|
|
#define MTL_FRAME_AVERAGE_COUNT 5
|
|
#define MTL_MAX_DRAWABLES 3
|
|
#define MTL_MAX_SET_BYTES_SIZE 4096
|
|
#define MTL_FORCE_WAIT_IDLE 0
|
|
#define MTL_MAX_COMMAND_BUFFERS 64
|
|
|
|
/* Number of frames for which we retain in-flight resources such as scratch buffers.
|
|
* Set as number of GPU frames in flight, plus an additional value for extra possible CPU frame. */
|
|
#define MTL_NUM_SAFE_FRAMES (MTL_MAX_DRAWABLES + 1)
|
|
|
|
/* Display debug information about missing attributes and incorrect vertex formats. */
|
|
#define MTL_DEBUG_SHADER_ATTRIBUTES 0
|
|
#endif
|