Cleanup: Remove unused variable in subdiv paint overlay shader

From 4b4ed8bccc
The vert to loop map is unnecessary here, we don't need information
about neighboring faces. This was just incorrectly copied from older
code where this data was mixed with normal evaluation.
This commit is contained in:
Hans Goudey
2025-06-16 10:21:01 -04:00
parent 961fdb9a86
commit 6bb10e8412
6 changed files with 4 additions and 15 deletions

View File

@@ -1387,9 +1387,7 @@ void draw_subdiv_build_lnor_buffer(const DRWSubdivCache &cache,
GPU_shader_unbind();
}
void draw_subdiv_build_paint_overlay_flag_buffer(const DRWSubdivCache &cache,
gpu::VertBuf &subdiv_corner_verts,
gpu::VertBuf &flags)
void draw_subdiv_build_paint_overlay_flag_buffer(const DRWSubdivCache &cache, gpu::VertBuf &flags)
{
if (!draw_subdiv_cache_need_face_data(cache)) {
/* Happens on meshes with only loose geometry. */
@@ -1404,7 +1402,6 @@ void draw_subdiv_build_paint_overlay_flag_buffer(const DRWSubdivCache &cache,
GPU_vertbuf_bind_as_ssbo(cache.extra_coarse_face_data,
PAINT_OVERLAY_EXTRA_COARSE_FACE_DATA_BUF_SLOT);
GPU_vertbuf_bind_as_ssbo(cache.verts_orig_index, PAINT_OVERLAY_EXTRA_INPUT_VERT_ORIG_INDEX_SLOT);
GPU_vertbuf_bind_as_ssbo(&subdiv_corner_verts, PAINT_OVERLAY_FLAG_VERTEX_LOOP_MAP_BUF_SLOT);
/* Outputs */
GPU_vertbuf_bind_as_ssbo(&flags, PAINT_OVERLAY_OUTPUT_FLAG_SLOT);

View File

@@ -74,8 +74,7 @@
#define PAINT_OVERLAY_EXTRA_COARSE_FACE_DATA_BUF_SLOT 1
#define PAINT_OVERLAY_EXTRA_INPUT_VERT_ORIG_INDEX_SLOT 2
#define PAINT_OVERLAY_FLAG_VERTEX_LOOP_MAP_BUF_SLOT 3
#define PAINT_OVERLAY_OUTPUT_FLAG_SLOT 4
#define PAINT_OVERLAY_OUTPUT_FLAG_SLOT 3
#define LOOP_NORMALS_POS_SLOT 1
#define LOOP_NORMALS_EXTRA_COARSE_FACE_DATA_BUF_SLOT 2

View File

@@ -236,9 +236,7 @@ void draw_subdiv_build_lnor_buffer(const DRWSubdivCache &cache,
gpu::VertBuf *subdiv_corner_verts,
gpu::VertBuf *lnor);
void draw_subdiv_build_paint_overlay_flag_buffer(const DRWSubdivCache &cache,
gpu::VertBuf &subdiv_corner_verts,
gpu::VertBuf &flags);
void draw_subdiv_build_paint_overlay_flag_buffer(const DRWSubdivCache &cache, gpu::VertBuf &flags);
void draw_subdiv_build_edituv_stretch_area_buffer(const DRWSubdivCache &cache,
gpu::VertBuf *coarse_data,

View File

@@ -131,10 +131,8 @@ gpu::VertBufPtr extract_paint_overlay_flags_subdiv(const MeshRenderData &mr,
{
gpu::VertBufPtr flags = gpu::VertBufPtr(GPU_vertbuf_create_on_device(
get_paint_overlay_flag_format(), subdiv_full_vbo_size(mr, subdiv_cache)));
gpu::VertBufPtr subdiv_corner_verts = gpu::VertBufPtr(draw_subdiv_build_origindex_buffer(
subdiv_cache.subdiv_loop_subdiv_vert_index, subdiv_cache.num_subdiv_loops));
draw_subdiv_build_paint_overlay_flag_buffer(subdiv_cache, *subdiv_corner_verts, *flags);
draw_subdiv_build_paint_overlay_flag_buffer(subdiv_cache, *flags);
update_loose_flags(mr, subdiv_cache, *flags);
return flags;

View File

@@ -294,7 +294,6 @@ GPU_SHADER_CREATE_INFO(subdiv_paint_overlay_flag)
DO_STATIC_COMPILATION()
STORAGE_BUF(PAINT_OVERLAY_EXTRA_COARSE_FACE_DATA_BUF_SLOT, read, uint, extra_coarse_face_data[])
STORAGE_BUF(PAINT_OVERLAY_EXTRA_INPUT_VERT_ORIG_INDEX_SLOT, read, int, input_vert_origindex[])
STORAGE_BUF(PAINT_OVERLAY_FLAG_VERTEX_LOOP_MAP_BUF_SLOT, read, uint, vert_loop_map[])
STORAGE_BUF(PAINT_OVERLAY_OUTPUT_FLAG_SLOT, write, int, flags[])
COMPUTE_SOURCE("subdiv_vbo_paint_overlay_flag_comp.glsl")
ADDITIONAL_INFO(subdiv_polygon_offset_base)

View File

@@ -42,8 +42,6 @@ void main()
uint coarse_quad_index = coarse_face_index_from_subdiv_quad_index(quad_index,
shader_data.coarse_face_count);
for (int i = 0; i < 4; i++) {
uint subdiv_vert_index = vert_loop_map[start_loop_index + i];
int origindex = input_vert_origindex[start_loop_index + i];
int flag = get_loop_flag(coarse_quad_index, origindex);