Fixed intel
This commit is contained in:
@@ -5,6 +5,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||||||
import me.cortex.voxy.client.core.gl.GlBuffer;
|
import me.cortex.voxy.client.core.gl.GlBuffer;
|
||||||
import me.cortex.voxy.client.core.gl.shader.Shader;
|
import me.cortex.voxy.client.core.gl.shader.Shader;
|
||||||
import me.cortex.voxy.client.core.gl.shader.ShaderType;
|
import me.cortex.voxy.client.core.gl.shader.ShaderType;
|
||||||
|
import me.cortex.voxy.client.core.rendering.util.DownloadStream;
|
||||||
import me.cortex.voxy.client.core.rendering.util.UploadStream;
|
import me.cortex.voxy.client.core.rendering.util.UploadStream;
|
||||||
import me.cortex.voxy.client.mixin.joml.AccessFrustumIntersection;
|
import me.cortex.voxy.client.mixin.joml.AccessFrustumIntersection;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
@@ -145,9 +146,19 @@ public class Gl46FarWorldRenderer extends AbstractFarWorldRenderer {
|
|||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
//glPointSize(10);
|
//glPointSize(10);
|
||||||
glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_SHORT, 0, 0, (int) (this.geometry.getSectionCount()*4.4), 0);
|
glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_SHORT, 0, 0, (int) (this.geometry.getSectionCount()*4.4), 0);
|
||||||
//glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, 0, (int) (this.geometry.getSectionCount()*4.4), 0);
|
//glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, 0, 100, 0);
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
glFinish();
|
||||||
|
DownloadStream.INSTANCE.download(this.glCommandCountBuffer, 0, 4, (ptr, siz) -> {
|
||||||
|
int cnt = MemoryUtil.memGetInt(ptr);
|
||||||
|
System.out.println(cnt);
|
||||||
|
});
|
||||||
|
DownloadStream.INSTANCE.commit();
|
||||||
|
DownloadStream.INSTANCE.tick();
|
||||||
|
*/
|
||||||
|
|
||||||
glMemoryBarrier(GL_PIXEL_BUFFER_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT);
|
glMemoryBarrier(GL_PIXEL_BUFFER_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT);
|
||||||
|
|
||||||
this.cullShader.bind();
|
this.cullShader.bind();
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class DownloadStream {
|
|||||||
public void commit() {
|
public void commit() {
|
||||||
//Copies all the data from target buffers into the download stream
|
//Copies all the data from target buffers into the download stream
|
||||||
for (var entry : this.downloadList) {
|
for (var entry : this.downloadList) {
|
||||||
glCopyNamedBufferSubData(entry.target.id, this.downloadBuffer.id, entry.downloadOffset, entry.targetOffset, entry.size);
|
glCopyNamedBufferSubData(entry.target.id, this.downloadBuffer.id, entry.targetOffset, entry.downloadStreamOffset, entry.size);
|
||||||
}
|
}
|
||||||
thisFrameDownloadList.addAll(this.downloadList);
|
thisFrameDownloadList.addAll(this.downloadList);
|
||||||
this.downloadList.clear();
|
this.downloadList.clear();
|
||||||
@@ -110,7 +110,7 @@ public class DownloadStream {
|
|||||||
|
|
||||||
//Apply all the callbacks
|
//Apply all the callbacks
|
||||||
for (var data : frame.data) {
|
for (var data : frame.data) {
|
||||||
data.resultConsumer.consume(this.downloadBuffer.addr() + data.downloadOffset, data.size);
|
data.resultConsumer.consume(this.downloadBuffer.addr() + data.downloadStreamOffset, data.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
frame.allocations.forEach(this.allocationArena::free);
|
frame.allocations.forEach(this.allocationArena::free);
|
||||||
@@ -119,7 +119,7 @@ public class DownloadStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private record DownloadFrame(GlFence fence, LongArrayList allocations, ArrayList<DownloadData> data) {}
|
private record DownloadFrame(GlFence fence, LongArrayList allocations, ArrayList<DownloadData> data) {}
|
||||||
private record DownloadData(GlBuffer target, long downloadOffset, long targetOffset, long size, DownloadResultConsumer resultConsumer) {}
|
private record DownloadData(GlBuffer target, long downloadStreamOffset, long targetOffset, long size, DownloadResultConsumer resultConsumer) {}
|
||||||
|
|
||||||
|
|
||||||
// Global download stream
|
// Global download stream
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#version 450
|
#version 450
|
||||||
#extension GL_ARB_gpu_shader_int64 : enable
|
#extension GL_ARB_gpu_shader_int64 : enable
|
||||||
|
|
||||||
layout(local_size_x = 128, local_size_y = 1, local_size_x = 1) in;
|
layout(local_size_x = 128) in;
|
||||||
|
|
||||||
#import <voxy:lod/gl46/quad_format.glsl>
|
#import <voxy:lod/gl46/quad_format.glsl>
|
||||||
#import <voxy:lod/gl46/bindings.glsl>
|
#import <voxy:lod/gl46/bindings.glsl>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#version 450
|
#version 450
|
||||||
layout(local_size_x = 32, local_size_y = 32, local_size_x = 1) in;
|
layout(local_size_x = 32, local_size_y = 32) in;
|
||||||
|
|
||||||
|
|
||||||
layout(binding = 0, rgba8) uniform restrict image2D colourTex;
|
layout(binding = 0, rgba8) uniform restrict image2D colourTex;
|
||||||
|
|||||||
Reference in New Issue
Block a user