diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-05-02 02:05:35 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-05-02 02:05:35 +0300 |
commit | aaab3c8ad4e3fca6920f0888c5e4f68ad12d6dd3 (patch) | |
tree | 7de07ac41fa48936b32d434697986e1a8aad5311 /source/blender | |
parent | f0118e9aca8266512c87c8a9310b52056138596c (diff) |
Cleanup: GPUShader: Make style consistent in builtin_shader_stages
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader_builtin.c | 213 |
1 files changed, 144 insertions, 69 deletions
diff --git a/source/blender/gpu/intern/gpu_shader_builtin.c b/source/blender/gpu/intern/gpu_shader_builtin.c index f6e416e7c48..1a3215f1bb5 100644 --- a/source/blender/gpu/intern/gpu_shader_builtin.c +++ b/source/blender/gpu/intern/gpu_shader_builtin.c @@ -167,12 +167,21 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .create_info = "gpu_shader_2D_diag_stripes", }, - [GPU_SHADER_2D_UNIFORM_COLOR] = {.name = "GPU_SHADER_2D_UNIFORM_COLOR", - .create_info = "gpu_shader_2D_uniform_color"}, - [GPU_SHADER_2D_FLAT_COLOR] = {.name = "GPU_SHADER_2D_FLAT_COLOR", - .create_info = "gpu_shader_2D_flat_color"}, - [GPU_SHADER_2D_SMOOTH_COLOR] = {.name = "GPU_SHADER_2D_SMOOTH_COLOR", - .create_info = "gpu_shader_2D_smooth_color"}, + [GPU_SHADER_2D_UNIFORM_COLOR] = + { + .name = "GPU_SHADER_2D_UNIFORM_COLOR", + .create_info = "gpu_shader_2D_uniform_color", + }, + [GPU_SHADER_2D_FLAT_COLOR] = + { + .name = "GPU_SHADER_2D_FLAT_COLOR", + .create_info = "gpu_shader_2D_flat_color", + }, + [GPU_SHADER_2D_SMOOTH_COLOR] = + { + .name = "GPU_SHADER_2D_SMOOTH_COLOR", + .create_info = "gpu_shader_2D_smooth_color", + }, [GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE] = { .name = "GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE", @@ -186,24 +195,40 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { #endif }, [GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE] = - {.name = "GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE", - .create_info = "gpu_shader_2D_image_overlays_stereo_merge"}, - [GPU_SHADER_2D_IMAGE] = {.name = "GPU_SHADER_2D_IMAGE", .create_info = "gpu_shader_2D_image"}, - [GPU_SHADER_2D_IMAGE_COLOR] = {.name = "GPU_SHADER_2D_IMAGE_COLOR", - .create_info = "gpu_shader_2D_image_color"}, - [GPU_SHADER_2D_IMAGE_DESATURATE_COLOR] = {.name = "GPU_SHADER_2D_IMAGE_DESATURATE_COLOR", - .create_info = - "gpu_shader_2D_image_desaturate_color"}, + { + .name = "GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE", + .create_info = "gpu_shader_2D_image_overlays_stereo_merge", + }, + [GPU_SHADER_2D_IMAGE] = + { + .name = "GPU_SHADER_2D_IMAGE", + .create_info = "gpu_shader_2D_image", + }, + [GPU_SHADER_2D_IMAGE_COLOR] = + { + .name = "GPU_SHADER_2D_IMAGE_COLOR", + .create_info = "gpu_shader_2D_image_color", + }, + [GPU_SHADER_2D_IMAGE_DESATURATE_COLOR] = + { + .name = "GPU_SHADER_2D_IMAGE_DESATURATE_COLOR", + .create_info = "gpu_shader_2D_image_desaturate_color", + }, [GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR] = { .name = "GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR", .create_info = "gpu_shader_2D_image_shuffle_color", }, - [GPU_SHADER_2D_IMAGE_RECT_COLOR] = {.name = "GPU_SHADER_2D_IMAGE_RECT_COLOR", - .create_info = "gpu_shader_2D_image_rect_color"}, - [GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR] = {.name = "GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR", - .create_info = - "gpu_shader_2D_image_multi_rect_color"}, + [GPU_SHADER_2D_IMAGE_RECT_COLOR] = + { + .name = "GPU_SHADER_2D_IMAGE_RECT_COLOR", + .create_info = "gpu_shader_2D_image_rect_color", + }, + [GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR] = + { + .name = "GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR", + .create_info = "gpu_shader_2D_image_multi_rect_color", + }, [GPU_SHADER_3D_UNIFORM_COLOR] = { @@ -211,39 +236,62 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .create_info = "gpu_shader_3D_uniform_color", .clipped_create_info = "gpu_shader_3D_uniform_color_clipped", }, - [GPU_SHADER_3D_FLAT_COLOR] = {.name = "GPU_SHADER_3D_FLAT_COLOR", - .create_info = "gpu_shader_3D_flat_color", - .clipped_create_info = "gpu_shader_3D_flat_color_clipped"}, - [GPU_SHADER_3D_SMOOTH_COLOR] = {.name = "GPU_SHADER_3D_SMOOTH_COLOR", - .create_info = "gpu_shader_3D_smooth_color", - .clipped_create_info = "gpu_shader_3D_smooth_color_clipped"}, - [GPU_SHADER_3D_DEPTH_ONLY] = {.name = "GPU_SHADER_3D_DEPTH_ONLY", - .create_info = "gpu_shader_3D_depth_only", - .clipped_create_info = "gpu_shader_3D_depth_only_clipped"}, + [GPU_SHADER_3D_FLAT_COLOR] = + { + .name = "GPU_SHADER_3D_FLAT_COLOR", + .create_info = "gpu_shader_3D_flat_color", + .clipped_create_info = "gpu_shader_3D_flat_color_clipped", + }, + [GPU_SHADER_3D_SMOOTH_COLOR] = + { + .name = "GPU_SHADER_3D_SMOOTH_COLOR", + .create_info = "gpu_shader_3D_smooth_color", + .clipped_create_info = "gpu_shader_3D_smooth_color_clipped", + }, + [GPU_SHADER_3D_DEPTH_ONLY] = + { + .name = "GPU_SHADER_3D_DEPTH_ONLY", + .create_info = "gpu_shader_3D_depth_only", + .clipped_create_info = "gpu_shader_3D_depth_only_clipped", + }, [GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR] = { .name = "GPU_SHADER_3D_CLIPPED_UNIFORM_COLOR", .create_info = "gpu_shader_3D_clipped_uniform_color", }, - [GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR] = {.name = "GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR", - .create_info = - "gpu_shader_3D_polyline_uniform_color"}, + [GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR] = + { + .name = "GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR", + .create_info = "gpu_shader_3D_polyline_uniform_color", + }, [GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR] = - {.name = "GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR", - .create_info = "gpu_shader_3D_polyline_uniform_color_clipped"}, - [GPU_SHADER_3D_POLYLINE_FLAT_COLOR] = {.name = "GPU_SHADER_3D_POLYLINE_FLAT_COLOR", - .create_info = "gpu_shader_3D_polyline_flat_color"}, - [GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR] = {.name = "GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR", - .create_info = "gpu_shader_3D_polyline_smooth_color"}, - - [GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR] = {.name = "GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR", - .create_info = - "gpu_shader_2D_line_dashed_uniform_color"}, + { + .name = "GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR", + .create_info = "gpu_shader_3D_polyline_uniform_color_clipped", + }, + [GPU_SHADER_3D_POLYLINE_FLAT_COLOR] = + { + .name = "GPU_SHADER_3D_POLYLINE_FLAT_COLOR", + .create_info = "gpu_shader_3D_polyline_flat_color", + }, + [GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR] = + { + .name = "GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR", + .create_info = "gpu_shader_3D_polyline_smooth_color", + }, + + [GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR] = + { + .name = "GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR", + .create_info = "gpu_shader_2D_line_dashed_uniform_color", + }, [GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR] = - {.name = "GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR", - .create_info = "gpu_shader_3D_line_dashed_uniform_color", - .clipped_create_info = "gpu_shader_3D_line_dashed_uniform_color_clipped"}, + { + .name = "GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR", + .create_info = "gpu_shader_3D_line_dashed_uniform_color", + .clipped_create_info = "gpu_shader_3D_line_dashed_uniform_color_clipped", + }, [GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA] = { @@ -256,33 +304,60 @@ static const GPUShaderStages builtin_shader_stages[GPU_SHADER_BUILTIN_LEN] = { .create_info = "gpu_shader_2D_point_uniform_size_uniform_color_outline_aa", }, [GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR] = - {.name = "GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR", - .create_info = "gpu_shader_3D_point_fixed_size_varying_color"}, + { + .name = "GPU_SHADER_3D_POINT_FIXED_SIZE_VARYING_COLOR", + .create_info = "gpu_shader_3D_point_fixed_size_varying_color", + }, [GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR] = - {.name = "GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR", - .create_info = "gpu_shader_3D_point_varying_size_varying_color"}, + { + .name = "GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR", + .create_info = "gpu_shader_3D_point_varying_size_varying_color", + }, [GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA] = - {.name = "GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA", - .create_info = "gpu_shader_3D_point_uniform_size_uniform_color_aa", - .clipped_create_info = "gpu_shader_3D_point_uniform_size_uniform_color_aa_clipped"}, - - [GPU_SHADER_2D_AREA_BORDERS] = {.name = "GPU_SHADER_2D_AREA_BORDERS", - .create_info = "gpu_shader_2D_area_borders"}, - [GPU_SHADER_2D_WIDGET_BASE] = {.name = "GPU_SHADER_2D_WIDGET_BASE", - .create_info = "gpu_shader_2D_widget_base"}, - [GPU_SHADER_2D_WIDGET_BASE_INST] = {.name = "GPU_SHADER_2D_WIDGET_BASE_INST", - .defs = "#define USE_INSTANCE\n", - .create_info = "gpu_shader_2D_widget_base_inst"}, - [GPU_SHADER_2D_WIDGET_SHADOW] = {.name = "GPU_SHADER_2D_WIDGET_SHADOW", - .create_info = "gpu_shader_2D_widget_shadow"}, - [GPU_SHADER_2D_NODELINK] = {.name = "GPU_SHADER_2D_NODELINK", - .create_info = "gpu_shader_2D_nodelink"}, - - [GPU_SHADER_2D_NODELINK_INST] = {.name = "GPU_SHADER_2D_NODELINK_INST", - .create_info = "gpu_shader_2D_nodelink_inst"}, - - [GPU_SHADER_GPENCIL_STROKE] = {.name = "GPU_SHADER_GPENCIL_STROKE", - .create_info = "gpu_shader_gpencil_stroke"}, + { + .name = "GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA", + .create_info = "gpu_shader_3D_point_uniform_size_uniform_color_aa", + .clipped_create_info = "gpu_shader_3D_point_uniform_size_uniform_color_aa_clipped", + }, + + [GPU_SHADER_2D_AREA_BORDERS] = + { + .name = "GPU_SHADER_2D_AREA_BORDERS", + .create_info = "gpu_shader_2D_area_borders", + }, + [GPU_SHADER_2D_WIDGET_BASE] = + { + .name = "GPU_SHADER_2D_WIDGET_BASE", + .create_info = "gpu_shader_2D_widget_base", + }, + [GPU_SHADER_2D_WIDGET_BASE_INST] = + { + .name = "GPU_SHADER_2D_WIDGET_BASE_INST", + .defs = "#define USE_INSTANCE\n", + .create_info = "gpu_shader_2D_widget_base_inst", + }, + [GPU_SHADER_2D_WIDGET_SHADOW] = + { + .name = "GPU_SHADER_2D_WIDGET_SHADOW", + .create_info = "gpu_shader_2D_widget_shadow", + }, + [GPU_SHADER_2D_NODELINK] = + { + .name = "GPU_SHADER_2D_NODELINK", + .create_info = "gpu_shader_2D_nodelink", + }, + + [GPU_SHADER_2D_NODELINK_INST] = + { + .name = "GPU_SHADER_2D_NODELINK_INST", + .create_info = "gpu_shader_2D_nodelink_inst", + }, + + [GPU_SHADER_GPENCIL_STROKE] = + { + .name = "GPU_SHADER_GPENCIL_STROKE", + .create_info = "gpu_shader_gpencil_stroke", + }, }; GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader, |