MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / perform0

Method perform0

src/main/java/field/graphics/FBO.java:578–612  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

576 Log.log("graphics.trace", () -> "binding FBO to texture unit " + specification.unit);
577 State s = GraphicsContext.get(this);
578
579// if (s.text.length!=1)
580// System.out.println(" multilayer "+s.text.length);
581
582 for (int i = 0; i < s.text.length; i++) {
583 if (specification.layers == 1) {
584 glActiveTexture(GL_TEXTURE0 + specification.unit + i);
585 if (specification.multisample_raw)
586 glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, s.text[i]);
587 else glBindTexture(GL_TEXTURE_2D, s.text[i]);
588
589 if (mipGeneration != updateGeneration /*|| updateGeneration<5*/) // ?
590 {
591// System.out.println(" -- gen mip --"+" "+specification.width+" / "+specification.height+" / "+i+" "+this+" "+System.identityHashCode(this));
592 glGenerateMipmap(GL_TEXTURE_2D);
593 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
594 }
595
596 } else {
597 glActiveTexture(GL_TEXTURE0 + specification.unit + i);
598 if (specification.multisample_raw)
599 glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, s.text[i]);
600 else glBindTexture(GL_TEXTURE_2D_ARRAY, s.text[i]);
601
602 }
603 }
604 mipGeneration = updateGeneration;
605 return true;
606 }
607
608 @Override
609 public int[] getPasses() {
610 return new int[]{-1, 1};
611 }
612
613 public void deallocate(State s) {
614 glDeleteFramebuffers(s.name);
615 if (s.multisample != -1) glDeleteFramebuffers(s.multisample);

Callers

nothing calls this directly

Calls 4

logMethod · 0.95
getMethod · 0.95
glBindTextureMethod · 0.80
glTexParameteriMethod · 0.80

Tested by

no test coverage detected