()
| 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); |
nothing calls this directly
no test coverage detected