Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/basic/basic_shader.c
| Show All 18 Lines | |||||
| extern char datatoc_common_pointcloud_lib_glsl[]; | extern char datatoc_common_pointcloud_lib_glsl[]; | ||||
| /* Shaders */ | /* Shaders */ | ||||
| typedef struct BASIC_Shaders { | typedef struct BASIC_Shaders { | ||||
| /* Depth Pre Pass */ | /* Depth Pre Pass */ | ||||
| struct GPUShader *depth; | struct GPUShader *depth; | ||||
| struct GPUShader *pointcloud_depth; | struct GPUShader *pointcloud_depth; | ||||
| struct GPUShader *curves_depth; | |||||
| struct GPUShader *depth_conservative; | struct GPUShader *depth_conservative; | ||||
| struct GPUShader *pointcloud_depth_conservative; | struct GPUShader *pointcloud_depth_conservative; | ||||
| } BASIC_Shaders; | } BASIC_Shaders; | ||||
| static struct { | static struct { | ||||
| BASIC_Shaders sh_data[GPU_SHADER_CFG_LEN]; | BASIC_Shaders sh_data[GPU_SHADER_CFG_LEN]; | ||||
| } e_data = {{{NULL}}}; /* Engine data */ | } e_data = {{{NULL}}}; /* Engine data */ | ||||
| Show All 13 Lines | GPUShader *BASIC_shaders_pointcloud_depth_sh_get(eGPUShaderConfig config) | ||||
| if (sh_data->pointcloud_depth == NULL) { | if (sh_data->pointcloud_depth == NULL) { | ||||
| sh_data->pointcloud_depth = GPU_shader_create_from_info_name( | sh_data->pointcloud_depth = GPU_shader_create_from_info_name( | ||||
| config == GPU_SHADER_CFG_CLIPPED ? "basic_depth_pointcloud_clipped" : | config == GPU_SHADER_CFG_CLIPPED ? "basic_depth_pointcloud_clipped" : | ||||
| "basic_depth_pointcloud"); | "basic_depth_pointcloud"); | ||||
| } | } | ||||
| return sh_data->pointcloud_depth; | return sh_data->pointcloud_depth; | ||||
| } | } | ||||
| GPUShader *BASIC_shaders_curves_depth_sh_get(eGPUShaderConfig config) | |||||
| { | |||||
| BASIC_Shaders *sh_data = &e_data.sh_data[config]; | |||||
| if (sh_data->curves_depth == NULL) { | |||||
| sh_data->curves_depth = GPU_shader_create_from_info_name( | |||||
| config == GPU_SHADER_CFG_CLIPPED ? "basic_depth_curves_clipped" : "basic_depth_curves"); | |||||
| } | |||||
| return sh_data->curves_depth; | |||||
| } | |||||
| GPUShader *BASIC_shaders_depth_conservative_sh_get(eGPUShaderConfig config) | GPUShader *BASIC_shaders_depth_conservative_sh_get(eGPUShaderConfig config) | ||||
| { | { | ||||
| BASIC_Shaders *sh_data = &e_data.sh_data[config]; | BASIC_Shaders *sh_data = &e_data.sh_data[config]; | ||||
| if (sh_data->depth_conservative == NULL) { | if (sh_data->depth_conservative == NULL) { | ||||
| sh_data->depth_conservative = GPU_shader_create_from_info_name( | sh_data->depth_conservative = GPU_shader_create_from_info_name( | ||||
| config == GPU_SHADER_CFG_CLIPPED ? "basic_depth_mesh_conservative_clipped" : | config == GPU_SHADER_CFG_CLIPPED ? "basic_depth_mesh_conservative_clipped" : | ||||
| "basic_depth_mesh_conservative"); | "basic_depth_mesh_conservative"); | ||||
| } | } | ||||
| Show All 23 Lines | |||||