Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_context.hh
| Show First 20 Lines • Show All 649 Lines • ▼ Show 20 Lines | private: | ||||
| /* Null buffers for empty/uninitialized bindings. | /* Null buffers for empty/uninitialized bindings. | ||||
| * Null attribute buffer follows default attribute format of OpenGL Backend. */ | * Null attribute buffer follows default attribute format of OpenGL Backend. */ | ||||
| id<MTLBuffer> null_buffer_; /* All zero's. */ | id<MTLBuffer> null_buffer_; /* All zero's. */ | ||||
| id<MTLBuffer> null_attribute_buffer_; /* Value float4(0.0,0.0,0.0,1.0). */ | id<MTLBuffer> null_attribute_buffer_; /* Value float4(0.0,0.0,0.0,1.0). */ | ||||
| /** Dummy Resources */ | /** Dummy Resources */ | ||||
| /* Maximum of 32 texture types. Though most combinations invalid. */ | /* Maximum of 32 texture types. Though most combinations invalid. */ | ||||
| gpu::MTLTexture *dummy_textures_[GPU_TEXTURE_BUFFER] = {nullptr}; | gpu::MTLTexture *dummy_textures_[GPU_SAMPLER_TYPE_MAX][GPU_TEXTURE_BUFFER] = {nullptr}; | ||||
| GPUVertFormat dummy_vertformat_; | GPUVertFormat dummy_vertformat_[GPU_SAMPLER_TYPE_MAX]; | ||||
| GPUVertBuf *dummy_verts_ = nullptr; | GPUVertBuf *dummy_verts_[GPU_SAMPLER_TYPE_MAX] = {nullptr}; | ||||
| public: | public: | ||||
| /* GPUContext interface. */ | /* GPUContext interface. */ | ||||
| MTLContext(void *ghost_window, void *ghost_context); | MTLContext(void *ghost_window, void *ghost_context); | ||||
| ~MTLContext(); | ~MTLContext(); | ||||
| static void check_error(const char *info); | static void check_error(const char *info); | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | bool ensure_uniform_buffer_bindings( | ||||
| const MTLRenderPipelineStateInstance *pipeline_state_instance); | const MTLRenderPipelineStateInstance *pipeline_state_instance); | ||||
| void ensure_texture_bindings(id<MTLRenderCommandEncoder> rec, | void ensure_texture_bindings(id<MTLRenderCommandEncoder> rec, | ||||
| MTLShaderInterface *shader_interface, | MTLShaderInterface *shader_interface, | ||||
| const MTLRenderPipelineStateInstance *pipeline_state_instance); | const MTLRenderPipelineStateInstance *pipeline_state_instance); | ||||
| void ensure_depth_stencil_state(MTLPrimitiveType prim_type); | void ensure_depth_stencil_state(MTLPrimitiveType prim_type); | ||||
| id<MTLBuffer> get_null_buffer(); | id<MTLBuffer> get_null_buffer(); | ||||
| id<MTLBuffer> get_null_attribute_buffer(); | id<MTLBuffer> get_null_attribute_buffer(); | ||||
| gpu::MTLTexture *get_dummy_texture(eGPUTextureType type); | gpu::MTLTexture *get_dummy_texture(eGPUTextureType type, eGPUSamplerFormat sampler_format); | ||||
| void free_dummy_resources(); | void free_dummy_resources(); | ||||
| /* State assignment. */ | /* State assignment. */ | ||||
| void set_viewport(int origin_x, int origin_y, int width, int height); | void set_viewport(int origin_x, int origin_y, int width, int height); | ||||
| void set_scissor(int scissor_x, int scissor_y, int scissor_width, int scissor_height); | void set_scissor(int scissor_x, int scissor_y, int scissor_width, int scissor_height); | ||||
| void set_scissor_enabled(bool scissor_enabled); | void set_scissor_enabled(bool scissor_enabled); | ||||
| /* Visibility buffer control. */ | /* Visibility buffer control. */ | ||||
| ▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines | |||||