Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_texture.hh
| Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | private: | ||||
| id<MTLBuffer> texture_buffer_ = nil; | 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; | ||||
| /* Non-SRGB texture view, used for when a framebuffer is bound with SRGB disabled. */ | |||||
| id<MTLTexture> texture_no_srgb_ = nil; | |||||
| /* Texture view properties */ | /* Texture view properties */ | ||||
| /* In Metal, we use texture views to either limit mipmap ranges, | /* In Metal, we use texture views to either limit mipmap ranges, | ||||
| * , apply a swizzle mask, or both. | * , apply a swizzle mask, or both. | ||||
| * | * | ||||
| * We apply the mip limit in the view rather than in the sampler, as | * We apply the mip limit in the view rather than in the sampler, as | ||||
| * certain effects and functionality such as textureSize rely on the base level | * certain effects and functionality such as textureSize rely on the base level | ||||
| * being modified. | * being modified. | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | void stencil_texture_mode_set(bool use_stencil) override{ | ||||
| /* TODO(Metal): implement. */ | /* TODO(Metal): implement. */ | ||||
| }; | }; | ||||
| void mip_range_set(int min, int max) override; | void mip_range_set(int min, int max) override; | ||||
| void *read(int mip, eGPUDataFormat type) override; | void *read(int mip, eGPUDataFormat type) override; | ||||
| /* Remove once no longer required -- will just return 0 for now in MTL path. */ | /* Remove once no longer required -- will just return 0 for now in MTL path. */ | ||||
| uint gl_bindcode_get() const override; | uint gl_bindcode_get() const override; | ||||
| bool is_format_srgb(); | |||||
| bool texture_is_baked(); | bool texture_is_baked(); | ||||
| const char *get_name() | const char *get_name() | ||||
| { | { | ||||
| return name_; | return name_; | ||||
| } | } | ||||
| id<MTLBuffer> get_vertex_buffer() const | id<MTLBuffer> get_vertex_buffer() const | ||||
| { | { | ||||
| Show All 38 Lines | void read_internal(int mip, | ||||
| eGPUDataFormat desired_output_format, | eGPUDataFormat desired_output_format, | ||||
| int num_output_components, | int num_output_components, | ||||
| int debug_data_size, | int debug_data_size, | ||||
| void *r_data); | void *r_data); | ||||
| void bake_mip_swizzle_view(); | void bake_mip_swizzle_view(); | ||||
| id<MTLTexture> get_metal_handle(); | id<MTLTexture> get_metal_handle(); | ||||
| id<MTLTexture> get_metal_handle_base(); | id<MTLTexture> get_metal_handle_base(); | ||||
| id<MTLTexture> get_non_srgb_handle(); | |||||
| MTLSamplerState get_sampler_state(); | MTLSamplerState get_sampler_state(); | ||||
| void blit(id<MTLBlitCommandEncoder> blit_encoder, | void blit(id<MTLBlitCommandEncoder> blit_encoder, | ||||
| uint src_x_offset, | uint src_x_offset, | ||||
| uint src_y_offset, | uint src_y_offset, | ||||
| uint src_z_offset, | uint src_z_offset, | ||||
| uint src_slice, | uint src_slice, | ||||
| uint src_mip, | uint src_mip, | ||||
| gpu::MTLTexture *dest, | gpu::MTLTexture *dest, | ||||
| ▲ Show 20 Lines • Show All 337 Lines • Show Last 20 Lines | |||||