Make the request queue dynamically capped, greatly increasing snappyness
This commit is contained in:
@@ -16,6 +16,7 @@ layout(binding = SCENE_UNIFORM_BINDING, std140) uniform SceneUniform {
|
||||
Frustum frustum;
|
||||
uint renderQueueMaxSize;
|
||||
uint frameId;
|
||||
uint requestQueueSize;
|
||||
};
|
||||
|
||||
#import <voxy:lod/hierarchical/queue.glsl>
|
||||
@@ -48,9 +49,9 @@ layout(binding = STATISTICS_BUFFER_BINDING, std430) restrict buffer statisticsBu
|
||||
void addRequest(inout UnpackedNode node) {
|
||||
//printf("Put node decend request");
|
||||
if (!hasRequested(node)) {
|
||||
if (requestQueueIndex.x < REQUEST_QUEUE_SIZE) {
|
||||
if (requestQueueIndex.x < requestQueueSize) {//Soft limit
|
||||
uint atomRes = atomicAdd(requestQueueIndex.x, 1);
|
||||
if (atomRes < REQUEST_QUEUE_SIZE) {
|
||||
if (atomRes < MAX_REQUEST_QUEUE_SIZE) {//Hard limit
|
||||
//Mark node as having a request submitted to prevent duplicate submissions
|
||||
requestQueue[atomRes] = getRawPos(node);
|
||||
markRequested(node);
|
||||
|
||||
Reference in New Issue
Block a user