mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
renderer_gl: Implement semi proper clears
This commit is contained in:
parent
50bcf3b617
commit
c6c71bb9b2
4 changed files with 71 additions and 40 deletions
|
@ -86,6 +86,7 @@ struct DepthBuffer {
|
|||
Interval<u32> range;
|
||||
// OpenGL texture used for storing depth/stencil
|
||||
OpenGL::Texture texture;
|
||||
OpenGL::Framebuffer fbo;
|
||||
|
||||
DepthBuffer() : valid(false) {}
|
||||
|
||||
|
@ -127,6 +128,11 @@ struct DepthBuffer {
|
|||
texture.setMagFilter(OpenGL::Nearest);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, prevTexture);
|
||||
|
||||
fbo.createWithDrawTexture(texture, fmt == GL_DEPTH_STENCIL ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT);
|
||||
|
||||
if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
|
||||
Helpers::panic("Incomplete framebuffer");
|
||||
}
|
||||
|
||||
void free() {
|
||||
|
@ -144,4 +150,4 @@ struct DepthBuffer {
|
|||
size_t sizeInBytes() {
|
||||
return (size_t)size.x() * (size_t)size.y() * PICA::sizePerPixel(format);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue