Module: wine Branch: master Commit: eec2c634a6ba9f605dcfb4dab0b80e975bdde25c URL: http://source.winehq.org/git/wine.git/?a=commit;h=eec2c634a6ba9f605dcfb4dab0...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Aug 25 21:05:01 2011 +0200
wined3d: Introduce a separate function for attaching depth / stencil renderbuffers.
---
dlls/wined3d/context.c | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index b4788bd..a5f5861 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -111,6 +111,22 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo) checkGLcall("glDeleteFramebuffers()"); }
+static void context_attach_depth_stencil_rb(const struct wined3d_gl_info *gl_info, + GLenum fbo_target, DWORD format_flags, GLuint rb) +{ + if (format_flags & WINED3DFMT_FLAG_DEPTH) + { + gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rb); + checkGLcall("glFramebufferRenderbuffer()"); + } + + if (format_flags & WINED3DFMT_FLAG_STENCIL) + { + gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rb); + checkGLcall("glFramebufferRenderbuffer()"); + } +} + /* GL locking is done by the caller */ static void context_attach_depth_stencil_fbo(struct wined3d_context *context, GLenum fbo_target, struct wined3d_surface *depth_stencil, DWORD location) @@ -125,19 +141,8 @@ static void context_attach_depth_stencil_fbo(struct wined3d_context *context,
if (depth_stencil->current_renderbuffer) { - if (format_flags & WINED3DFMT_FLAG_DEPTH) - { - gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_DEPTH_ATTACHMENT, - GL_RENDERBUFFER, depth_stencil->current_renderbuffer->id); - checkGLcall("glFramebufferRenderbuffer()"); - } - - if (format_flags & WINED3DFMT_FLAG_STENCIL) - { - gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_STENCIL_ATTACHMENT, - GL_RENDERBUFFER, depth_stencil->current_renderbuffer->id); - checkGLcall("glFramebufferRenderbuffer()"); - } + context_attach_depth_stencil_rb(gl_info, fbo_target, + format_flags, depth_stencil->current_renderbuffer->id); } else {