Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-04-29 08:14:16 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-04-29 16:15:04 +0300
commit3d877c8a0d06ee539db541c6d410852f94fc618d (patch)
tree047b92a10ee88c7e756b27f6729551a2070a9bdb /source/blender/draw/engines/select/select_engine.c
parenta111a0f1e149dfbcf06b1dfd15d9764508d83028 (diff)
Select Engine: port shader to use 'GPUShaderCreateInfo'
Simple port with a few cosmetic changes: - Attribute named "color" for indices VBO is now called "index" - The indices VBO is now composed of `int`s instead of `uint`s (this simplifies the source) Differential Revision: https://developer.blender.org/D14800
Diffstat (limited to 'source/blender/draw/engines/select/select_engine.c')
-rw-r--r--source/blender/draw/engines/select/select_engine.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/source/blender/draw/engines/select/select_engine.c b/source/blender/draw/engines/select/select_engine.c
index 0b3db521e74..88ae5ac707e 100644
--- a/source/blender/draw/engines/select/select_engine.c
+++ b/source/blender/draw/engines/select/select_engine.c
@@ -33,11 +33,6 @@ static struct {
uint runtime_new_objects;
} e_data = {NULL}; /* Engine data */
-/* Shaders */
-extern char datatoc_common_view_lib_glsl[];
-extern char datatoc_selection_id_3D_vert_glsl[];
-extern char datatoc_selection_id_frag_glsl[];
-
/* -------------------------------------------------------------------- */
/** \name Utils
* \{ */
@@ -88,26 +83,12 @@ static void select_engine_init(void *vedata)
/* Prepass */
if (!sh_data->select_id_flat) {
- const GPUShaderConfigData *sh_cfg_data = &GPU_shader_cfg_data[sh_cfg];
- sh_data->select_id_flat = GPU_shader_create_from_arrays({
- .vert = (const char *[]){sh_cfg_data->lib,
- datatoc_common_view_lib_glsl,
- datatoc_selection_id_3D_vert_glsl,
- NULL},
- .frag = (const char *[]){datatoc_selection_id_frag_glsl, NULL},
- .defs = (const char *[]){sh_cfg_data->def, NULL},
- });
+ sh_data->select_id_flat = GPU_shader_create_from_info_name(
+ sh_cfg == GPU_SHADER_CFG_CLIPPED ? "select_id_flat_clipped" : "select_id_flat");
}
if (!sh_data->select_id_uniform) {
- const GPUShaderConfigData *sh_cfg_data = &GPU_shader_cfg_data[sh_cfg];
- sh_data->select_id_uniform = GPU_shader_create_from_arrays({
- .vert = (const char *[]){sh_cfg_data->lib,
- datatoc_common_view_lib_glsl,
- datatoc_selection_id_3D_vert_glsl,
- NULL},
- .frag = (const char *[]){datatoc_selection_id_frag_glsl, NULL},
- .defs = (const char *[]){sh_cfg_data->def, "#define UNIFORM_ID\n", NULL},
- });
+ sh_data->select_id_uniform = GPU_shader_create_from_info_name(
+ sh_cfg == GPU_SHADER_CFG_CLIPPED ? "select_id_uniform_clipped" : "select_id_uniform");
}
if (!stl->g_data) {