node clean something, its still broken mode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user