This commit is contained in:
mcrcortex
2024-09-23 22:48:47 +10:00
parent 27ed49fcd9
commit f9a8f9b1c2
4 changed files with 10 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ public class RenderService<T extends AbstractSectionRenderer<J, ?>, J extends Vi
//Max sections: ~500k
//Max geometry: 1 gb
this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<19, (1L<<31)-1024);
this.sectionRenderer = (T) createSectionRenderer(this.modelService.getStore(),1<<19, (1L<<30)-1024);
//Do something incredibly hacky, we dont need to keep the reference to this around, so just connect and discard
var router = new SectionUpdateRouter();

View File

@@ -65,8 +65,12 @@ public class RenderGenerationService {
private void processJob(RenderDataFactory factory) {
BuildTask task;
synchronized (this.taskQueue) {
if (Math.random() < 0.5) {
task = this.taskQueue.removeLast();
} else {
task = this.taskQueue.removeFirst();
}
}
//long time = BuiltSection.getTime();
var section = task.sectionSupplier.get();
if (section == null) {
@@ -150,6 +154,6 @@ public class RenderGenerationService {
}
public void addDebugData(List<String> debug) {
debug.add("RMQ: " + this.taskQueue.size());//render mesh queue
debug.add("RSSQ: " + this.taskQueue.size());//render section service queue
}
}

View File

@@ -61,6 +61,7 @@ public class HierarchicalOcclusionTraverser {
.defineIf("DEBUG", Voxy.SHADER_DEBUG)
.define("MAX_ITERATIONS", MAX_ITERATIONS)
.define("LOCAL_SIZE_BITS", LOCAL_WORK_SIZE_BITS)
.define("REQUEST_QUEUE_SIZE", NodeManager.REQUEST_QUEUE_SIZE)
.define("HIZ_BINDING", 0)
@@ -112,7 +113,6 @@ public class HierarchicalOcclusionTraverser {
MemoryUtil.memPutInt(ptr, viewport.height); ptr += 4;
MemoryUtil.memPutInt(ptr, NodeManager.REQUEST_QUEUE_SIZE); ptr += 4;//TODO maybe these to a #define
MemoryUtil.memPutInt(ptr, (int) (this.renderList.size()/4-1)); ptr += 4;
//Screen space size for descending

View File

@@ -11,7 +11,6 @@ layout(binding = SCENE_UNIFORM_BINDING, std140) uniform SceneUniform {
uint screenW;
vec3 camSubSecPos;
uint screenH;
uint requestQueueMaxSize;
uint renderQueueMaxSize;
float minSSS;
};
@@ -26,9 +25,9 @@ SIMPLE_QUEUE(uint, renderQueue, RENDER_QUEUE_BINDING);
void addRequest(inout UnpackedNode node) {
printf("Put node decend request");
if (!hasRequested(node)) {
if (requestQueueIndex.x < requestQueueMaxSize) {
if (requestQueueIndex.x < REQUEST_QUEUE_SIZE) {
uint atomRes = atomicAdd(requestQueueIndex.x, 1);
if (atomRes < requestQueueMaxSize) {
if (atomRes < REQUEST_QUEUE_SIZE) {
//Mark node as having a request submitted to prevent duplicate submissions
requestQueue[atomRes] = getRawPos(node);
markRequested(node);