| 48 | } |
| 49 | |
| 50 | void ClearColorLayer(const glm::vec4& rgba, const size_t colorIndex, const int layer) { |
| 51 | if (colorAttachments_.size() < colorIndex) { |
| 52 | throw std::runtime_error("Color index exceeds maximum total bound color buffers"); |
| 53 | } |
| 54 | |
| 55 | // TODO: There is a much better way to do this |
| 56 | // See https://registry.khronos.org/OpenGL-Refpages/gl4/html/glFramebufferTextureLayer.xhtml |
| 57 | // Followed by a regular glClear of the color attachment |
| 58 | Texture& color = colorAttachments_[colorIndex]; |
| 59 | color.ClearLayer(0, layer, (const void *)&rgba[0]); |
| 60 | } |
| 61 | |
| 62 | void ClearDepthStencilLayer(const int layer) { |
| 63 | if (depthStencilAttachment_ == Texture()) { |
nothing calls this directly
no test coverage detected