Blender
V3.3
|
#include <mtl_texture.hh>
Friends | |
class | MTLContext |
class | MTLStateManager |
class | MTLFrameBuffer |
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 | 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 |
uint | gl_bindcode_get () const override |
bool | init_internal () override |
bool | init_internal (GPUVertBuf *vbo) override |
bool | init_internal (const GPUTexture *src, int mip_offset, int layer_offset) override |
METAL Resource creation and management | |
bool | texture_is_baked () |
Additional Inherited Members | |
![]() | |
eGPUSamplerState | sampler_state = GPU_SAMPLER_DEFAULT |
int | refcount = 1 |
int | src_w = 0 |
int | src_h = 0 |
void ** | py_ref = nullptr |
![]() | |
int | w_ |
int | h_ |
int | d_ |
eGPUTextureFormat | format_ |
eGPUTextureFormatFlag | format_flag_ |
eGPUTextureType | type_ |
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 152 of file mtl_texture.hh.
blender::gpu::MTLTexture::MTLTexture | ( | const char * | name | ) |
Definition at line 67 of file mtl_texture.mm.
blender::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::GPU_TEXTURE_2D, blender::gpu::Texture::init_2D(), type, and blender::gpu::Texture::type_.
blender::gpu::MTLTexture::~MTLTexture | ( | ) |
Definition at line 98 of file mtl_texture.mm.
References GPU_context_active_get(), reset, blender::gpu::Context::state_manager, blender::gpu::StateManager::texture_unbind(), and blender::gpu::unwrap().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1008 of file mtl_texture.mm.
References data, fb(), GPU_framebuffer_active_get(), and GPU_framebuffer_bind().
Implements blender::gpu::Texture.
Definition at line 945 of file mtl_texture.mm.
References BLI_assert, blender::gpu::Texture::d_, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::Texture::format_, GPU_context_active_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, blender::gpu::unwrap(), and blender::gpu::Texture::w_.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 901 of file mtl_texture.mm.
References BLI_assert, blender::gpu::MTLContext::device, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), G, G_DEBUG_GPU, GPU_context_active_get(), GPU_DEPTH24_STENCIL8, GPU_DEPTH32F_STENCIL8, GPU_DEPTH_COMPONENT16, GPU_DEPTH_COMPONENT24, GPU_DEPTH_COMPONENT32F, blender::gpu::MTLContext::main_command_buffer, MTL_LOG_ERROR, and MTL_LOG_WARNING.
|
inline |
Definition at line 254 of file mtl_texture.hh.
References blender::gpu::Texture::name_.
Referenced by blender::gpu::MTLContext::texture_bind().
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1430 of file mtl_texture.mm.
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 1435 of file mtl_texture.mm.
References GPU_DEPTH24_STENCIL8, and GPU_DEPTH32F_STENCIL8.
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 1455 of file mtl_texture.mm.
References BLI_assert, src, and blender::gpu::unwrap().
|
overrideprotectedvirtual |
Implements blender::gpu::Texture.
Definition at line 1446 of file mtl_texture.mm.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1061 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 1095 of file mtl_texture.mm.
References BLI_assert, data, blender::gpu::GPU_FORMAT_COMPRESSED, MEM_mallocN, MTL_LOG_WARNING, blender::gpu::to_bytesize(), blender::gpu::to_component_len(), type, and blender::gpu::validate_data_format_mtl().
Implements blender::gpu::Texture.
Definition at line 244 of file mtl_texture.hh.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 1044 of file mtl_texture.mm.
References blender::gpu::swizzle_to_mtl().
bool blender::gpu::MTLTexture::texture_is_baked | ( | ) |
Definition at line 1489 of file mtl_texture.mm.
|
overridevirtual |
Implements blender::gpu::Texture.
Definition at line 396 of file mtl_texture.mm.
References BLI_assert, blender::gpu::MTLBufferRange::buffer_offset, data, blender::gpu::MTLBufferRange::data, blender::gpu::MTLCommandBufferManager::ensure_begin_blit_encoder(), blender::gpu::MTLCommandBufferManager::ensure_begin_compute_encoder(), blender::gpu::get_mtl_format_bytesize(), blender::gpu::get_mtl_format_num_components(), blender::gpu::MTLContext::get_scratchbuffer_manager(), GPU_context_active_get(), GPU_DATA_10_11_11_REV, GPU_DATA_UINT_24_8, 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(), blender::math::length(), blender::gpu::MTLContext::main_command_buffer, max_ii(), blender::gpu::MTLBufferRange::metal_buffer, blender::gpu::mtl_format_get_writeable_view_format(), MTL_LOG_ERROR, MTL_LOG_WARNING, offset, params, blender::gpu::MTLContext::pipeline_state, blender::gpu::MTLScratchBufferManager::scratch_buffer_allocate_range_aligned(), 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(), type, blender::gpu::MTLContextGlobalShaderPipelineState::unpack_row_length, and blender::gpu::unwrap().
|
friend |
Definition at line 153 of file mtl_texture.hh.
|
friend |
Definition at line 155 of file mtl_texture.hh.
|
friend |
Definition at line 154 of file mtl_texture.hh.