Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/metal/mtl_texture.hh
| Show First 20 Lines • Show All 357 Lines • ▼ Show 20 Lines | private: | ||||
| struct TextureUpdateParams { | struct TextureUpdateParams { | ||||
| int mip_index; | int mip_index; | ||||
| int extent[3]; /* Width, Height, Slice on 2D Array tex*/ | int extent[3]; /* Width, Height, Slice on 2D Array tex*/ | ||||
| int offset[3]; /* Width, Height, Slice on 2D Array tex*/ | int offset[3]; /* Width, Height, Slice on 2D Array tex*/ | ||||
| uint unpack_row_length; /* Number of pixels between bytes in input data */ | uint unpack_row_length; /* Number of pixels between bytes in input data */ | ||||
| }; | }; | ||||
| id<MTLComputePipelineState> texture_update_1d_get_kernel( | id<MTLComputePipelineState> texture_update_1d_get_kernel( | ||||
| TextureUpdateRoutineSpecialisation specialisation); | TextureUpdateRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_update_1d_array_get_kernel( | id<MTLComputePipelineState> texture_update_1d_array_get_kernel( | ||||
| TextureUpdateRoutineSpecialisation specialisation); | TextureUpdateRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_update_2d_get_kernel( | id<MTLComputePipelineState> texture_update_2d_get_kernel( | ||||
| TextureUpdateRoutineSpecialisation specialisation); | TextureUpdateRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_update_2d_array_get_kernel( | id<MTLComputePipelineState> texture_update_2d_array_get_kernel( | ||||
| TextureUpdateRoutineSpecialisation specialisation); | TextureUpdateRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_update_3d_get_kernel( | id<MTLComputePipelineState> texture_update_3d_get_kernel( | ||||
| TextureUpdateRoutineSpecialisation specialisation); | TextureUpdateRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> mtl_texture_update_impl( | id<MTLComputePipelineState> mtl_texture_update_impl( | ||||
| TextureUpdateRoutineSpecialisation specialisation_params, | TextureUpdateRoutineSpecialisation specialization_params, | ||||
| blender::Map<TextureUpdateRoutineSpecialisation, id<MTLComputePipelineState>> | blender::Map<TextureUpdateRoutineSpecialisation, id<MTLComputePipelineState>> | ||||
| &specialisation_cache, | &specialization_cache, | ||||
| eGPUTextureType texture_type); | eGPUTextureType texture_type); | ||||
| /* Depth Update Utilities */ | /* Depth Update Utilities */ | ||||
| /* Depth texture updates are not directly supported with Blit operations, similarly, we cannot | /* Depth texture updates are not directly supported with Blit operations, similarly, we cannot | ||||
| * use a compute shader to write to depth, so we must instead render to a depth target. | * use a compute shader to write to depth, so we must instead render to a depth target. | ||||
| * These processes use vertex/fragment shaders to render texture data from an intermediate | * These processes use vertex/fragment shaders to render texture data from an intermediate | ||||
| * source, in order to prime the depth buffer*/ | * source, in order to prime the depth buffer*/ | ||||
| GPUShader *depth_2d_update_sh_get(DepthTextureUpdateRoutineSpecialisation specialisation); | GPUShader *depth_2d_update_sh_get(DepthTextureUpdateRoutineSpecialisation specialization); | ||||
| void update_sub_depth_2d( | void update_sub_depth_2d( | ||||
| int mip, int offset[3], int extent[3], eGPUDataFormat type, const void *data); | int mip, int offset[3], int extent[3], eGPUDataFormat type, const void *data); | ||||
| /* Texture Read function utilities -- Follows a similar mechanism to the updating routines */ | /* Texture Read function utilities -- Follows a similar mechanism to the updating routines */ | ||||
| struct TextureReadParams { | struct TextureReadParams { | ||||
| int mip_index; | int mip_index; | ||||
| int extent[3]; /* Width, Height, Slice on 2D Array tex*/ | int extent[3]; /* Width, Height, Slice on 2D Array tex*/ | ||||
| int offset[3]; /* Width, Height, Slice on 2D Array tex*/ | int offset[3]; /* Width, Height, Slice on 2D Array tex*/ | ||||
| }; | }; | ||||
| id<MTLComputePipelineState> texture_read_1d_get_kernel( | id<MTLComputePipelineState> texture_read_1d_get_kernel( | ||||
| TextureReadRoutineSpecialisation specialisation); | TextureReadRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_read_1d_array_get_kernel( | id<MTLComputePipelineState> texture_read_1d_array_get_kernel( | ||||
| TextureReadRoutineSpecialisation specialisation); | TextureReadRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_read_2d_get_kernel( | id<MTLComputePipelineState> texture_read_2d_get_kernel( | ||||
| TextureReadRoutineSpecialisation specialisation); | TextureReadRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_read_2d_array_get_kernel( | id<MTLComputePipelineState> texture_read_2d_array_get_kernel( | ||||
| TextureReadRoutineSpecialisation specialisation); | TextureReadRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> texture_read_3d_get_kernel( | id<MTLComputePipelineState> texture_read_3d_get_kernel( | ||||
| TextureReadRoutineSpecialisation specialisation); | TextureReadRoutineSpecialisation specialization); | ||||
| id<MTLComputePipelineState> mtl_texture_read_impl( | id<MTLComputePipelineState> mtl_texture_read_impl( | ||||
| TextureReadRoutineSpecialisation specialisation_params, | TextureReadRoutineSpecialisation specialization_params, | ||||
| blender::Map<TextureReadRoutineSpecialisation, id<MTLComputePipelineState>> | blender::Map<TextureReadRoutineSpecialisation, id<MTLComputePipelineState>> | ||||
| &specialisation_cache, | &specialization_cache, | ||||
| eGPUTextureType texture_type); | eGPUTextureType texture_type); | ||||
| /* fullscreen blit utilities. */ | /* fullscreen blit utilities. */ | ||||
| GPUShader *fullscreen_blit_sh_get(); | GPUShader *fullscreen_blit_sh_get(); | ||||
| }; | }; | ||||
| /* Utility */ | /* Utility */ | ||||
| MTLPixelFormat gpu_texture_format_to_metal(eGPUTextureFormat tex_format); | MTLPixelFormat gpu_texture_format_to_metal(eGPUTextureFormat tex_format); | ||||
| ▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines | |||||