Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_texture.mm
| Show First 20 Lines • Show All 1,662 Lines • ▼ Show 20 Lines | bool gpu::MTLTexture::init_internal(GPUVertBuf *vbo) | ||||
| texture_.label = [NSString stringWithUTF8String:this->get_name()]; | texture_.label = [NSString stringWithUTF8String:this->get_name()]; | ||||
| is_baked_ = true; | is_baked_ = true; | ||||
| is_dirty_ = false; | is_dirty_ = false; | ||||
| resource_mode_ = MTL_TEXTURE_MODE_VBO; | resource_mode_ = MTL_TEXTURE_MODE_VBO; | ||||
| /* Track Status. */ | /* Track Status. */ | ||||
| vert_buffer_ = mtl_vbo; | vert_buffer_ = mtl_vbo; | ||||
| vert_buffer_mtl_ = source_buffer; | vert_buffer_mtl_ = source_buffer; | ||||
| /* Cleanup. */ | |||||
| [texture_descriptor_ release]; | |||||
| texture_descriptor_ = nullptr; | |||||
| return true; | return true; | ||||
| } | } | ||||
| bool gpu::MTLTexture::init_internal(const GPUTexture *src, int mip_offset, int layer_offset) | bool gpu::MTLTexture::init_internal(const GPUTexture *src, int mip_offset, int layer_offset) | ||||
| { | { | ||||
| BLI_assert(src); | BLI_assert(src); | ||||
| ▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | if (!is_baked_) { | ||||
| } | } | ||||
| /* Determine Resource Mode. */ | /* Determine Resource Mode. */ | ||||
| resource_mode_ = MTL_TEXTURE_MODE_DEFAULT; | resource_mode_ = MTL_TEXTURE_MODE_DEFAULT; | ||||
| /* Standard texture allocation. */ | /* Standard texture allocation. */ | ||||
| texture_ = [ctx->device newTextureWithDescriptor:texture_descriptor_]; | texture_ = [ctx->device newTextureWithDescriptor:texture_descriptor_]; | ||||
| [texture_descriptor_ release]; | |||||
| texture_descriptor_ = nullptr; | |||||
| texture_.label = [NSString stringWithUTF8String:this->get_name()]; | texture_.label = [NSString stringWithUTF8String:this->get_name()]; | ||||
| BLI_assert(texture_); | BLI_assert(texture_); | ||||
| is_baked_ = true; | is_baked_ = true; | ||||
| is_dirty_ = false; | is_dirty_ = false; | ||||
| } | } | ||||
| /* Re-apply previous contents. */ | /* Re-apply previous contents. */ | ||||
| if (copy_previous_contents) { | if (copy_previous_contents) { | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||