Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_shader.h
| Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | typedef enum eGPUBuiltinShader { | ||||
| * Take a 3D position for each vertex and output only depth. | * Take a 3D position for each vertex and output only depth. | ||||
| * | * | ||||
| * \param pos: in vec3 | * \param pos: in vec3 | ||||
| */ | */ | ||||
| GPU_SHADER_3D_DEPTH_ONLY, | GPU_SHADER_3D_DEPTH_ONLY, | ||||
| GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR, | GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR, | ||||
| /* basic image drawing */ | /* basic image drawing */ | ||||
| GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE, | GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE, | ||||
| GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE, | |||||
| GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR, | GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR, | ||||
| GPU_SHADER_2D_IMAGE_MASK_UNIFORM_COLOR, | GPU_SHADER_2D_IMAGE_MASK_UNIFORM_COLOR, | ||||
| /** | /** | ||||
| * Draw texture with alpha. Take a 3D position and a 2D texture coordinate for each vertex. | * Draw texture with alpha. Take a 3D position and a 2D texture coordinate for each vertex. | ||||
| * | * | ||||
| * \param alpha: uniform float | * \param alpha: uniform float | ||||
| * \param image: uniform sampler2D | * \param image: uniform sampler2D | ||||
| * \param texCoord: in vec2 | * \param texCoord: in vec2 | ||||
| * \param pos: in vec3 | * \param pos: in vec3 | ||||
| */ | */ | ||||
| GPU_SHADER_3D_IMAGE_MODULATE_ALPHA, | GPU_SHADER_3D_IMAGE_MODULATE_ALPHA, | ||||
| /** | /** | ||||
| * Draw linearized depth texture relate to near and far distances. | * Draw linearized depth texture relate to near and far distances. | ||||
| * Take a 3D position and a 2D texture coordinate for each vertex. | * Take a 3D position and a 2D texture coordinate for each vertex. | ||||
| * | * | ||||
| * \param znear: uniform float | * \param znear: uniform float | ||||
| * \param zfar: uniform float | * \param zfar: uniform float | ||||
| * \param image: uniform sampler2D | * \param image: uniform sampler2D | ||||
| * \param texCoord: in vec2 | * \param texCoord: in vec2 | ||||
| * \param pos: in vec3 | * \param pos: in vec3 | ||||
| */ | */ | ||||
| GPU_SHADER_3D_IMAGE_DEPTH, | GPU_SHADER_3D_IMAGE_DEPTH, | ||||
| GPU_SHADER_3D_IMAGE_DEPTH_COPY, | GPU_SHADER_3D_IMAGE_DEPTH_COPY, | ||||
| /* stereo 3d */ | |||||
| GPU_SHADER_2D_IMAGE_INTERLACE, | |||||
| /* points */ | /* points */ | ||||
| /** | /** | ||||
| * Draw round points with a hardcoded size. | * Draw round points with a hardcoded size. | ||||
| * Take a single color for all the vertices and a 2D position for each vertex. | * Take a single color for all the vertices and a 2D position for each vertex. | ||||
| * | * | ||||
| * \param color: uniform vec4 | * \param color: uniform vec4 | ||||
| * \param pos: in vec2 | * \param pos: in vec2 | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | |||||
| typedef struct GPUShaderConfigData { | typedef struct GPUShaderConfigData { | ||||
| const char *lib; | const char *lib; | ||||
| const char *def; | const char *def; | ||||
| } GPUShaderConfigData; | } GPUShaderConfigData; | ||||
| /* gpu_shader.c */ | /* gpu_shader.c */ | ||||
| extern const GPUShaderConfigData GPU_shader_cfg_data[GPU_SHADER_CFG_LEN]; | extern const GPUShaderConfigData GPU_shader_cfg_data[GPU_SHADER_CFG_LEN]; | ||||
| /** | |||||
| * Keep these in sync with: | |||||
| * - `gpu_shader_image_interlace_frag.glsl` | |||||
| * - `gpu_shader_image_rect_interlace_frag.glsl` | |||||
| */ | |||||
| typedef enum eGPUInterlaceShader { | |||||
| GPU_SHADER_INTERLACE_ROW = 0, | |||||
| GPU_SHADER_INTERLACE_COLUMN = 1, | |||||
| GPU_SHADER_INTERLACE_CHECKER = 2, | |||||
| } eGPUInterlaceShader; | |||||
| GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader, | GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader, | ||||
| eGPUShaderConfig sh_cfg); | eGPUShaderConfig sh_cfg); | ||||
| GPUShader *GPU_shader_get_builtin_shader(eGPUBuiltinShader shader); | GPUShader *GPU_shader_get_builtin_shader(eGPUBuiltinShader shader); | ||||
| void GPU_shader_get_builtin_shader_code(eGPUBuiltinShader shader, | void GPU_shader_get_builtin_shader_code(eGPUBuiltinShader shader, | ||||
| const char **r_vert, | const char **r_vert, | ||||
| const char **r_frag, | const char **r_frag, | ||||
| const char **r_geom, | const char **r_geom, | ||||
| Show All 15 Lines | |||||