Small change
This commit is contained in:
@@ -2,6 +2,7 @@ package me.cortex.voxy.client.core.rendering.hierarchical;
|
|||||||
|
|
||||||
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
|
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
|
||||||
import me.cortex.voxy.client.core.rendering.building.BuiltSection;
|
import me.cortex.voxy.client.core.rendering.building.BuiltSection;
|
||||||
|
import me.cortex.voxy.client.core.rendering.util.DownloadStream;
|
||||||
import me.cortex.voxy.client.core.rendering.util.MarkedObjectList;
|
import me.cortex.voxy.client.core.rendering.util.MarkedObjectList;
|
||||||
import me.cortex.voxy.common.util.HierarchicalBitSet;
|
import me.cortex.voxy.common.util.HierarchicalBitSet;
|
||||||
import me.cortex.voxy.common.world.WorldEngine;
|
import me.cortex.voxy.common.world.WorldEngine;
|
||||||
@@ -341,7 +342,16 @@ public class NodeManager2 {
|
|||||||
private void pushNode(int node) {
|
private void pushNode(int node) {
|
||||||
|
|
||||||
}
|
}
|
||||||
public void nodeUpload() {
|
|
||||||
|
private void writeNode(long dst, int id) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//2 parts upload and download
|
||||||
|
|
||||||
|
private void download() {
|
||||||
|
//Download the request queue then clear the counter (first 4 bytes)
|
||||||
|
DownloadStream.INSTANCE.download(this.);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#define SCENE_UNIFORM_INDEX 0
|
#define SCENE_UNIFORM_INDEX 0
|
||||||
#define NODE_DATA_INDEX 1
|
#define NODE_DATA_INDEX 1
|
||||||
#define ATOMIC_DATA_INDEX 2
|
#define REQUEST_QUEUE_INDEX 2
|
||||||
#define REQUEST_QUEUE_INDEX 3
|
#define RENDER_QUEUE_INDEX 3
|
||||||
#define RENDER_QUEUE_INDEX 4
|
#define TRANSFORM_ARRAY_INDEX 4
|
||||||
#define TRANSFORM_ARRAY_INDEX 5
|
|
||||||
|
|
||||||
//Samplers
|
//Samplers
|
||||||
#define HIZ_BINDING_INDEX 0
|
#define HIZ_BINDING_INDEX 0
|
||||||
|
|||||||
@@ -21,21 +21,17 @@ layout(binding = SCENE_UNIFORM_INDEX, std140) uniform SceneUniform {
|
|||||||
uint screenW;
|
uint screenW;
|
||||||
vec3 camSubSecPos;
|
vec3 camSubSecPos;
|
||||||
uint screenH;
|
uint screenH;
|
||||||
|
uint requestQueueMaxSize;
|
||||||
|
uint renderQueueMaxSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(binding = ATOMIC_DATA_INDEX, std430) restrict buffer Atomics {
|
layout(binding = REQUEST_QUEUE_INDEX, std430) restrict buffer RequestQueue {
|
||||||
uint requestQueueIndex;
|
uint requestQueueIndex;
|
||||||
uint requestQueueMaxSize;
|
|
||||||
|
|
||||||
uint renderQueueIndex;
|
|
||||||
uint renderQueueMaxSize;
|
|
||||||
} atomics;
|
|
||||||
|
|
||||||
layout(binding = REQUEST_QUEUE_INDEX, std430) restrict writeonly buffer RequestQueue {
|
|
||||||
uint[] requestQueue;
|
uint[] requestQueue;
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(binding = RENDER_QUEUE_INDEX, std430) restrict writeonly buffer RenderQueue {
|
layout(binding = RENDER_QUEUE_INDEX, std430) restrict buffer RenderQueue {
|
||||||
|
uint renderQueueIndex;
|
||||||
uint[] renderQueue;
|
uint[] renderQueue;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -77,9 +73,9 @@ layout(binding = 2, std430) restrict buffer QueueData {
|
|||||||
void addRequest(inout UnpackedNode node) {
|
void addRequest(inout UnpackedNode node) {
|
||||||
if (!hasRequested(node)) {
|
if (!hasRequested(node)) {
|
||||||
//TODO: maybe try using only 1 variable and it being <0 being bad
|
//TODO: maybe try using only 1 variable and it being <0 being bad
|
||||||
if (atomics.requestQueueIndex < atomics.requestQueueMaxSize) {
|
if (requestQueueIndex < requestQueueMaxSize) {
|
||||||
//Mark node as having a request submitted to prevent duplicate submissions
|
//Mark node as having a request submitted to prevent duplicate submissions
|
||||||
requestQueue[atomicAdd(atomics.requestQueueIndex, 1)] = getId(node);
|
requestQueue[atomicAdd(requestQueueIndex, 1)] = getId(node);
|
||||||
markRequested(node);
|
markRequested(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +86,9 @@ void enqueueChildren(in UnpackedNode node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void enqueueSelfForRender(in UnpackedNode node) {
|
void enqueueSelfForRender(in UnpackedNode node) {
|
||||||
renderQueue[atomicAdd(atomics.renderQueueIndex, 1)] = getMesh(node);
|
if (renderQueueIndex < renderQueueMaxSize) {
|
||||||
|
renderQueue[atomicAdd(renderQueueIndex, 1)] = getMesh(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: need to add an empty mesh, as a parent node might not have anything to render but the children do??
|
//TODO: need to add an empty mesh, as a parent node might not have anything to render but the children do??
|
||||||
|
|||||||
Reference in New Issue
Block a user