Skip to content

Commit

Permalink
minor back/worth on meshlet-size and per-triangle culling
Browse files Browse the repository at this point in the history
  • Loading branch information
crocdialer committed Oct 12, 2024
1 parent 838afa8 commit 091f3ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/vierkant/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct mesh_buffer_params_t
size_t meshlet_max_vertices = 64;

//! maximum number of triangles per meshlet
size_t meshlet_max_triangles = 126;
size_t meshlet_max_triangles = 84;

//! cone-weight used during meshlet-generation. useful for cluster-culling
float meshlet_cone_weight = 0.5f;
Expand Down
4 changes: 2 additions & 2 deletions shaders/pbr/g_buffer.mesh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#include "../utils/camera.glsl"
#include "../utils/packed_vertex.glsl"

// TODO: not really worth it? not sure ...
#define CULLING 0

// NOTE: local_size_x_id coming from specialization-constant
layout(local_size_x_id = 1, local_size_y = 1, local_size_z = 1) in;
layout(triangles, max_vertices = MESHLET_MAX_VERTICES, max_primitives = MESHLET_MAX_TRIANGLES) out;

#define CULLING 1

layout(buffer_reference, scalar) readonly buffer VertexBufferPtr { packed_vertex_t v[]; };
layout(binding = BINDING_VERTICES, set = 0) readonly buffer Vertices { VertexBufferPtr vertex_buffers[]; };

Expand Down
2 changes: 1 addition & 1 deletion shaders/renderer/mesh_task_payload.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// TODO: reasonable default setting for nvidia only!?
#define MESHLET_MAX_VERTICES 64
#define MESHLET_MAX_TRIANGLES 126
#define MESHLET_MAX_TRIANGLES 84

// TODO: mesh/task workgroup sizes are still vendor-specific (NV -> 32/32, AMD -> 64/128)
// TODO: those sizes directly influence some array-sizes in meshlet-codepath: needs shader-permuations
Expand Down

0 comments on commit 091f3ce

Please sign in to comment.