Micro optimization
This commit is contained in:
@@ -146,9 +146,9 @@ 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, 100, 0);
|
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
glFinish();
|
glFinish();
|
||||||
DownloadStream.INSTANCE.download(this.glCommandCountBuffer, 0, 4, (ptr, siz) -> {
|
DownloadStream.INSTANCE.download(this.glCommandCountBuffer, 0, 4, (ptr, siz) -> {
|
||||||
@@ -159,6 +159,7 @@ public class Gl46FarWorldRenderer extends AbstractFarWorldRenderer {
|
|||||||
DownloadStream.INSTANCE.tick();
|
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();
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ void main() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TODO:FIXME: Figure out why these are in such a weird order
|
|
||||||
uint msk = 0;
|
uint msk = 0;
|
||||||
msk |= uint(((meta.cntB &0xFFFF)!=0) && (relative.y>-1))<<0;
|
msk |= uint(((meta.cntB &0xFFFF)!=0) && (relative.y>-1))<<0;
|
||||||
msk |= uint((((meta.cntB>>16)&0xFFFF)!=0) && (relative.y<1 ))<<1;
|
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 &0xFFFF)!=0) && (relative.x>-1))<<4;
|
||||||
msk |= uint((((meta.cntD>>16)&0xFFFF)!=0) && (relative.x<1 ))<<5;
|
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;
|
uint count = 0;
|
||||||
@@ -95,7 +96,9 @@ void main() {
|
|||||||
|
|
||||||
//Double sided quads
|
//Double sided quads
|
||||||
count = (meta.cntA>>16)&0xFFFF;
|
count = (meta.cntA>>16)&0xFFFF;
|
||||||
|
if (count != 0) {
|
||||||
writeCmd(cmdPtr++, encodedPos, ptr, count);
|
writeCmd(cmdPtr++, encodedPos, ptr, count);
|
||||||
|
}
|
||||||
ptr += count;
|
ptr += count;
|
||||||
|
|
||||||
//Down
|
//Down
|
||||||
|
|||||||
Reference in New Issue
Block a user