|
Blender V4.3
|
#include <mtl_texture.hh>
Inherits blender::gpu::Texture.
Friends | |
| class | MTLContext |
| class | MTLStateManager |
| class | MTLFrameBuffer |
| class | MTLStorageBuf |
Creation & Deletion | |
| MTLTexture (const char *name) | |
| MTLTexture (const char *name, eGPUTextureFormat format, eGPUTextureType type, id< MTLTexture > metal_texture) | |
| ~MTLTexture () | |
Operations | |
| void | update_sub (int mip, int offset[3], int extent[3], eGPUDataFormat type, const void *data) override |
| void | update_sub (int offset[3], int extent[3], eGPUDataFormat format, GPUPixelBuffer *pixbuf) override |
| void | generate_mipmap () override |
| void | copy_to (Texture *dst) override |
| void | clear (eGPUDataFormat format, const void *data) override |
| void | swizzle_set (const char swizzle_mask[4]) override |
| void | mip_range_set (int min, int max) override |
| void * | read (int mip, eGPUDataFormat type) override |
| bool | init_internal () override |
| bool | init_internal (VertBuf *vbo) override |
| bool | init_internal (GPUTexture *src, int mip_offset, int layer_offset, bool use_stencil) override |
SRGB Handling. | |
| bool | is_format_srgb () |
METAL Resource creation and management | |
| bool | texture_is_baked () |
Additional Inherited Members | |
Public Attributes inherited from blender::gpu::Texture | |
| GPUSamplerState | sampler_state = GPUSamplerState::default_sampler() |
| int | refcount = 1 |
| int | src_w = 0 |
| int | src_h = 0 |
| void ** | py_ref = nullptr |
Protected Attributes inherited from blender::gpu::Texture | |
| int | w_ |
| int | h_ |
| int | d_ |
| eGPUTextureFormat | format_ |
| eGPUTextureFormatFlag | format_flag_ |
| eGPUTextureType | type_ |
| eGPUTextureUsage | gpu_image_usage_flags_ |
| int | mipmaps_ = -1 |
| int | mip_min_ = 0 |
| int | mip_max_ = 0 |
| char | name_ [DEBUG_NAME_LEN] |
| GPUAttachmentType | fb_attachment_ [GPU_TEX_MAX_FBO_ATTACHED] |
| FrameBuffer * | fb_ [GPU_TEX_MAX_FBO_ATTACHED] |
Definition at line 174 of file mtl_texture.hh.
| blender::gpu::gpu::MTLTexture::MTLTexture | ( | const char * | name | ) |
Definition at line 67 of file mtl_texture.mm.
| blender::gpu::gpu::MTLTexture::MTLTexture | ( | const char * | name, |
| eGPUTextureFormat | format, | ||
| eGPUTextureType | type, | ||
| id< MTLTexture > | metal_texture ) |
Definition at line 73 of file mtl_texture.mm.
References BLI_assert, blender::gpu::Texture::gpu_image_usage_flags_, blender::gpu::GPU_TEXTURE_2D, blender::gpu::gpu_usage_from_mtl(), blender::gpu::Texture::init_2D(), and blender::gpu::Texture::type_.
| blender::gpu::gpu::MTLTexture::~MTLTexture | ( | ) |
Definition at line 100 of file mtl_texture.mm.
References blender::gpu::MTLContext::get(), reset(), blender::gpu::Context::state_manager, and blender::gpu::StateManager::texture_unbind().
|
overridevirtual |
Perform compute-based clear.
Implements blender::gpu::Texture.
Definition at line 1359 of file mtl_texture.mm.
References blender::gpu::MTLComputeState::bind_compute_bytes(), blender::gpu::MTLComputeState::bind_compute_texture(), blender::gpu::MTLComputeState::bind_pso(), BLI_assert, BLI_assert_msg, data, ELEM, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::MTLCommandBufferManager::ensure_begin_compute_encoder(), fb(), blender::gpu::MTLContext::get(), blender::gpu::MTLCommandBufferManager::get_compute_state(), GPU_framebuffer_active_get(), GPU_framebuffer_bind(), blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_1D_ARRAY, blender::gpu::MTLContext::main_command_buffer, MTL_LOG_ERROR, params, blender::gpu::MTLContext::pipeline_state, range, blender::gpu::tex_data_format_to_msl_texture_template_type(), blender::gpu::tex_data_format_to_msl_type_str(), blender::gpu::to_bytesize(), blender::gpu::to_component_len(), blender::gpu::MTLContextGlobalShaderPipelineState::unpack_row_length, and blender::gpu::unwrap().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1295 of file mtl_texture.mm.
References BLI_assert, blender::gpu::Texture::d_, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::Texture::format_, blender::gpu::MTLContext::get(), blender::gpu::GPU_TEXTURE_2D_ARRAY, blender::gpu::GPU_TEXTURE_3D, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, blender::gpu::Texture::h_, blender::gpu::MTLContext::main_command_buffer, blender::gpu::Texture::type_, UNUSED_VARS_NDEBUG, and blender::gpu::Texture::w_.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1243 of file mtl_texture.mm.
References BLI_assert, BLI_assert_msg, blender::gpu::MTLContext::device, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), G, G_DEBUG_GPU, blender::gpu::MTLContext::get(), GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_DEPTH_COMPONENT16, GPU_DEPTH_COMPONENT24, GPU_DEPTH_COMPONENT32F, blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::MTLContext::main_command_buffer, MTL_LOG_ERROR, and MTL_LOG_WARNING.
|
inline |
Definition at line 292 of file mtl_texture.hh.
References blender::gpu::Texture::name_.
Referenced by blender::gpu::MTLContext::ensure_texture_bindings(), blender::gpu::MTLContext::ensure_texture_bindings(), and blender::gpu::MTLContext::texture_bind().
| MTLStorageBuf * blender::gpu::gpu::MTLTexture::get_storagebuf | ( | ) |
Definition at line 2571 of file mtl_texture.mm.
References BLI_assert, and BLI_assert_msg.
Referenced by blender::gpu::MTLContext::ensure_texture_bindings(), and blender::gpu::MTLContext::ensure_texture_bindings().
|
inline |
Definition at line 315 of file mtl_texture.hh.
Referenced by blender::gpu::MTLContext::ensure_texture_bindings(), and blender::gpu::MTLContext::ensure_texture_bindings().
|
inline |
Definition at line 305 of file mtl_texture.hh.
Referenced by blender::gpu::MTLVertBuf::bind_as_texture().
|
overridevirtual |
Implements blender::gpu::Texture.
|
inline |
Definition at line 297 of file mtl_texture.hh.
Referenced by blender::gpu::MTLContext::ensure_texture_bindings().
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 2055 of file mtl_texture.mm.
References GPU_max_texture_3d_size(), and blender::gpu::GPU_TEXTURE_3D.
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 2170 of file mtl_texture.mm.
References BLI_assert, ELEM, GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_texture_usage(), and blender::gpu::unwrap().
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 2067 of file mtl_texture.mm.
References blender::gpu::MTLVertBuf::bind(), BLI_assert, BLI_assert_msg, ceil_to_multiple_ul(), blender::gpu::MTLContext::device, blender::gpu::MTLVertBuf::flag_used(), blender::gpu::MTLContext::get(), blender::gpu::get_mtl_format_bytesize(), blender::gpu::GPU_TEXTURE_BUFFER, blender::gpu::gpu_texture_format_to_metal(), GPU_vertbuf_get_format(), init(), MTL_LOG_WARNING, and blender::gpu::VertBuf::vertex_len.
| bool blender::gpu::MTLTexture::is_format_srgb | ( | ) |
Definition at line 2591 of file mtl_texture.mm.
References blender::gpu::Texture::format_, and GPU_SRGB8_A8.
Referenced by blender::gpu::MTLFrameBuffer::bake_render_pass_descriptor().
Implements blender::gpu::Texture.
Definition at line 1527 of file mtl_texture.mm.
References BLI_assert, blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_1D_ARRAY, blender::gpu::GPU_TEXTURE_BUFFER, max, min, and MTL_LOG_ERROR.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1562 of file mtl_texture.mm.
References BLI_assert, data, blender::gpu::GPU_FORMAT_COMPRESSED, max_ii(), MEM_mallocN, MTL_LOG_WARNING, blender::gpu::to_bytesize(), blender::gpu::to_component_len(), and blender::gpu::validate_data_format().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1510 of file mtl_texture.mm.
References blender::gpu::swizzle_to_mtl().
| bool blender::gpu::gpu::MTLTexture::texture_is_baked | ( | ) |
Definition at line 2219 of file mtl_texture.mm.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 491 of file mtl_texture.mm.
References blender::gpu::MTLBufferPool::allocate_with_data(), blender::gpu::MTLComputeState::bind_compute_buffer(), blender::gpu::MTLComputeState::bind_compute_bytes(), blender::gpu::MTLComputeState::bind_compute_texture(), blender::gpu::MTLComputeState::bind_pso(), BLI_assert, BLI_assert_unreachable, blender::gpu::MTLContext::device, divide_ceil_u(), blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::MTLCommandBufferManager::ensure_begin_compute_encoder(), blender::gpu::MTLBuffer::free(), blender::gpu::MTLContext::get(), blender::gpu::MTLCommandBufferManager::get_compute_state(), blender::gpu::MTLContext::get_global_memory_manager(), blender::gpu::MTLBuffer::get_metal_buffer(), blender::gpu::get_mtl_format_bytesize(), blender::gpu::get_mtl_format_num_components(), GPU_DATA_10_11_11_REV, GPU_DATA_2_10_10_10_REV, GPU_DATA_UINT_24_8, blender::gpu::GPU_FORMAT_COMPRESSED, blender::gpu::GPU_FORMAT_DEPTH, GPU_SRGB8_A8, blender::gpu::GPU_TEXTURE_1D, blender::gpu::GPU_TEXTURE_1D_ARRAY, blender::gpu::GPU_TEXTURE_2D, blender::gpu::GPU_TEXTURE_2D_ARRAY, blender::gpu::GPU_TEXTURE_3D, blender::gpu::GPU_TEXTURE_ARRAY, blender::gpu::GPU_TEXTURE_BUFFER, blender::gpu::GPU_TEXTURE_CUBE, blender::gpu::GPU_TEXTURE_CUBE_ARRAY, blender::gpu::gpu_texture_format_to_metal(), GPU_TEXTURE_USAGE_FORMAT_VIEW, GPU_TEXTURE_USAGE_SHADER_WRITE, blender::gpu::MTLContext::main_command_buffer, max_ulul(), blender::gpu::mtl_format_get_writeable_view_format(), MTL_LOG_ERROR, MTL_LOG_WARNING, params, blender::gpu::MTLContext::pipeline_state, blender::gpu::MTLCommandBufferManager::submit(), blender::gpu::tex_data_format_to_msl_texture_template_type(), blender::gpu::tex_data_format_to_msl_type_str(), blender::gpu::to_block_size(), blender::gpu::to_bytesize(), blender::gpu::to_component_len(), and blender::gpu::MTLContextGlobalShaderPipelineState::unpack_row_length.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1158 of file mtl_texture.mm.
References BLI_assert, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::Texture::format_, blender::gpu::MTLContext::get(), blender::gpu::MTLPixelBuffer::get_metal_buffer(), blender::gpu::GPU_TEXTURE_2D, blender::gpu::MTLContext::main_command_buffer, blender::gpu::to_bytesize(), blender::gpu::to_component_len(), blender::gpu::Texture::type_, blender::gpu::unwrap(), and blender::gpu::validate_data_format().
|
friend |
Definition at line 175 of file mtl_texture.hh.
|
friend |
Definition at line 177 of file mtl_texture.hh.
|
friend |
Definition at line 176 of file mtl_texture.hh.
|
friend |
Definition at line 178 of file mtl_texture.hh.