Blender V4.3
mtl_shader_generator.mm File Reference
#include "BKE_global.hh"
#include "BLI_string.h"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <map>
#include <mutex>
#include <regex>
#include <sstream>
#include <string>
#include <cstring>
#include "GPU_platform.hh"
#include "GPU_vertex_format.hh"
#include "gpu_shader_dependency_private.hh"
#include "mtl_common.hh"
#include "mtl_context.hh"
#include "mtl_debug.hh"
#include "mtl_shader.hh"
#include "mtl_shader_generator.hh"
#include "mtl_shader_interface.hh"
#include "mtl_texture.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 
namespace  blender::gpu
 

Macros

#define FRAGMENT_OUT_STRUCT_NAME   "FragmentOut"
 
#define FRAGMENT_TILE_IN_STRUCT_NAME   "FragmentTileIn"
 
#define ATOMIC_DEFINE_STR   "#define MTL_SUPPORTS_TEXTURE_ATOMICS 1\n"
 

Functions

Shader Translation utility functions.
static eMTLDataType blender::gpu::to_mtl_type (Type type)
 
static std::regex blender::gpu::remove_non_numeric_characters ("[^0-9]")
 
static void blender::gpu::remove_multiline_comments_func (std::string &str)
 
static void blender::gpu::remove_singleline_comments_func (std::string &str)
 
static bool blender::gpu::is_program_word (const char *chr, int *len)
 
static int blender::gpu::backwards_program_word_scan (const char *array_loc, const char *min)
 
static void blender::gpu::extract_and_replace_clipping_distances (std::string &vertex_source, MSLGeneratorInterface &msl_iface)
 
static void blender::gpu::replace_outvars (std::string &str)
 
static void blender::gpu::replace_matrix_constructors (std::string &str)
 
static void blender::gpu::replace_array_initializers_func (std::string &str)
 
static bool blender::gpu::balanced_braces (char *current_str_begin, char *current_str_end)
 
static void blender::gpu::extract_global_scope_constants (std::string &str, std::stringstream &)
 
static bool blender::gpu::extract_ssbo_pragma_info (const MTLShader *shader, const MSLGeneratorInterface &, const std::string &in_vertex_src, MTLPrimitiveType &out_prim_tye, uint32_t &out_num_output_verts)
 
void blender::gpu::extract_shared_memory_blocks (MSLGeneratorInterface &msl_iface, std::string &glsl_compute_source)
 
MTLShader builtin shader generation utilities.
static void blender::gpu::print_resource (std::ostream &os, const ShaderCreateInfo::Resource &res)
 
Shader Translation.
static void blender::gpu::generate_specialization_constant_declarations (const shader::ShaderCreateInfo *info, std::stringstream &ss)
 
constexpr size_t blender::gpu::const_strlen (const char *str)
 
static char blender::gpu::parameter_delimiter (bool &is_first_parameter)
 
static uint32_t blender::gpu::name_buffer_copystr (char **name_buffer_ptr, const char *str_to_copy, uint32_t &name_buffer_size, uint32_t &name_buffer_offset)
 

Variables

char datatoc_mtl_shader_defines_msl []
 
char datatoc_mtl_shader_shared_h []
 

Macro Definition Documentation

◆ ATOMIC_DEFINE_STR

#define ATOMIC_DEFINE_STR   "#define MTL_SUPPORTS_TEXTURE_ATOMICS 1\n"

Definition at line 53 of file mtl_shader_generator.mm.

◆ FRAGMENT_OUT_STRUCT_NAME

◆ FRAGMENT_TILE_IN_STRUCT_NAME

Variable Documentation

◆ datatoc_mtl_shader_defines_msl

char datatoc_mtl_shader_defines_msl[]
extern

◆ datatoc_mtl_shader_shared_h

char datatoc_mtl_shader_shared_h[]
extern