Micro optimization
This commit is contained in:
@@ -146,9 +146,9 @@ public class Gl46FarWorldRenderer extends AbstractFarWorldRenderer {
|
||||
glDisable(GL_CULL_FACE);
|
||||
//glPointSize(10);
|
||||
glMultiDrawElementsIndirectCountARB(GL_TRIANGLES, GL_UNSIGNED_SHORT, 0, 0, (int) (this.geometry.getSectionCount()*4.4), 0);
|
||||
//glMultiDrawElementsIndirect(GL_TRIANGLES, GL_UNSIGNED_SHORT, 0, 100, 0);
|
||||
glEnable(GL_CULL_FACE);
|
||||
|
||||
|
||||
/*
|
||||
glFinish();
|
||||
DownloadStream.INSTANCE.download(this.glCommandCountBuffer, 0, 4, (ptr, siz) -> {
|
||||
@@ -159,6 +159,7 @@ public class Gl46FarWorldRenderer extends AbstractFarWorldRenderer {
|
||||
DownloadStream.INSTANCE.tick();
|
||||
*/
|
||||
|
||||
|
||||
glMemoryBarrier(GL_PIXEL_BUFFER_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT);
|
||||
|
||||
this.cullShader.bind();
|
||||
|
||||
@@ -71,7 +71,6 @@ void main() {
|
||||
|
||||
|
||||
|
||||
//TODO:FIXME: Figure out why these are in such a weird order
|
||||
uint msk = 0;
|
||||
msk |= uint(((meta.cntB &0xFFFF)!=0) && (relative.y>-1))<<0;
|
||||
msk |= uint((((meta.cntB>>16)&0xFFFF)!=0) && (relative.y<1 ))<<1;
|
||||
@@ -80,8 +79,10 @@ void main() {
|
||||
msk |= uint(((meta.cntD &0xFFFF)!=0) && (relative.x>-1))<<4;
|
||||
msk |= uint((((meta.cntD>>16)&0xFFFF)!=0) && (relative.x<1 ))<<5;
|
||||
|
||||
msk |= uint(((meta.cntA>>16)&0xFFFF)!=0)<<6;
|
||||
|
||||
uint cmdPtr = atomicAdd(opaqueDrawCount, bitCount(msk)+1);
|
||||
|
||||
uint cmdPtr = atomicAdd(opaqueDrawCount, bitCount(msk));
|
||||
|
||||
|
||||
uint count = 0;
|
||||
@@ -95,7 +96,9 @@ void main() {
|
||||
|
||||
//Double sided quads
|
||||
count = (meta.cntA>>16)&0xFFFF;
|
||||
writeCmd(cmdPtr++, encodedPos, ptr, count);
|
||||
if (count != 0) {
|
||||
writeCmd(cmdPtr++, encodedPos, ptr, count);
|
||||
}
|
||||
ptr += count;
|
||||
|
||||
//Down
|
||||
|
||||
Reference in New Issue
Block a user