node clean something, its still broken mode

This commit is contained in:
mcrcortex
2025-01-28 06:03:06 +10:00
parent aac3db90d3
commit 4d6859db43
7 changed files with 54 additions and 26 deletions

View File

@@ -11,11 +11,11 @@ layout(binding = LIST_BUFFER_BINDING, std430) restrict readonly buffer SetListBu
};
layout(location=0) uniform uint count;
#define SET_TO uint(-1)
layout(location=1) uniform uint setTo;
void main() {
uint id = gl_GlobalInvocationID.x;
if (count <= id) {
return;
}
visiblity[ids[id]] = SET_TO;
visiblity[ids[id]] = setTo;
}

View File

@@ -7,6 +7,7 @@
layout(local_size_x=128, local_size_y=1) in;
//256 workgroup
#import <voxy:lod/hierarchical/node.glsl>
layout(binding = VISIBILITY_BUFFER_BINDING, std430) restrict readonly buffer VisibilityDataBuffer {
uint[] visiblity;
@@ -54,5 +55,10 @@ void main() {
if (visiblity[minVisIds[OUTPUT_SIZE-1]] <= vis) {
return;
}
UnpackedNode node;
unpackNode(node, gl_GlobalInvocationID.x);
if (isEmptyMesh(node) || !hasMesh(node)) {
return;
}
bubbleSort(0, gl_GlobalInvocationID.x, vis);
}

View File

@@ -61,15 +61,14 @@ void enqueueChildren(in UnpackedNode node) {
void enqueueSelfForRender(in UnpackedNode node) {
//printf("render %d@[%d,%d,%d]", node.lodLevel, node.pos.x, node.pos.y, node.pos.z);
if ((!isEmptyMesh(node)) && renderQueueIndex < renderQueueMaxSize) {
renderQueue[atomicAdd(renderQueueIndex, 1)] = getMesh(node);
#ifdef IS_DEBUG
debugRenderNodeQueue[atomicAdd(debugRenderNodeQueueIndex, 1)] = node.nodeId;
#endif
//TODO: decide if it should be this node id, or the mesh id
// for now do node id... think
if (renderQueueIndex < renderQueueMaxSize) {
lastRenderFrame[getId(node)] = frameId;
if (!isEmptyMesh(node)) {
renderQueue[atomicAdd(renderQueueIndex, 1)] = getMesh(node);
#ifdef IS_DEBUG
debugRenderNodeQueue[atomicAdd(debugRenderNodeQueueIndex, 1)] = node.nodeId;
#endif
}
}
}