Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_texture.hh
| Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | enum { | ||||
| MTL_TEXTURE_MODE_DEFAULT, /* Texture is self-initialized (Standard). */ | MTL_TEXTURE_MODE_DEFAULT, /* Texture is self-initialized (Standard). */ | ||||
| MTL_TEXTURE_MODE_EXTERNAL, /* Texture source from external id<MTLTexture> handle */ | MTL_TEXTURE_MODE_EXTERNAL, /* Texture source from external id<MTLTexture> handle */ | ||||
| MTL_TEXTURE_MODE_VBO, /* Texture source initialized from VBO */ | MTL_TEXTURE_MODE_VBO, /* Texture source initialized from VBO */ | ||||
| MTL_TEXTURE_MODE_TEXTURE_VIEW /* Texture is a view into an existing texture. */ | MTL_TEXTURE_MODE_TEXTURE_VIEW /* Texture is a view into an existing texture. */ | ||||
| } resource_mode_; | } resource_mode_; | ||||
| /* 'baking' refers to the generation of GPU-backed resources. This flag ensures GPU resources are | /* 'baking' refers to the generation of GPU-backed resources. This flag ensures GPU resources are | ||||
| * ready. Baking is generally deferred until as late as possible, to ensure all associated | * ready. Baking is generally deferred until as late as possible, to ensure all associated | ||||
| * resource state has been specified up-front. */ | * resource state has been specified up-front. */ | ||||
| bool is_baked_; | bool is_baked_ = false; | ||||
fclem: It is always good to provide default values to members. | |||||
| MTLTextureDescriptor *texture_descriptor_; | MTLTextureDescriptor *texture_descriptor_ = nullptr; | ||||
| id<MTLTexture> texture_; | id<MTLTexture> texture_ = nil; | ||||
| MTLTextureUsage usage_; | MTLTextureUsage usage_; | ||||
| /* Texture Storage. */ | /* Texture Storage. */ | ||||
| id<MTLBuffer> texture_buffer_; | id<MTLBuffer> texture_buffer_ = nil; | ||||
| uint aligned_w_ = 0; | uint aligned_w_ = 0; | ||||
| /* Blit Frame-buffer. */ | /* Blit Frame-buffer. */ | ||||
| GPUFrameBuffer *blit_fb_ = nullptr; | GPUFrameBuffer *blit_fb_ = nullptr; | ||||
| uint blit_fb_slice_ = 0; | uint blit_fb_slice_ = 0; | ||||
| uint blit_fb_mip_ = 0; | uint blit_fb_mip_ = 0; | ||||
| /* Texture view properties */ | /* Texture view properties */ | ||||
| ▲ Show 20 Lines • Show All 429 Lines • Show Last 20 Lines | |||||
It is always good to provide default values to members.