diff options
11 files changed, 111 insertions, 108 deletions
diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index beae1c92d6e..68c1671b1bf 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -419,8 +419,8 @@ set(GLSL_SRC engines/gpencil/gpencil_defines.h engines/gpencil/gpencil_shader_shared.h - engines/select/shaders/selection_id_3D_vert.glsl - engines/select/shaders/selection_id_frag.glsl + engines/select/shaders/select_id_vert.glsl + engines/select/shaders/select_id_frag.glsl engines/basic/shaders/conservative_depth_geom.glsl engines/basic/shaders/depth_vert.glsl 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) { diff --git a/source/blender/draw/engines/select/shaders/infos/select_id_info.hh b/source/blender/draw/engines/select/shaders/infos/select_id_info.hh new file mode 100644 index 00000000000..ad0de61ffc3 --- /dev/null +++ b/source/blender/draw/engines/select/shaders/infos/select_id_info.hh @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "gpu_shader_create_info.hh" + +/* -------------------------------------------------------------------- */ +/** \name Select ID fo Edit Mesh selection + * \{ */ + +GPU_SHADER_INTERFACE_INFO(select_id_iface, "").flat(Type::INT, "id"); + +GPU_SHADER_CREATE_INFO(select_id_flat) + .push_constant(Type::FLOAT, "sizeVertex") + .push_constant(Type::INT, "offset") + .vertex_in(0, Type::VEC3, "pos") + .vertex_in(1, Type::INT, "index") + .vertex_out(select_id_iface) + .fragment_out(0, Type::UINT, "fragColor") + .vertex_source("select_id_vert.glsl") + .fragment_source("select_id_frag.glsl") + .additional_info("draw_modelmat") + .do_static_compilation(true); + +GPU_SHADER_CREATE_INFO(select_id_uniform) + .define("UNIFORM_ID") + .push_constant(Type::FLOAT, "sizeVertex") + .push_constant(Type::INT, "id") + .vertex_in(0, Type::VEC3, "pos") + .fragment_out(0, Type::UINT, "fragColor") + .vertex_source("select_id_vert.glsl") + .fragment_source("select_id_frag.glsl") + .additional_info("draw_modelmat") + .do_static_compilation(true); + +GPU_SHADER_CREATE_INFO(select_id_flat_clipped) + .additional_info("select_id_flat") + .additional_info("drw_clipped") + .do_static_compilation(true); + +GPU_SHADER_CREATE_INFO(select_id_uniform_clipped) + .additional_info("select_id_uniform") + .additional_info("drw_clipped") + .do_static_compilation(true); +/** \} */ diff --git a/source/blender/draw/engines/select/shaders/select_id_frag.glsl b/source/blender/draw/engines/select/shaders/select_id_frag.glsl new file mode 100644 index 00000000000..aecf57b4766 --- /dev/null +++ b/source/blender/draw/engines/select/shaders/select_id_frag.glsl @@ -0,0 +1,4 @@ +void main() +{ + fragColor = floatBitsToUint(intBitsToFloat(id)); +} diff --git a/source/blender/draw/engines/select/shaders/select_id_vert.glsl b/source/blender/draw/engines/select/shaders/select_id_vert.glsl new file mode 100644 index 00000000000..7b3b0f9984d --- /dev/null +++ b/source/blender/draw/engines/select/shaders/select_id_vert.glsl @@ -0,0 +1,15 @@ +#pragma BLENDER_REQUIRE(common_view_clipping_lib.glsl) +#pragma BLENDER_REQUIRE(common_view_lib.glsl) + +void main() +{ +#ifndef UNIFORM_ID + id = offset + index; +#endif + + vec3 world_pos = point_object_to_world(pos); + gl_Position = point_world_to_ndc(world_pos); + gl_PointSize = sizeVertex; + + view_clipping_distances(world_pos); +} diff --git a/source/blender/draw/engines/select/shaders/selection_id_3D_vert.glsl b/source/blender/draw/engines/select/shaders/selection_id_3D_vert.glsl deleted file mode 100644 index 9b0107cffdb..00000000000 --- a/source/blender/draw/engines/select/shaders/selection_id_3D_vert.glsl +++ /dev/null @@ -1,26 +0,0 @@ - -uniform float sizeVertex; - -in vec3 pos; - -#ifndef UNIFORM_ID -uniform int offset; -in uint color; - -flat out uint id; -#endif - -void main() -{ -#ifndef UNIFORM_ID - id = floatBitsToUint(intBitsToFloat(offset)) + color; -#endif - - vec3 world_pos = point_object_to_world(pos); - gl_Position = point_world_to_ndc(world_pos); - gl_PointSize = sizeVertex; - -#ifdef USE_WORLD_CLIP_PLANES - world_clip_planes_calc_clip_distance(world_pos); -#endif -} diff --git a/source/blender/draw/engines/select/shaders/selection_id_frag.glsl b/source/blender/draw/engines/select/shaders/selection_id_frag.glsl deleted file mode 100644 index a84bbbb2cac..00000000000 --- a/source/blender/draw/engines/select/shaders/selection_id_frag.glsl +++ /dev/null @@ -1,15 +0,0 @@ - -#ifdef UNIFORM_ID -uniform int id; -# define _id floatBitsToUint(intBitsToFloat(id)) -#else -flat in uint id; -# define _id id -#endif - -out uint fragColor; - -void main() -{ - fragColor = _id; -} diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index 4a39ca6dacb..7c72b77af1f 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -361,7 +361,7 @@ static GPUVertFormat *get_origindex_format() { static GPUVertFormat format; if (format.attr_len == 0) { - GPU_vertformat_attr_add(&format, "color", GPU_COMP_U32, 1, GPU_FETCH_INT); + GPU_vertformat_attr_add(&format, "index", GPU_COMP_I32, 1, GPU_FETCH_INT); } return &format; } @@ -442,15 +442,15 @@ static uint tris_count_from_number_of_loops(const uint number_of_loops) * \{ */ void draw_subdiv_init_origindex_buffer(GPUVertBuf *buffer, - int *vert_origindex, + int32_t *vert_origindex, uint num_loops, uint loose_len) { GPU_vertbuf_init_with_format_ex(buffer, get_origindex_format(), GPU_USAGE_STATIC); GPU_vertbuf_data_alloc(buffer, num_loops + loose_len); - int *vbo_data = (int *)GPU_vertbuf_get_data(buffer); - memcpy(vbo_data, vert_origindex, num_loops * sizeof(int)); + int32_t *vbo_data = (int32_t *)GPU_vertbuf_get_data(buffer); + memcpy(vbo_data, vert_origindex, num_loops * sizeof(int32_t)); } GPUVertBuf *draw_subdiv_build_origindex_buffer(int *vert_origindex, uint num_loops) diff --git a/source/blender/draw/intern/draw_subdivision.h b/source/blender/draw/intern/draw_subdivision.h index 8d7bc3dc495..e5f64a99092 100644 --- a/source/blender/draw/intern/draw_subdivision.h +++ b/source/blender/draw/intern/draw_subdivision.h @@ -206,7 +206,7 @@ void draw_subdiv_init_mesh_render_data(DRWSubdivCache *cache, const struct ToolSettings *toolsettings); void draw_subdiv_init_origindex_buffer(struct GPUVertBuf *buffer, - int *vert_origindex, + int32_t *vert_origindex, uint num_loops, uint loose_len); diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_select_idx.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_select_idx.cc index be4c292e842..c7d36098140 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_select_idx.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_select_idx.cc @@ -22,12 +22,11 @@ static void extract_select_idx_init_impl(const MeshRenderData *UNUSED(mr), GPUVertBuf *vbo = static_cast<GPUVertBuf *>(buf); static GPUVertFormat format = {0}; if (format.attr_len == 0) { - /* TODO: rename "color" to something more descriptive. */ - GPU_vertformat_attr_add(&format, "color", GPU_COMP_U32, 1, GPU_FETCH_INT); + GPU_vertformat_attr_add(&format, "index", GPU_COMP_I32, 1, GPU_FETCH_INT); } GPU_vertbuf_init_with_format(vbo, &format); GPU_vertbuf_data_alloc(vbo, len); - *(uint32_t **)tls_data = (uint32_t *)GPU_vertbuf_get_data(vbo); + *(int32_t **)tls_data = (int32_t *)GPU_vertbuf_get_data(vbo); } static void extract_select_idx_init(const MeshRenderData *mr, @@ -52,7 +51,7 @@ static void extract_poly_idx_iter_poly_bm(const MeshRenderData *UNUSED(mr), l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { const int l_index = BM_elem_index_get(l_iter); - (*(uint32_t **)data)[l_index] = f_index; + (*(int32_t **)data)[l_index] = f_index; } while ((l_iter = l_iter->next) != l_first); } @@ -65,7 +64,7 @@ static void extract_edge_idx_iter_poly_bm(const MeshRenderData *UNUSED(mr), l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { const int l_index = BM_elem_index_get(l_iter); - (*(uint32_t **)data)[l_index] = BM_elem_index_get(l_iter->e); + (*(int32_t **)data)[l_index] = BM_elem_index_get(l_iter->e); } while ((l_iter = l_iter->next) != l_first); } @@ -78,7 +77,7 @@ static void extract_vert_idx_iter_poly_bm(const MeshRenderData *UNUSED(mr), l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { const int l_index = BM_elem_index_get(l_iter); - (*(uint32_t **)data)[l_index] = BM_elem_index_get(l_iter->v); + (*(int32_t **)data)[l_index] = BM_elem_index_get(l_iter->v); } while ((l_iter = l_iter->next) != l_first); } @@ -87,8 +86,8 @@ static void extract_edge_idx_iter_ledge_bm(const MeshRenderData *mr, const int ledge_index, void *data) { - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = BM_elem_index_get(eed); - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = BM_elem_index_get(eed); + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = BM_elem_index_get(eed); + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = BM_elem_index_get(eed); } static void extract_vert_idx_iter_ledge_bm(const MeshRenderData *mr, @@ -96,8 +95,8 @@ static void extract_vert_idx_iter_ledge_bm(const MeshRenderData *mr, const int ledge_index, void *data) { - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = BM_elem_index_get(eed->v1); - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = BM_elem_index_get(eed->v2); + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = BM_elem_index_get(eed->v1); + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = BM_elem_index_get(eed->v2); } static void extract_vert_idx_iter_lvert_bm(const MeshRenderData *mr, @@ -107,7 +106,7 @@ static void extract_vert_idx_iter_lvert_bm(const MeshRenderData *mr, { const int offset = mr->loop_len + (mr->edge_loose_len * 2); - (*(uint32_t **)data)[offset + lvert_index] = BM_elem_index_get(eve); + (*(int32_t **)data)[offset + lvert_index] = BM_elem_index_get(eve); } static void extract_poly_idx_iter_poly_mesh(const MeshRenderData *mr, @@ -117,7 +116,7 @@ static void extract_poly_idx_iter_poly_mesh(const MeshRenderData *mr, { const int ml_index_end = mp->loopstart + mp->totloop; for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { - (*(uint32_t **)data)[ml_index] = (mr->p_origindex) ? mr->p_origindex[mp_index] : mp_index; + (*(int32_t **)data)[ml_index] = (mr->p_origindex) ? mr->p_origindex[mp_index] : mp_index; } } @@ -130,7 +129,7 @@ static void extract_edge_idx_iter_poly_mesh(const MeshRenderData *mr, const int ml_index_end = mp->loopstart + mp->totloop; for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { const MLoop *ml = &mloop[ml_index]; - (*(uint32_t **)data)[ml_index] = (mr->e_origindex) ? mr->e_origindex[ml->e] : ml->e; + (*(int32_t **)data)[ml_index] = (mr->e_origindex) ? mr->e_origindex[ml->e] : ml->e; } } @@ -143,7 +142,7 @@ static void extract_vert_idx_iter_poly_mesh(const MeshRenderData *mr, const int ml_index_end = mp->loopstart + mp->totloop; for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { const MLoop *ml = &mloop[ml_index]; - (*(uint32_t **)data)[ml_index] = (mr->v_origindex) ? mr->v_origindex[ml->v] : ml->v; + (*(int32_t **)data)[ml_index] = (mr->v_origindex) ? mr->v_origindex[ml->v] : ml->v; } } @@ -154,8 +153,8 @@ static void extract_edge_idx_iter_ledge_mesh(const MeshRenderData *mr, { const int e_index = mr->ledges[ledge_index]; const int e_orig = (mr->e_origindex) ? mr->e_origindex[e_index] : e_index; - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = e_orig; - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = e_orig; + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = e_orig; + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = e_orig; } static void extract_vert_idx_iter_ledge_mesh(const MeshRenderData *mr, @@ -165,8 +164,8 @@ static void extract_vert_idx_iter_ledge_mesh(const MeshRenderData *mr, { int v1_orig = (mr->v_origindex) ? mr->v_origindex[med->v1] : med->v1; int v2_orig = (mr->v_origindex) ? mr->v_origindex[med->v2] : med->v2; - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = v1_orig; - (*(uint32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = v2_orig; + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 0] = v1_orig; + (*(int32_t **)data)[mr->loop_len + ledge_index * 2 + 1] = v2_orig; } static void extract_vert_idx_iter_lvert_mesh(const MeshRenderData *mr, @@ -178,7 +177,7 @@ static void extract_vert_idx_iter_lvert_mesh(const MeshRenderData *mr, const int v_index = mr->lverts[lvert_index]; const int v_orig = (mr->v_origindex) ? mr->v_origindex[v_index] : v_index; - (*(uint32_t **)data)[offset + lvert_index] = v_orig; + (*(int32_t **)data)[offset + lvert_index] = v_orig; } static void extract_vert_idx_init_subdiv(const DRWSubdivCache *subdiv_cache, @@ -190,10 +189,11 @@ static void extract_vert_idx_init_subdiv(const DRWSubdivCache *subdiv_cache, GPUVertBuf *vbo = static_cast<GPUVertBuf *>(buf); const DRWSubdivLooseGeom &loose_geom = subdiv_cache->loose_geom; /* Each element points to an element in the ibo.points. */ - draw_subdiv_init_origindex_buffer(vbo, - (int *)GPU_vertbuf_get_data(subdiv_cache->verts_orig_index), - subdiv_cache->num_subdiv_loops, - loose_geom.loop_len); + draw_subdiv_init_origindex_buffer( + vbo, + (int32_t *)GPU_vertbuf_get_data(subdiv_cache->verts_orig_index), + subdiv_cache->num_subdiv_loops, + loose_geom.loop_len); if (!mr->v_origindex) { return; } @@ -201,7 +201,7 @@ static void extract_vert_idx_init_subdiv(const DRWSubdivCache *subdiv_cache, /* Remap the vertex indices to those pointed by the origin indices layer. At this point, the * VBO data is a copy of #verts_orig_index which contains the coarse vertices indices, so * the memory can both be accessed for lookup and immediately overwritten. */ - int *vbo_data = static_cast<int *>(GPU_vertbuf_get_data(vbo)); + int32_t *vbo_data = static_cast<int32_t *>(GPU_vertbuf_get_data(vbo)); for (int i = 0; i < subdiv_cache->num_subdiv_loops; i++) { if (vbo_data[i] == -1) { continue; @@ -221,8 +221,8 @@ static void extract_vert_idx_loose_geom_subdiv(const DRWSubdivCache *subdiv_cach } GPUVertBuf *vbo = static_cast<GPUVertBuf *>(buffer); - uint *vert_idx_data = (uint *)GPU_vertbuf_get_data(vbo); - uint offset = subdiv_cache->num_subdiv_loops; + int32_t *vert_idx_data = (int32_t *)GPU_vertbuf_get_data(vbo); + int offset = subdiv_cache->num_subdiv_loops; blender::Span<DRWSubdivLooseEdge> loose_edges = draw_subdiv_cache_get_loose_edges(subdiv_cache); @@ -263,7 +263,7 @@ static void extract_edge_idx_init_subdiv(const DRWSubdivCache *subdiv_cache, const DRWSubdivLooseGeom &loose_geom = subdiv_cache->loose_geom; draw_subdiv_init_origindex_buffer( vbo, - static_cast<int *>(GPU_vertbuf_get_data(subdiv_cache->edges_orig_index)), + static_cast<int32_t *>(GPU_vertbuf_get_data(subdiv_cache->edges_orig_index)), subdiv_cache->num_subdiv_loops, loose_geom.edge_len * 2); } @@ -279,8 +279,8 @@ static void extract_edge_idx_loose_geom_subdiv(const DRWSubdivCache *subdiv_cach } GPUVertBuf *vbo = static_cast<GPUVertBuf *>(buffer); - uint *vert_idx_data = (uint *)GPU_vertbuf_get_data(vbo); - uint offset = subdiv_cache->num_subdiv_loops; + int32_t *vert_idx_data = (int32_t *)GPU_vertbuf_get_data(vbo); + int offset = subdiv_cache->num_subdiv_loops; blender::Span<DRWSubdivLooseEdge> loose_edges = draw_subdiv_cache_get_loose_edges(subdiv_cache); for (const DRWSubdivLooseEdge &loose_edge : loose_edges) { @@ -309,7 +309,7 @@ static void extract_poly_idx_init_subdiv(const DRWSubdivCache *subdiv_cache, /* Remap the polygon indices to those pointed by the origin indices layer. At this point, the * VBO data is a copy of #subdiv_loop_poly_index which contains the coarse polygon indices, so * the memory can both be accessed for lookup and immediately overwritten. */ - int *vbo_data = static_cast<int *>(GPU_vertbuf_get_data(vbo)); + int32_t *vbo_data = static_cast<int32_t *>(GPU_vertbuf_get_data(vbo)); for (int i = 0; i < subdiv_cache->num_subdiv_loops; i++) { vbo_data[i] = mr->p_origindex[vbo_data[i]]; } @@ -323,7 +323,7 @@ constexpr MeshExtract create_extractor_poly_idx() extractor.iter_poly_mesh = extract_poly_idx_iter_poly_mesh; extractor.init_subdiv = extract_poly_idx_init_subdiv; extractor.data_type = MR_DATA_NONE; - extractor.data_size = sizeof(uint32_t *); + extractor.data_size = sizeof(int32_t *); extractor.use_threading = true; extractor.mesh_buffer_offset = offsetof(MeshBufferList, vbo.poly_idx); return extractor; @@ -340,7 +340,7 @@ constexpr MeshExtract create_extractor_edge_idx() extractor.init_subdiv = extract_edge_idx_init_subdiv; extractor.iter_loose_geom_subdiv = extract_edge_idx_loose_geom_subdiv; extractor.data_type = MR_DATA_NONE; - extractor.data_size = sizeof(uint32_t *); + extractor.data_size = sizeof(int32_t *); extractor.use_threading = true; extractor.mesh_buffer_offset = offsetof(MeshBufferList, vbo.edge_idx); return extractor; @@ -359,7 +359,7 @@ constexpr MeshExtract create_extractor_vert_idx() extractor.init_subdiv = extract_vert_idx_init_subdiv; extractor.iter_loose_geom_subdiv = extract_vert_idx_loose_geom_subdiv; extractor.data_type = MR_DATA_NONE; - extractor.data_size = sizeof(uint32_t *); + extractor.data_size = sizeof(int32_t *); extractor.use_threading = true; extractor.mesh_buffer_offset = offsetof(MeshBufferList, vbo.vert_idx); return extractor; @@ -378,7 +378,7 @@ static void extract_fdot_idx_iter_poly_bm(const MeshRenderData *UNUSED(mr), const int f_index, void *data) { - (*(uint32_t **)data)[f_index] = f_index; + (*(int32_t **)data)[f_index] = f_index; } static void extract_fdot_idx_iter_poly_mesh(const MeshRenderData *mr, @@ -387,10 +387,10 @@ static void extract_fdot_idx_iter_poly_mesh(const MeshRenderData *mr, void *data) { if (mr->p_origindex != nullptr) { - (*(uint32_t **)data)[mp_index] = mr->p_origindex[mp_index]; + (*(int32_t **)data)[mp_index] = mr->p_origindex[mp_index]; } else { - (*(uint32_t **)data)[mp_index] = mp_index; + (*(int32_t **)data)[mp_index] = mp_index; } } @@ -401,7 +401,7 @@ constexpr MeshExtract create_extractor_fdot_idx() extractor.iter_poly_bm = extract_fdot_idx_iter_poly_bm; extractor.iter_poly_mesh = extract_fdot_idx_iter_poly_mesh; extractor.data_type = MR_DATA_NONE; - extractor.data_size = sizeof(uint32_t *); + extractor.data_size = sizeof(int32_t *); extractor.use_threading = true; extractor.mesh_buffer_offset = offsetof(MeshBufferList, vbo.fdot_idx); return extractor; diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index d0a3409b280..96cadba9852 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -446,6 +446,7 @@ set(SRC_SHADER_CREATE_INFOS ../draw/engines/overlay/shaders/infos/armature_info.hh ../draw/engines/overlay/shaders/infos/grid_info.hh ../draw/engines/overlay/shaders/infos/edit_mode_info.hh + ../draw/engines/select/shaders/infos/select_id_info.hh ../draw/engines/workbench/shaders/infos/workbench_composite_info.hh ../draw/engines/workbench/shaders/infos/workbench_effect_antialiasing_info.hh ../draw/engines/workbench/shaders/infos/workbench_effect_cavity_info.hh |