diff options
Diffstat (limited to 'source/blender/gpu/metal/mtl_capabilities.hh')
-rw-r--r-- | source/blender/gpu/metal/mtl_capabilities.hh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source/blender/gpu/metal/mtl_capabilities.hh b/source/blender/gpu/metal/mtl_capabilities.hh new file mode 100644 index 00000000000..8acdf5f303a --- /dev/null +++ b/source/blender/gpu/metal/mtl_capabilities.hh @@ -0,0 +1,45 @@ +/** \file + * \ingroup gpu + */ + +#pragma once + +namespace blender { +namespace gpu { + +/*** Derived from: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf ***/ +/** Upper Bound/Fixed Limits **/ + +#define METAL_MAX_TEXTURE_SLOTS 128 +#define METAL_MAX_SAMPLER_SLOTS METAL_MAX_TEXTURE_SLOTS +#define METAL_MAX_UNIFORM_BUFFER_BINDINGS 31 +#define METAL_MAX_VERTEX_INPUT_ATTRIBUTES 31 +#define METAL_MAX_UNIFORMS_PER_BLOCK 64 + +/* Context-specific limits -- populated in 'MTLBackend::platform_init' */ +typedef struct MTLCapabilities { + + /* Variable Limits & faeture sets */ + int max_color_render_targets = 4; /* Minimum = 4 */ + int buffer_alignment_for_textures = 256; /* Upper bound = 256 bytes */ + int minimum_buffer_offset_alignment = 256; /* Upper bound = 256 bytes */ + + /* Capabilities */ + bool supports_vertex_amplification = false; + bool supports_texture_swizzle = true; + bool supports_cubemaps = true; + bool supports_layered_rendering = true; + bool supports_memory_barriers = false; + bool supports_sampler_border_color = false; + bool supports_argument_buffers_tier2 = false; + + /* GPU Family */ + bool supports_family_mac1 = false; + bool supports_family_mac2 = false; + bool supports_family_mac_catalyst1 = false; + bool supports_family_mac_catalyst2 = false; + +} MTLCapabilities; + +} // namespace gpu +} // namespace blender |