DRW: Curves: Indexbuf optimization for large numbers of curves #116617

Merged
Clément Foucault merged 7 commits from Eugene-Kuznetsov/blender:ek_curves_2d_draw into main 2024-02-25 17:23:06 +01:00
6 changed files with 13 additions and 13 deletions
Showing only changes of commit 6bf37ab5ec - Show all commits

View File

@ -590,9 +590,9 @@ set(GLSL_SRC
shaders/gpu_shader_cfg_world_clip_lib.glsl
shaders/gpu_shader_colorspace_lib.glsl
shaders/gpu_compute_2d_array_points.glsl
shaders/gpu_compute_2d_array_lines.glsl
shaders/gpu_compute_2d_array_tris.glsl
shaders/gpu_shader_index_2d_array_points.glsl
shaders/gpu_shader_index_2d_array_lines.glsl
shaders/gpu_shader_index_2d_array_tris.glsl
GPU_shader_shared_utils.h
)
@ -737,7 +737,6 @@ set(SRC_SHADER_CREATE_INFOS
../draw/intern/shaders/draw_view_info.hh
shaders/infos/gpu_clip_planes_info.hh
shaders/infos/gpu_compute_shaders_info.hh
shaders/infos/gpu_shader_2D_area_borders_info.hh
shaders/infos/gpu_shader_2D_checker_info.hh
shaders/infos/gpu_shader_2D_diag_stripes_info.hh
@ -761,6 +760,7 @@ set(SRC_SHADER_CREATE_INFOS
shaders/infos/gpu_shader_3D_uniform_color_info.hh
shaders/infos/gpu_shader_gpencil_stroke_info.hh
shaders/infos/gpu_shader_icon_info.hh
shaders/infos/gpu_shader_index_info.hh
shaders/infos/gpu_shader_instance_varying_color_varying_size_info.hh
shaders/infos/gpu_shader_keyframe_shape_info.hh
shaders/infos/gpu_shader_line_dashed_uniform_color_info.hh

View File

@ -88,11 +88,11 @@ static const char *builtin_shader_create_info_name(eGPUBuiltinShader shader)
case GPU_SHADER_GPENCIL_STROKE:
return "gpu_shader_gpencil_stroke";
case GPU_SHADER_INDEXBUF_POINTS:
return "gpu_compute_2d_array_points";
return "gpu_shader_index_2d_array_points";
case GPU_SHADER_INDEXBUF_LINES:
return "gpu_compute_2d_array_lines";
return "gpu_shader_index_2d_array_lines";
case GPU_SHADER_INDEXBUF_TRIS:
return "gpu_compute_2d_array_tris";
return "gpu_shader_index_2d_array_tris";
default:
BLI_assert_unreachable();
return "";

View File

@ -9,26 +9,26 @@
#include "gpu_interface_info.hh"
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(gpu_compute_2d_array_points)
GPU_SHADER_CREATE_INFO(gpu_shader_index_2d_array_points)
.local_group_size(16, 16, 1)
.push_constant(Type::INT, "elements_per_curve")
.push_constant(Type::INT, "ncurves")
.storage_buf(0, Qualifier::WRITE, "uint", "out_indices[]")
.compute_source("gpu_compute_2d_array_points.glsl")
.compute_source("gpu_shader_index_2d_array_points.glsl")
.do_static_compilation(true);
GPU_SHADER_CREATE_INFO(gpu_compute_2d_array_lines)
GPU_SHADER_CREATE_INFO(gpu_shader_index_2d_array_lines)
.local_group_size(16, 16, 1)
.push_constant(Type::INT, "elements_per_curve")
.push_constant(Type::INT, "ncurves")
.storage_buf(0, Qualifier::WRITE, "uint", "out_indices[]")
.compute_source("gpu_compute_2d_array_lines.glsl")
.compute_source("gpu_shader_index_2d_array_lines.glsl")
.do_static_compilation(true);
GPU_SHADER_CREATE_INFO(gpu_compute_2d_array_tris)
GPU_SHADER_CREATE_INFO(gpu_shader_index_2d_array_tris)
.local_group_size(16, 16, 1)
.push_constant(Type::INT, "elements_per_curve")
.push_constant(Type::INT, "ncurves")
.storage_buf(0, Qualifier::WRITE, "uint", "out_indices[]")
.compute_source("gpu_compute_2d_array_tris.glsl")
.compute_source("gpu_shader_index_2d_array_tris.glsl")
.do_static_compilation(true);