diff options
| author | 2017-09-16 04:30:35 +0100 | |
|---|---|---|
| committer | 2017-09-17 11:57:06 +0100 | |
| commit | 6a110ac5f55502aa1330cc4dd09d11a4eb502e1b (patch) | |
| tree | 89fd804e03ab5507fac6d7a12f723efcb055e635 /src | |
| parent | Merge pull request #2906 from Subv/ns_new_framework (diff) | |
| download | yuzu-6a110ac5f55502aa1330cc4dd09d11a4eb502e1b.tar.gz yuzu-6a110ac5f55502aa1330cc4dd09d11a4eb502e1b.tar.xz yuzu-6a110ac5f55502aa1330cc4dd09d11a4eb502e1b.zip | |
Fixed framebuffer warning
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 7b0cd1b66..7e09e4712 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -237,13 +237,24 @@ void RasterizerOpenGL::DrawTriangles() { | |||
| 237 | 237 | ||
| 238 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, | 238 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, |
| 239 | color_surface != nullptr ? color_surface->texture.handle : 0, 0); | 239 | color_surface != nullptr ? color_surface->texture.handle : 0, 0); |
| 240 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, | 240 | if (depth_surface != nullptr) { |
| 241 | depth_surface != nullptr ? depth_surface->texture.handle : 0, 0); | 241 | if (regs.framebuffer.framebuffer.depth_format == |
| 242 | bool has_stencil = | 242 | Pica::FramebufferRegs::DepthFormat::D24S8) { |
| 243 | regs.framebuffer.framebuffer.depth_format == Pica::FramebufferRegs::DepthFormat::D24S8; | 243 | // attach both depth and stencil |
| 244 | glFramebufferTexture2D( | 244 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, |
| 245 | GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, | 245 | depth_surface->texture.handle, 0); |
| 246 | (has_stencil && depth_surface != nullptr) ? depth_surface->texture.handle : 0, 0); | 246 | } else { |
| 247 | // attach depth | ||
| 248 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, | ||
| 249 | depth_surface->texture.handle, 0); | ||
| 250 | // clear stencil attachment | ||
| 251 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); | ||
| 252 | } | ||
| 253 | } else { | ||
| 254 | // clear both depth and stencil attachment | ||
| 255 | glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, | ||
| 256 | 0); | ||
| 257 | } | ||
| 247 | 258 | ||
| 248 | // Sync the viewport | 259 | // Sync the viewport |
| 249 | // These registers hold half-width and half-height, so must be multiplied by 2 | 260 | // These registers hold half-width and half-height, so must be multiplied by 2 |