Blender V4.3
mtl_capabilities.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11namespace blender {
12namespace gpu {
13
14/*** Derived from: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf ***/
17#define MTL_MAX_TEXTURE_SLOTS 128
18#define MTL_MAX_SAMPLER_SLOTS MTL_MAX_TEXTURE_SLOTS
19/* Max limit without using bind-less for samplers. */
20#define MTL_MAX_DEFAULT_SAMPLERS 16
21/* Total maximum buffers which can be bound to an encoder, for use within a shader.
22 * Uniform buffers and storage buffers share the set of available bind buffers.
23 * The total number of buffer bindings must be <= MTL_MAX_BUFFER_BINDINGS
24 * We also require an additional 3 core buffers for:
25 * - Argument buffer for bindless resources (e.g. samplers)
26 * - Transform feedback buffer
27 * - Default push constant block
28 * Along with up to 6+1 buffers for vertex data, and index data. */
29#define MTL_MAX_BUFFER_BINDINGS 31
30#define MTL_MAX_VERTEX_INPUT_ATTRIBUTES 31
31#define MTL_MAX_UNIFORMS_PER_BLOCK 64
32
34
35/* Context-specific limits -- populated in 'MTLBackend::platform_init' */
37
38 /* Variable Limits & feature sets. */
39 int max_color_render_targets = 4; /* Minimum = 4 */
40 int buffer_alignment_for_textures = 256; /* Upper bound = 256 bytes */
41 int minimum_buffer_offset_alignment = 256; /* Upper bound = 256 bytes */
42
43 /* Capabilities */
46 bool supports_cubemaps = true;
53
54 /* GPU Family */
60
61 /* CPU Info */
64};
65
66} // namespace gpu
67} // namespace blender