Blender  V3.3
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
blender::gpu Namespace Reference

Namespaces

 debug
 
 GLVertArray
 
 shader
 
 shader_builder
 
 tests
 

Classes

class  GPUBackend
 
class  Batch
 
struct  GPUCapabilities
 
class  Context
 
class  DrawList
 
class  FrameBuffer
 
class  Immediate
 
class  IndexBuf
 
class  GPUPlatformGlobal
 
class  QueryPool
 
struct  GPUSource
 
struct  ShaderInput
 
class  ShaderInterface
 
class  Shader
 
struct  LogCursor
 
struct  GPULogItem
 
class  GPULogParser
 
union  GPUState
 
union  GPUStateMutable
 
class  StateManager
 
class  StorageBuf
 
class  Texture
 
class  UniformBuf
 
class  VertBuf
 
class  MTLBackend
 
struct  MTLCapabilities
 
struct  MTLTextureBinding
 
struct  MTLSamplerBinding
 
struct  MTLRenderPassState
 
struct  MTLContextDepthStencilState
 
struct  MTLContextTextureUtils
 
struct  MTLSamplerArray
 
struct  MTLUniformBufferBinding
 
struct  MTLContextGlobalShaderPipelineState
 
class  MTLCommandBufferManager
 
class  MTLContext
 
struct  MTLAttachment
 
class  MTLFrameBuffer
 
class  MTLBuffer
 
struct  MTLBufferRange
 
class  MTLCircularBuffer
 
struct  MTLBufferHandle
 
struct  CompareMTLBuffer
 
class  MTLSafeFreeList
 
class  MTLBufferPool
 
class  MTLScratchBufferManager
 
class  MTLQueryPool
 
class  MTLStateManager
 
struct  MTLSamplerState
 
class  MTLTexture
 
class  MTLUniformBuf
 
class  GLBackend
 
class  GLVaoCache
 
class  GLBatch
 
class  GLCompute
 
class  GLSharedOrphanLists
 
class  GLContext
 
class  GLDrawList
 
class  GLFrameBuffer
 
class  GLImmediate
 
class  GLIndexBuf
 
class  GLQueryPool
 
class  GLShader
 
class  GLLogParser
 
class  GLShaderInterface
 
class  GLStateManager
 
class  GLStorageBuf
 
class  GLTexture
 
class  GLUniformBuf
 
class  GLVertBuf
 
class  GPUTest
 
class  GPUOpenGLTest
 

Typedefs

typedef Vector< StringRefDebugStack
 
typedef enum blender::gpu::GPUQueryType GPUQueryType
 
using GPUSourceDictionnary = Map< StringRef, struct GPUSource * >
 
using GPUFunctionDictionnary = Map< StringRef, struct GPUFunction * >
 
typedef struct blender::gpu::ShaderInput ShaderInput
 
typedef enum blender::gpu::eGPUTextureFormatFlag eGPUTextureFormatFlag
 
typedef enum blender::gpu::eGPUTextureType eGPUTextureType
 
typedef enum blender::gpu::MTLPipelineStateDirtyFlag MTLPipelineStateDirtyFlag
 
Memory Management.
using MTLTemporaryBuffer = MTLBufferRange
 

Enumerations

enum  GPUIndexBufType { GPU_INDEX_U16 , GPU_INDEX_U32 }
 
enum  GPUQueryType { GPU_QUERY_OCCLUSION = 0 }
 
enum class  Severity { Unknown , Warning , Error }
 
enum  eGPUTextureFormatFlag {
  GPU_FORMAT_DEPTH = (1 << 0) , GPU_FORMAT_STENCIL = (1 << 1) , GPU_FORMAT_INTEGER = (1 << 2) , GPU_FORMAT_FLOAT = (1 << 3) ,
  GPU_FORMAT_COMPRESSED = (1 << 4) , GPU_FORMAT_DEPTH_STENCIL = (GPU_FORMAT_DEPTH | GPU_FORMAT_STENCIL)
}
 
enum  eGPUTextureType {
  GPU_TEXTURE_1D = (1 << 0) , GPU_TEXTURE_2D = (1 << 1) , GPU_TEXTURE_3D = (1 << 2) , GPU_TEXTURE_CUBE = (1 << 3) ,
  GPU_TEXTURE_ARRAY = (1 << 4) , GPU_TEXTURE_BUFFER = (1 << 5) , GPU_TEXTURE_1D_ARRAY = (GPU_TEXTURE_1D | GPU_TEXTURE_ARRAY) , GPU_TEXTURE_2D_ARRAY = (GPU_TEXTURE_2D | GPU_TEXTURE_ARRAY) ,
  GPU_TEXTURE_CUBE_ARRAY = (GPU_TEXTURE_CUBE | GPU_TEXTURE_ARRAY)
}
 
enum  MTLPipelineStateDirtyFlag {
  MTL_PIPELINE_STATE_NULL_FLAG = 0 , MTL_PIPELINE_STATE_VIEWPORT_FLAG = (1 << 0) , MTL_PIPELINE_STATE_SCISSOR_FLAG = (1 << 1) , MTL_PIPELINE_STATE_DEPTHSTENCIL_FLAG = (1 << 2) ,
  MTL_PIPELINE_STATE_PSO_FLAG = (1 << 3) , MTL_PIPELINE_STATE_FRONT_FACING_FLAG = (1 << 4) , MTL_PIPELINE_STATE_CULLMODE_FLAG = (1 << 5) , MTL_PIPELINE_STATE_ALL_FLAG
}
 

Functions

static GPUContextwrap (Context *ctx)
 
static Contextunwrap (GPUContext *ctx)
 
static const Contextunwrap (const GPUContext *ctx)
 
static GPUDrawListwrap (DrawList *vert)
 
static DrawListunwrap (GPUDrawList *vert)
 
static const DrawListunwrap (const GPUDrawList *vert)
 
static GPUFrameBufferwrap (FrameBuffer *vert)
 
static FrameBufferunwrap (GPUFrameBuffer *vert)
 
static const FrameBufferunwrap (const GPUFrameBuffer *vert)
 
static size_t to_bytesize (GPUIndexBufType type)
 
static GPUIndexBufwrap (IndexBuf *indexbuf)
 
static IndexBufunwrap (GPUIndexBuf *indexbuf)
 
static const IndexBufunwrap (const GPUIndexBuf *indexbuf)
 
static int indices_per_primitive (GPUPrimType prim_type)
 
static char * create_key (eGPUSupportLevel support_level, const char *vendor, const char *renderer, const char *version)
 
static char * create_gpu_name (const char *vendor, const char *renderer, const char *version)
 
static void sort_input_list (MutableSpan< ShaderInput > dst)
 
static GPUShaderwrap (Shader *vert)
 
static Shaderunwrap (GPUShader *vert)
 
static const Shaderunwrap (const GPUShader *vert)
 
 BLI_STATIC_ASSERT (sizeof(GPUState)==sizeof(uint64_t), "GPUState is too big.")
 
bool operator== (const GPUState &a, const GPUState &b)
 
bool operator!= (const GPUState &a, const GPUState &b)
 
GPUState operator^ (const GPUState &a, const GPUState &b)
 
GPUState operator~ (const GPUState &a)
 
 BLI_STATIC_ASSERT (sizeof(GPUStateMutable)==sizeof(GPUStateMutable::data), "GPUStateMutable is too big.")
 
bool operator== (const GPUStateMutable &a, const GPUStateMutable &b)
 
bool operator!= (const GPUStateMutable &a, const GPUStateMutable &b)
 
GPUStateMutable operator^ (const GPUStateMutable &a, const GPUStateMutable &b)
 
GPUStateMutable operator~ (const GPUStateMutable &a)
 
static GPUStorageBufwrap (StorageBuf *vert)
 
static StorageBufunwrap (GPUStorageBuf *vert)
 
static const StorageBufunwrap (const GPUStorageBuf *vert)
 
static GPUTexturewrap (Texture *vert)
 
static Textureunwrap (GPUTexture *vert)
 
static const Textureunwrap (const GPUTexture *vert)
 
size_t to_bytesize (eGPUTextureFormat format)
 
size_t to_block_size (eGPUTextureFormat data_type)
 
eGPUTextureFormatFlag to_format_flag (eGPUTextureFormat format)
 
int to_component_len (eGPUTextureFormat format)
 
size_t to_bytesize (eGPUDataFormat data_format)
 
size_t to_bytesize (eGPUTextureFormat tex_format, eGPUDataFormat data_format)
 
bool validate_data_format (eGPUTextureFormat tex_format, eGPUDataFormat data_format)
 
bool validate_data_format_mtl (eGPUTextureFormat tex_format, eGPUDataFormat data_format)
 
eGPUDataFormat to_data_format (eGPUTextureFormat tex_format)
 
eGPUFrameBufferBits to_framebuffer_bits (eGPUTextureFormat tex_format)
 
static eGPUTextureFormat to_texture_format (const GPUVertFormat *format)
 
static GPUUniformBufwrap (UniformBuf *vert)
 
static UniformBufunwrap (GPUUniformBuf *vert)
 
static const UniformBufunwrap (const GPUUniformBuf *vert)
 
static GPUVertBufwrap (VertBuf *vert)
 
static VertBufunwrap (GPUVertBuf *vert)
 
static const VertBufunwrap (const GPUVertBuf *vert)
 
 ENUM_OPERATORS (MTLPipelineStateDirtyFlag, MTL_PIPELINE_STATE_CULLMODE_FLAG)
 
static MTLVisibilityResultMode to_mtl_type (GPUQueryType type)
 
std::string tex_data_format_to_msl_type_str (eGPUDataFormat type)
 
std::string tex_data_format_to_msl_texture_template_type (eGPUDataFormat type)
 
bool mtl_format_is_writable (MTLPixelFormat format)
 
MTLPixelFormat mtl_format_get_writeable_view_format (MTLPixelFormat format)
 
eGPUDataFormat to_mtl_internal_data_format (eGPUTextureFormat tex_format)
 
 DEBUG_FUNC_OVERRIDE (glClear, GLbitfield, mask)
 
 DEBUG_FUNC_OVERRIDE (glDeleteTextures, GLsizei, n, const GLuint *, textures)
 
 DEBUG_FUNC_OVERRIDE (glDrawArrays, GLenum, mode, GLint, first, GLsizei, count)
 
 DEBUG_FUNC_OVERRIDE (glFinish, void)
 
 DEBUG_FUNC_OVERRIDE (glFlush, void)
 
 DEBUG_FUNC_OVERRIDE (glGenTextures, GLsizei, n, GLuint *, textures)
 
 DEBUG_FUNC_OVERRIDE (glGetTexImage, GLenum, target, GLint, level, GLenum, format, GLenum, type, void *, pixels)
 
 DEBUG_FUNC_OVERRIDE (glReadBuffer, GLenum, mode)
 
 DEBUG_FUNC_OVERRIDE (glReadPixels, GLint, x, GLint, y, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, void *, pixels)
 
 DEBUG_FUNC_OVERRIDE (glTexImage1D, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLint, border, GLenum, format, GLenum, type, const void *, pixels)
 
 DEBUG_FUNC_OVERRIDE (glTexImage2D, GLenum, target, GLint, level, GLint, internalformat, GLsizei, width, GLsizei, height, GLint, border, GLenum, format, GLenum, type, const void *, pixels)
 
 DEBUG_FUNC_OVERRIDE (glTexParameteri, GLenum, target, GLenum, pname, GLint, param)
 
 DEBUG_FUNC_OVERRIDE (glTexParameteriv, GLenum, target, GLenum, pname, const GLint *, params)
 
 DEBUG_FUNC_OVERRIDE (glTexSubImage1D, GLenum, target, GLint, level, GLint, xoffset, GLsizei, width, GLenum, format, GLenum, type, const void *, pixels)
 
 DEBUG_FUNC_OVERRIDE (glTexSubImage2D, GLenum, target, GLint, level, GLint, xoffset, GLint, yoffset, GLsizei, width, GLsizei, height, GLenum, format, GLenum, type, const void *, pixels)
 
static GLenum to_gl (GPUIndexBufType type)
 
static GLenum to_gl (GPUPrimType prim_type)
 
static GLenum to_gl (GPUQueryType type)
 
static GLbitfield to_gl (eGPUBarrier barrier_bits)
 
GLenum to_gl_internal_format (eGPUTextureFormat format)
 
GLenum to_gl_target (eGPUTextureType type)
 
GLenum to_gl_proxy (eGPUTextureType type)
 
GLenum swizzle_to_gl (const char swizzle)
 
GLenum to_gl (eGPUDataFormat format)
 
GLenum to_gl_data_format (eGPUTextureFormat format)
 
GLenum channel_len_to_gl (int channel_len)
 
static GLenum to_gl (GPUUsageType type)
 
static GLenum to_gl (GPUVertCompType type)
 
Capabilities
static const char * mtl_extensions_get_null (int i)
 
bool supports_barycentric_whitelist (id< MTLDevice > device)
 
static bool detect_mip_render_workaround ()
 
static const char * gl_extension_get (int i)
 
static void detect_workarounds ()
 
MTLLoadAction mtl_load_action_from_gpu (eGPULoadOp action)
 
MTLStoreAction mtl_store_action_from_gpu (eGPUStoreOp action)
 
State setting functions
static MTLCompareFunction gpu_depth_function_to_metal (eGPUDepthTest depth_func)
 
static MTLCompareFunction gpu_stencil_func_to_metal (eGPUStencilTest stencil_func)
 
static void mtl_stencil_set_op_separate (MTLContext *context, eGPUFaceCullTest face, MTLStencilOperation stencil_fail, MTLStencilOperation depth_test_fail, MTLStencilOperation depthstencil_pass)
 
static void mtl_stencil_set_op (MTLContext *context, MTLStencilOperation stencil_fail, MTLStencilOperation depth_test_fail, MTLStencilOperation depthstencil_pass)
 
Texture Utility Functions
MTLPixelFormat gpu_texture_format_to_metal (eGPUTextureFormat tex_format)
 
int get_mtl_format_bytesize (MTLPixelFormat tex_format)
 
int get_mtl_format_num_components (MTLPixelFormat tex_format)
 
bool mtl_format_supports_blending (MTLPixelFormat format)
 
Operations
static MTLTextureSwizzle swizzle_to_mtl (const char swizzle)
 
Platform
static bool match_renderer (StringRef renderer, const Vector< std::string > &items)
 
Enums Conversion
static GLenum to_gl (const GPUAttachmentType type)
 
static GLbitfield to_gl (const eGPUFrameBufferBits bits)
 
Binding assignment

To mimic vulkan, we assign binding at shader creation to avoid shader recompilation. In the future, we should set it in the shader using layout(binding = i) and query its value.

static int block_binding (int32_t program, uint32_t block_index)
 
static int sampler_binding (int32_t program, uint32_t uniform_index, int32_t uniform_location, int *sampler_len)
 
static int image_binding (int32_t program, uint32_t uniform_index, int32_t uniform_location, int *image_len)
 
static int ssbo_binding (int32_t program, uint32_t ssbo_index)
 
Vertex Array Bindings
static uint16_t vbo_bind (const ShaderInterface *interface, const GPUVertFormat *format, uint v_first, uint v_len, const bool use_instancing)
 

Variables

GPUCapabilities GCaps
 
GPUPlatformGlobal GPG
 
thread_local NSAutoreleasePool * g_autoreleasepool = nil
 
thread_local int g_autoreleasepool_depth = 0
 
static const size_t VISIBILITY_COUNT_PER_BUFFER = 512
 
static const size_t VISIBILITY_RESULT_SIZE_IN_BYTES = 8
 
static const int MTL_MAX_MIPMAP_COUNT = 15
 
static const int MTL_MAX_FBO_ATTACHED = 16
 
const MTLSamplerState DEFAULT_SAMPLER_STATE = {GPU_SAMPLER_DEFAULT }
 

Typedef Documentation

◆ DebugStack

Definition at line 17 of file gpu_debug_private.hh.

◆ eGPUTextureFormatFlag

◆ eGPUTextureType

◆ GPUFunctionDictionnary

Definition at line 37 of file gpu_shader_dependency.cc.

◆ GPUQueryType

◆ GPUSourceDictionnary

Definition at line 36 of file gpu_shader_dependency.cc.

◆ MTLPipelineStateDirtyFlag

◆ MTLTemporaryBuffer

Definition at line 195 of file mtl_memory.hh.

◆ ShaderInput

Enumeration Type Documentation

◆ eGPUTextureFormatFlag

Enumerator
GPU_FORMAT_DEPTH 
GPU_FORMAT_STENCIL 
GPU_FORMAT_INTEGER 
GPU_FORMAT_FLOAT 
GPU_FORMAT_COMPRESSED 
GPU_FORMAT_DEPTH_STENCIL 

Definition at line 19 of file gpu_texture_private.hh.

◆ eGPUTextureType

Enumerator
GPU_TEXTURE_1D 
GPU_TEXTURE_2D 
GPU_TEXTURE_3D 
GPU_TEXTURE_CUBE 
GPU_TEXTURE_ARRAY 
GPU_TEXTURE_BUFFER 
GPU_TEXTURE_1D_ARRAY 
GPU_TEXTURE_2D_ARRAY 
GPU_TEXTURE_CUBE_ARRAY 

Definition at line 31 of file gpu_texture_private.hh.

◆ GPUIndexBufType

Enumerator
GPU_INDEX_U16 
GPU_INDEX_U32 

Definition at line 18 of file gpu_index_buffer_private.hh.

◆ GPUQueryType

Enumerator
GPU_QUERY_OCCLUSION 

Definition at line 16 of file gpu_query.hh.

◆ MTLPipelineStateDirtyFlag

Enumerator
MTL_PIPELINE_STATE_NULL_FLAG 
MTL_PIPELINE_STATE_VIEWPORT_FLAG 
MTL_PIPELINE_STATE_SCISSOR_FLAG 
MTL_PIPELINE_STATE_DEPTHSTENCIL_FLAG 
MTL_PIPELINE_STATE_PSO_FLAG 
MTL_PIPELINE_STATE_FRONT_FACING_FLAG 
MTL_PIPELINE_STATE_CULLMODE_FLAG 
MTL_PIPELINE_STATE_ALL_FLAG 

Definition at line 356 of file mtl_context.hh.

◆ Severity

Enumerator
Unknown 
Warning 
Error 

Definition at line 95 of file gpu_shader_private.hh.

Function Documentation

◆ BLI_STATIC_ASSERT() [1/2]

blender::gpu::BLI_STATIC_ASSERT ( sizeof(GPUState = =sizeof(uint64_t),
"GPUState is too big."   
)

◆ BLI_STATIC_ASSERT() [2/2]

blender::gpu::BLI_STATIC_ASSERT ( sizeof(GPUStateMutable = =sizeof(GPUStateMutable::data),
"GPUStateMutable is too big."   
)

◆ block_binding()

static int blender::gpu::block_binding ( int32_t  program,
uint32_t  block_index 
)
inlinestatic

◆ channel_len_to_gl()

GLenum blender::gpu::channel_len_to_gl ( int  channel_len)
inline

Assume UNORM/Float target. Used with #glReadPixels.

Definition at line 368 of file gl_texture.hh.

References BLI_assert_msg.

Referenced by blender::gpu::GLFrameBuffer::read().

◆ create_gpu_name()

static char* blender::gpu::create_gpu_name ( const char *  vendor,
const char *  renderer,
const char *  version 
)
static

◆ create_key()

static char* blender::gpu::create_key ( eGPUSupportLevel  support_level,
const char *  vendor,
const char *  renderer,
const char *  version 
)
static

◆ DEBUG_FUNC_OVERRIDE() [1/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glClear  ,
GLbitfield  ,
mask   
)

◆ DEBUG_FUNC_OVERRIDE() [2/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glDeleteTextures  ,
GLsizei  ,
,
const GLuint *  ,
textures   
)

◆ DEBUG_FUNC_OVERRIDE() [3/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glDrawArrays  ,
GLenum  ,
mode  ,
GLint  ,
first  ,
GLsizei  ,
count   
)

◆ DEBUG_FUNC_OVERRIDE() [4/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glFinish  ,
void   
)

◆ DEBUG_FUNC_OVERRIDE() [5/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glFlush  ,
void   
)

◆ DEBUG_FUNC_OVERRIDE() [6/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glGenTextures  ,
GLsizei  ,
,
GLuint *  ,
textures   
)

◆ DEBUG_FUNC_OVERRIDE() [7/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glGetTexImage  ,
GLenum  ,
target  ,
GLint  ,
level  ,
GLenum  ,
format  ,
GLenum  ,
type  ,
void ,
pixels   
)

◆ DEBUG_FUNC_OVERRIDE() [8/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glReadBuffer  ,
GLenum  ,
mode   
)

◆ DEBUG_FUNC_OVERRIDE() [9/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glReadPixels  ,
GLint  ,
x  ,
GLint  ,
y  ,
GLsizei  ,
width  ,
GLsizei  ,
height  ,
GLenum  ,
format  ,
GLenum  ,
type  ,
void ,
pixels   
)

◆ DEBUG_FUNC_OVERRIDE() [10/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glTexImage1D  ,
GLenum  ,
target  ,
GLint  ,
level  ,
GLint  ,
internalformat  ,
GLsizei  ,
width  ,
GLint  ,
border  ,
GLenum  ,
format  ,
GLenum  ,
type  ,
const void ,
pixels   
)

◆ DEBUG_FUNC_OVERRIDE() [11/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glTexImage2D  ,
GLenum  ,
target  ,
GLint  ,
level  ,
GLint  ,
internalformat  ,
GLsizei  ,
width  ,
GLsizei  ,
height  ,
GLint  ,
border  ,
GLenum  ,
format  ,
GLenum  ,
type  ,
const void ,
pixels   
)

◆ DEBUG_FUNC_OVERRIDE() [12/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glTexParameteri  ,
GLenum  ,
target  ,
GLenum  ,
pname  ,
GLint  ,
param   
)

◆ DEBUG_FUNC_OVERRIDE() [13/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glTexParameteriv  ,
GLenum  ,
target  ,
GLenum  ,
pname  ,
const GLint *  ,
params   
)

◆ DEBUG_FUNC_OVERRIDE() [14/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glTexSubImage1D  ,
GLenum  ,
target  ,
GLint  ,
level  ,
GLint  ,
xoffset  ,
GLsizei  ,
width  ,
GLenum  ,
format  ,
GLenum  ,
type  ,
const void ,
pixels   
)

◆ DEBUG_FUNC_OVERRIDE() [15/15]

blender::gpu::DEBUG_FUNC_OVERRIDE ( glTexSubImage2D  ,
GLenum  ,
target  ,
GLint  ,
level  ,
GLint  ,
xoffset  ,
GLint  ,
yoffset  ,
GLsizei  ,
width  ,
GLsizei  ,
height  ,
GLenum  ,
format  ,
GLenum  ,
type  ,
const void ,
pixels   
)

◆ detect_mip_render_workaround()

static bool blender::gpu::detect_mip_render_workaround ( )
static

◆ detect_workarounds()

static void blender::gpu::detect_workarounds ( )
static

Definition at line 206 of file gl_backend.cc.

References blender::gpu::GLContext::base_instance_support, blender::gpu::GPUCapabilities::broken_amd_driver, blender::gpu::GLContext::clear_texture_support, blender::gpu::GPUCapabilities::clear_viewport_workaround, blender::gpu::GPUCapabilities::compute_shader_support, blender::gpu::GLContext::copy_image_support, blender::gpu::GLContext::debug_layer_support, blender::gpu::GLContext::debug_layer_workaround, blender::gpu::GPUCapabilities::depth_blitting_workaround, blender::gpu::GLContext::derivative_signs, detect_mip_render_workaround(), blender::gpu::GLContext::direct_state_access_support, blender::gpu::GLContext::fixed_restart_index_support, G, G_DEBUG_GPU_FORCE_WORKAROUNDS, GCaps, blender::gpu::GLContext::generate_mipmap_workaround, blender::gpu::GLContext::geometry_shader_invocations, GPU_DEVICE_ANY, GPU_DEVICE_ATI, GPU_DEVICE_INTEL, GPU_DEVICE_NVIDIA, GPU_DRIVER_ANY, GPU_DRIVER_OFFICIAL, GPU_DRIVER_OPENSOURCE, GPU_OS_ANY, GPU_OS_MAC, GPU_OS_UNIX, GPU_OS_WIN, GPU_type_matches(), blender::gpu::GLContext::layered_rendering_support, match_renderer(), blender::gpu::GPUCapabilities::minimum_per_vertex_stride, blender::gpu::GPUCapabilities::mip_render_workaround, blender::gpu::GLContext::multi_bind_support, blender::gpu::GLContext::multi_draw_indirect_support, blender::gpu::GLContext::native_barycentric_support, blender::gpu::GLContext::shader_draw_parameters_support, blender::gpu::GPUCapabilities::shader_image_load_store_support, blender::gpu::GPUCapabilities::shader_storage_buffer_objects_support, blender::gpu::GLContext::texture_cube_map_array_support, blender::gpu::GLContext::texture_filter_anisotropic_support, blender::gpu::GLContext::texture_gather_support, blender::gpu::GLContext::texture_storage_support, blender::gpu::GLContext::unused_fb_slot_workaround, blender::gpu::GPUCapabilities::use_hq_normals_workaround, blender::gpu::GPUCapabilities::use_main_context_workaround, and blender::gpu::GLContext::vertex_attrib_binding_support.

◆ ENUM_OPERATORS()

blender::gpu::ENUM_OPERATORS ( MTLPipelineStateDirtyFlag  ,
MTL_PIPELINE_STATE_CULLMODE_FLAG   
)

◆ get_mtl_format_bytesize()

int blender::gpu::get_mtl_format_bytesize ( MTLPixelFormat  tex_format)

Definition at line 132 of file mtl_texture_util.mm.

References BLI_assert.

Referenced by blender::gpu::MTLTexture::update_sub().

◆ get_mtl_format_num_components()

int blender::gpu::get_mtl_format_num_components ( MTLPixelFormat  tex_format)

Definition at line 191 of file mtl_texture_util.mm.

References BLI_assert.

Referenced by blender::gpu::MTLTexture::update_sub().

◆ gl_extension_get()

static const char* blender::gpu::gl_extension_get ( int  i)
static

Definition at line 201 of file gl_backend.cc.

◆ gpu_depth_function_to_metal()

static MTLCompareFunction blender::gpu::gpu_depth_function_to_metal ( eGPUDepthTest  depth_func)
static

◆ gpu_stencil_func_to_metal()

static MTLCompareFunction blender::gpu::gpu_stencil_func_to_metal ( eGPUStencilTest  stencil_func)
static

◆ gpu_texture_format_to_metal()

MTLPixelFormat blender::gpu::gpu_texture_format_to_metal ( eGPUTextureFormat  tex_format)

◆ image_binding()

static int blender::gpu::image_binding ( int32_t  program,
uint32_t  uniform_index,
int32_t  uniform_location,
int *  image_len 
)
inlinestatic

◆ indices_per_primitive()

static int blender::gpu::indices_per_primitive ( GPUPrimType  prim_type)
inlinestatic

◆ match_renderer()

static bool blender::gpu::match_renderer ( StringRef  renderer,
const Vector< std::string > &  items 
)
static

◆ mtl_extensions_get_null()

static const char* blender::gpu::mtl_extensions_get_null ( int  i)
static

Definition at line 241 of file mtl_backend.mm.

◆ mtl_format_get_writeable_view_format()

MTLPixelFormat blender::gpu::mtl_format_get_writeable_view_format ( MTLPixelFormat  format)
inline

Definition at line 497 of file mtl_texture.hh.

Referenced by blender::gpu::MTLTexture::update_sub().

◆ mtl_format_is_writable()

bool blender::gpu::mtl_format_is_writable ( MTLPixelFormat  format)
inline

Definition at line 478 of file mtl_texture.hh.

◆ mtl_format_supports_blending()

bool blender::gpu::mtl_format_supports_blending ( MTLPixelFormat  format)

◆ mtl_load_action_from_gpu()

MTLLoadAction blender::gpu::mtl_load_action_from_gpu ( eGPULoadOp  action)

◆ mtl_stencil_set_op()

static void blender::gpu::mtl_stencil_set_op ( MTLContext context,
MTLStencilOperation  stencil_fail,
MTLStencilOperation  depth_test_fail,
MTLStencilOperation  depthstencil_pass 
)
static

◆ mtl_stencil_set_op_separate()

static void blender::gpu::mtl_stencil_set_op_separate ( MTLContext context,
eGPUFaceCullTest  face,
MTLStencilOperation  stencil_fail,
MTLStencilOperation  depth_test_fail,
MTLStencilOperation  depthstencil_pass 
)
static

◆ mtl_store_action_from_gpu()

MTLStoreAction blender::gpu::mtl_store_action_from_gpu ( eGPUStoreOp  action)

◆ operator!=() [1/2]

bool blender::gpu::operator!= ( const GPUState a,
const GPUState b 
)
inline

Definition at line 61 of file gpu_state_private.hh.

References Freestyle::a, and usdtokens::b().

◆ operator!=() [2/2]

bool blender::gpu::operator!= ( const GPUStateMutable a,
const GPUStateMutable b 
)
inline

Definition at line 110 of file gpu_state_private.hh.

References Freestyle::a, and usdtokens::b().

◆ operator==() [1/2]

bool blender::gpu::operator== ( const GPUState a,
const GPUState b 
)
inline

Definition at line 56 of file gpu_state_private.hh.

References Freestyle::a, and usdtokens::b().

◆ operator==() [2/2]

bool blender::gpu::operator== ( const GPUStateMutable a,
const GPUStateMutable b 
)
inline

Definition at line 105 of file gpu_state_private.hh.

References Freestyle::a, and usdtokens::b().

◆ operator^() [1/2]

GPUState blender::gpu::operator^ ( const GPUState a,
const GPUState b 
)
inline

Definition at line 66 of file gpu_state_private.hh.

References Freestyle::a, usdtokens::b(), and r.

◆ operator^() [2/2]

GPUStateMutable blender::gpu::operator^ ( const GPUStateMutable a,
const GPUStateMutable b 
)
inline

Definition at line 115 of file gpu_state_private.hh.

References Freestyle::a, ARRAY_SIZE, usdtokens::b(), and r.

◆ operator~() [1/2]

GPUState blender::gpu::operator~ ( const GPUState a)
inline

Definition at line 73 of file gpu_state_private.hh.

References Freestyle::a, and r.

◆ operator~() [2/2]

GPUStateMutable blender::gpu::operator~ ( const GPUStateMutable a)
inline

Definition at line 124 of file gpu_state_private.hh.

References Freestyle::a, ARRAY_SIZE, and r.

◆ sampler_binding()

static int blender::gpu::sampler_binding ( int32_t  program,
uint32_t  uniform_index,
int32_t  uniform_location,
int *  sampler_len 
)
inlinestatic

◆ sort_input_list()

static void blender::gpu::sort_input_list ( MutableSpan< ShaderInput dst)
static

◆ ssbo_binding()

static int blender::gpu::ssbo_binding ( int32_t  program,
uint32_t  ssbo_index 
)
inlinestatic

◆ supports_barycentric_whitelist()

bool blender::gpu::supports_barycentric_whitelist ( id< MTLDevice >  device)

Definition at line 246 of file mtl_backend.mm.

References BLI_assert, and blender::math::length().

Referenced by blender::gpu::MTLBackend::metal_is_supported().

◆ swizzle_to_gl()

GLenum blender::gpu::swizzle_to_gl ( const char  swizzle)
inline

Definition at line 245 of file gl_texture.hh.

Referenced by blender::gpu::GLTexture::swizzle_set().

◆ swizzle_to_mtl()

static MTLTextureSwizzle blender::gpu::swizzle_to_mtl ( const char  swizzle)
static

Definition at line 1021 of file mtl_texture.mm.

Referenced by blender::gpu::MTLTexture::swizzle_set().

◆ tex_data_format_to_msl_texture_template_type()

std::string blender::gpu::tex_data_format_to_msl_texture_template_type ( eGPUDataFormat  type)
inline

◆ tex_data_format_to_msl_type_str()

std::string blender::gpu::tex_data_format_to_msl_type_str ( eGPUDataFormat  type)
inline

◆ to_block_size()

size_t blender::gpu::to_block_size ( eGPUTextureFormat  data_type)
inline

◆ to_bytesize() [1/4]

size_t blender::gpu::to_bytesize ( eGPUDataFormat  data_format)
inline

◆ to_bytesize() [2/4]

size_t blender::gpu::to_bytesize ( eGPUTextureFormat  format)
inline

◆ to_bytesize() [3/4]

size_t blender::gpu::to_bytesize ( eGPUTextureFormat  tex_format,
eGPUDataFormat  data_format 
)
inline

Definition at line 421 of file gpu_texture_private.hh.

References to_bytesize(), and to_component_len().

◆ to_bytesize() [4/4]

static size_t blender::gpu::to_bytesize ( GPUIndexBufType  type)
inlinestatic

◆ to_component_len()

int blender::gpu::to_component_len ( eGPUTextureFormat  format)
inline

◆ to_data_format()

eGPUDataFormat blender::gpu::to_data_format ( eGPUTextureFormat  tex_format)
inline

◆ to_format_flag()

eGPUTextureFormatFlag blender::gpu::to_format_flag ( eGPUTextureFormat  format)
inline

◆ to_framebuffer_bits()

eGPUFrameBufferBits blender::gpu::to_framebuffer_bits ( eGPUTextureFormat  tex_format)
inline

◆ to_gl() [1/9]

static GLbitfield blender::gpu::to_gl ( const eGPUFrameBufferBits  bits)
inlinestatic

Definition at line 142 of file gl_framebuffer.hh.

References GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_STENCIL_BIT, and mask().

◆ to_gl() [2/9]

static GLenum blender::gpu::to_gl ( const GPUAttachmentType  type)
inlinestatic

◆ to_gl() [3/9]

static GLbitfield blender::gpu::to_gl ( eGPUBarrier  barrier_bits)
inlinestatic

◆ to_gl() [4/9]

GLenum blender::gpu::to_gl ( eGPUDataFormat  format)
inline

◆ to_gl() [5/9]

static GLenum blender::gpu::to_gl ( GPUIndexBufType  type)
inlinestatic

Definition at line 58 of file gl_index_buffer.hh.

References GPU_INDEX_U32, and type.

◆ to_gl() [6/9]

static GLenum blender::gpu::to_gl ( GPUPrimType  prim_type)
inlinestatic

◆ to_gl() [7/9]

static GLenum blender::gpu::to_gl ( GPUQueryType  type)
inlinestatic

Definition at line 43 of file gl_query.hh.

References BLI_assert, GPU_QUERY_OCCLUSION, and type.

◆ to_gl() [8/9]

static GLenum blender::gpu::to_gl ( GPUUsageType  type)
inlinestatic

◆ to_gl() [9/9]

static GLenum blender::gpu::to_gl ( GPUVertCompType  type)
inlinestatic

◆ to_gl_data_format()

GLenum blender::gpu::to_gl_data_format ( eGPUTextureFormat  format)
inline

◆ to_gl_internal_format()

GLenum blender::gpu::to_gl_internal_format ( eGPUTextureFormat  format)
inline

◆ to_gl_proxy()

GLenum blender::gpu::to_gl_proxy ( eGPUTextureType  type)
inline

◆ to_gl_target()

GLenum blender::gpu::to_gl_target ( eGPUTextureType  type)
inline

◆ to_mtl_internal_data_format()

eGPUDataFormat blender::gpu::to_mtl_internal_data_format ( eGPUTextureFormat  tex_format)
inline

◆ to_mtl_type()

static MTLVisibilityResultMode blender::gpu::to_mtl_type ( GPUQueryType  type)
inlinestatic

Definition at line 39 of file mtl_query.mm.

References BLI_assert, GPU_QUERY_OCCLUSION, and type.

Referenced by blender::gpu::MTLQueryPool::init().

◆ to_texture_format()

static eGPUTextureFormat blender::gpu::to_texture_format ( const GPUVertFormat format)
inlinestatic

◆ unwrap() [1/18]

static const Context* blender::gpu::unwrap ( const GPUContext ctx)
inlinestatic

Definition at line 91 of file gpu_context_private.hh.

◆ unwrap() [2/18]

static const DrawList* blender::gpu::unwrap ( const GPUDrawList vert)
inlinestatic

Definition at line 38 of file gpu_drawlist_private.hh.

◆ unwrap() [3/18]

static const FrameBuffer* blender::gpu::unwrap ( const GPUFrameBuffer vert)
inlinestatic

Definition at line 224 of file gpu_framebuffer_private.hh.

◆ unwrap() [4/18]

static const IndexBuf* blender::gpu::unwrap ( const GPUIndexBuf indexbuf)
inlinestatic

Definition at line 107 of file gpu_index_buffer_private.hh.

◆ unwrap() [5/18]

static const Shader* blender::gpu::unwrap ( const GPUShader vert)
inlinestatic

Definition at line 90 of file gpu_shader_private.hh.

◆ unwrap() [6/18]

static const StorageBuf* blender::gpu::unwrap ( const GPUStorageBuf vert)
inlinestatic

Definition at line 58 of file gpu_storage_buffer_private.hh.

◆ unwrap() [7/18]

static const Texture* blender::gpu::unwrap ( const GPUTexture vert)
inlinestatic

Definition at line 261 of file gpu_texture_private.hh.

◆ unwrap() [8/18]

static const UniformBuf* blender::gpu::unwrap ( const GPUUniformBuf vert)
inlinestatic

Definition at line 62 of file gpu_uniform_buffer_private.hh.

◆ unwrap() [9/18]

static const VertBuf* blender::gpu::unwrap ( const GPUVertBuf vert)
inlinestatic

Definition at line 107 of file gpu_vertex_buffer_private.hh.

◆ unwrap() [10/18]

static Context* blender::gpu::unwrap ( GPUContext ctx)
inlinestatic

Definition at line 87 of file gpu_context_private.hh.

Referenced by blender::gpu::MTLFrameBuffer::apply_state(), blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor(), blender::gpu::MTLFrameBuffer::bind(), blender::gpu::MTLFrameBuffer::clear(), blender::gpu::MTLFrameBuffer::clear_attachment(), blender::gpu::MTLTexture::copy_to(), blender::gpu::Batch::elem_(), blender::gpu::GLBatch::elem_(), GPU_draw_list_append(), GPU_draw_list_discard(), GPU_draw_list_submit(), GPU_framebuffer_bind(), GPU_framebuffer_bind_loadstore(), GPU_framebuffer_bind_no_srgb(), GPU_framebuffer_blit(), GPU_framebuffer_check_valid(), GPU_framebuffer_clear(), GPU_framebuffer_config_array(), GPU_framebuffer_free(), GPU_framebuffer_multi_clear(), GPU_framebuffer_py_reference_get(), GPU_framebuffer_py_reference_set(), GPU_framebuffer_read_color(), GPU_framebuffer_read_depth(), GPU_framebuffer_recursive_downsample(), GPU_framebuffer_texture_attach_ex(), GPU_framebuffer_texture_detach(), GPU_framebuffer_viewport_get(), GPU_framebuffer_viewport_reset(), GPU_framebuffer_viewport_set(), GPU_indexbuf_init_build_on_device(), GPU_offscreen_bind(), GPU_offscreen_draw_to_screen(), GPU_shader_bind(), GPU_shader_free(), GPU_shader_get_name(), GPU_shader_get_program(), GPU_shader_transform_feedback_disable(), GPU_shader_transform_feedback_enable(), GPU_shader_uniform_vector(), GPU_shader_uniform_vector_int(), GPU_storagebuf_bind(), GPU_storagebuf_clear(), GPU_storagebuf_copy_sub_from_vertbuf(), GPU_storagebuf_free(), GPU_storagebuf_unbind(), GPU_storagebuf_update(), GPU_texture_image_bind(), GPU_texture_image_unbind(), GPU_texture_py_reference_get(), GPU_texture_py_reference_set(), GPU_uniformbuf_bind(), GPU_uniformbuf_free(), GPU_uniformbuf_unbind(), GPU_uniformbuf_update(), GPU_vertbuf_attr_fill(), GPU_vertbuf_attr_fill_stride(), GPU_vertbuf_attr_get_raw_data(), GPU_vertbuf_attr_set(), GPU_vertbuf_bind_as_ssbo(), GPU_vertbuf_bind_as_texture(), GPU_vertbuf_clear(), GPU_vertbuf_create_with_format_ex(), GPU_vertbuf_data_alloc(), GPU_vertbuf_data_len_set(), GPU_vertbuf_data_resize(), GPU_vertbuf_discard(), GPU_vertbuf_duplicate(), GPU_vertbuf_get_data(), GPU_vertbuf_get_format(), GPU_vertbuf_get_status(), GPU_vertbuf_get_vertex_alloc(), GPU_vertbuf_get_vertex_len(), GPU_vertbuf_handle_ref_add(), GPU_vertbuf_handle_ref_remove(), GPU_vertbuf_init_with_format_ex(), GPU_vertbuf_read(), GPU_vertbuf_steal_data(), GPU_vertbuf_tag_dirty(), GPU_vertbuf_unmap(), GPU_vertbuf_update_sub(), GPU_vertbuf_use(), GPU_vertbuf_vert_set(), GPU_vertbuf_wrap_handle(), blender::gpu::MTLTexture::init_internal(), blender::gpu::GLTexture::init_internal(), blender::gpu::Texture::init_view(), blender::gpu::Batch::inst_(), blender::gpu::GLBatch::inst_(), blender::gpu::MTLStateManager::texture_bind(), blender::gpu::MTLStateManager::texture_unbind(), blender::gpu::MTLStateManager::texture_unbind_all(), blender::gpu::MTLStateManager::texture_unpack_row_length_set(), blender::gpu::GLShader::transform_feedback_enable(), blender::gpu::MTLUniformBuf::update(), blender::gpu::MTLFrameBuffer::update_attachments(), blender::gpu::GLVertArray::update_bindings(), blender::gpu::MTLTexture::update_sub(), blender::gpu::Batch::verts_(), blender::gpu::GLBatch::verts_(), blender::gpu::MTLFrameBuffer::~MTLFrameBuffer(), and blender::gpu::MTLTexture::~MTLTexture().

◆ unwrap() [11/18]

static DrawList* blender::gpu::unwrap ( GPUDrawList vert)
inlinestatic

Definition at line 34 of file gpu_drawlist_private.hh.

◆ unwrap() [12/18]

static FrameBuffer* blender::gpu::unwrap ( GPUFrameBuffer vert)
inlinestatic

Definition at line 220 of file gpu_framebuffer_private.hh.

◆ unwrap() [13/18]

static IndexBuf* blender::gpu::unwrap ( GPUIndexBuf indexbuf)
inlinestatic

Definition at line 103 of file gpu_index_buffer_private.hh.

◆ unwrap() [14/18]

static Shader* blender::gpu::unwrap ( GPUShader vert)
inlinestatic

Definition at line 86 of file gpu_shader_private.hh.

◆ unwrap() [15/18]

static StorageBuf* blender::gpu::unwrap ( GPUStorageBuf vert)
inlinestatic

Definition at line 54 of file gpu_storage_buffer_private.hh.

◆ unwrap() [16/18]

static Texture* blender::gpu::unwrap ( GPUTexture vert)
inlinestatic

Definition at line 257 of file gpu_texture_private.hh.

◆ unwrap() [17/18]

static UniformBuf* blender::gpu::unwrap ( GPUUniformBuf vert)
inlinestatic

Definition at line 58 of file gpu_uniform_buffer_private.hh.

◆ unwrap() [18/18]

static VertBuf* blender::gpu::unwrap ( GPUVertBuf vert)
inlinestatic

Definition at line 103 of file gpu_vertex_buffer_private.hh.

◆ validate_data_format()

bool blender::gpu::validate_data_format ( eGPUTextureFormat  tex_format,
eGPUDataFormat  data_format 
)
inline

◆ validate_data_format_mtl()

bool blender::gpu::validate_data_format_mtl ( eGPUTextureFormat  tex_format,
eGPUDataFormat  data_format 
)
inline

◆ vbo_bind()

static uint16_t blender::gpu::vbo_bind ( const ShaderInterface interface,
const GPUVertFormat format,
uint  v_first,
uint  v_len,
const bool  use_instancing 
)
static

◆ wrap() [1/9]

static GPUContext* blender::gpu::wrap ( Context ctx)
inlinestatic

◆ wrap() [2/9]

static GPUDrawList* blender::gpu::wrap ( DrawList vert)
inlinestatic

Definition at line 30 of file gpu_drawlist_private.hh.

◆ wrap() [3/9]

static GPUFrameBuffer* blender::gpu::wrap ( FrameBuffer vert)
inlinestatic

Definition at line 216 of file gpu_framebuffer_private.hh.

◆ wrap() [4/9]

static GPUIndexBuf* blender::gpu::wrap ( IndexBuf indexbuf)
inlinestatic

Definition at line 99 of file gpu_index_buffer_private.hh.

◆ wrap() [5/9]

static GPUShader* blender::gpu::wrap ( Shader vert)
inlinestatic

Definition at line 82 of file gpu_shader_private.hh.

◆ wrap() [6/9]

static GPUStorageBuf* blender::gpu::wrap ( StorageBuf vert)
inlinestatic

Definition at line 50 of file gpu_storage_buffer_private.hh.

◆ wrap() [7/9]

static GPUTexture* blender::gpu::wrap ( Texture vert)
inlinestatic

Definition at line 253 of file gpu_texture_private.hh.

◆ wrap() [8/9]

static GPUUniformBuf* blender::gpu::wrap ( UniformBuf vert)
inlinestatic

Definition at line 54 of file gpu_uniform_buffer_private.hh.

◆ wrap() [9/9]

static GPUVertBuf* blender::gpu::wrap ( VertBuf vert)
inlinestatic

Definition at line 99 of file gpu_vertex_buffer_private.hh.

Variable Documentation

◆ DEFAULT_SAMPLER_STATE

const MTLSamplerState blender::gpu::DEFAULT_SAMPLER_STATE = {GPU_SAMPLER_DEFAULT }

◆ g_autoreleasepool

thread_local NSAutoreleasePool* blender::gpu::g_autoreleasepool = nil

◆ g_autoreleasepool_depth

thread_local int blender::gpu::g_autoreleasepool_depth = 0

◆ GCaps

GPUCapabilities blender::gpu::GCaps

◆ GPG

GPUPlatformGlobal blender::gpu::GPG

◆ MTL_MAX_FBO_ATTACHED

const int blender::gpu::MTL_MAX_FBO_ATTACHED = 16
static

Definition at line 125 of file mtl_texture.hh.

◆ MTL_MAX_MIPMAP_COUNT

const int blender::gpu::MTL_MAX_MIPMAP_COUNT = 15
static

◆ VISIBILITY_COUNT_PER_BUFFER

const size_t blender::gpu::VISIBILITY_COUNT_PER_BUFFER = 512
static

◆ VISIBILITY_RESULT_SIZE_IN_BYTES

const size_t blender::gpu::VISIBILITY_RESULT_SIZE_IN_BYTES = 8
static

Definition at line 15 of file mtl_query.mm.

Referenced by blender::gpu::MTLQueryPool::begin_query().