On 16 May 2015 at 15:29, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
+static void delete_fbo_attachment(const struct wined3d_gl_info *gl_info, + enum wined3d_gl_resource_type d3d_type) +{ + switch (d3d_type) + { + case WINED3D_GL_RES_TYPE_TEX_1D: + gl_info->fbo_ops.glFramebufferTexture1D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_1D, 0, 0); + break; + + case WINED3D_GL_RES_TYPE_TEX_2D: + case WINED3D_GL_RES_TYPE_TEX_RECT: + gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + wined3d_gl_type_to_enum(d3d_type), 0, 0); + break; + + case WINED3D_GL_RES_TYPE_TEX_3D: + gl_info->fbo_ops.glFramebufferTexture3D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_3D, 0, 0, 0); + break; + + case WINED3D_GL_RES_TYPE_TEX_CUBE: + gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, 0, 0); + break; + + case WINED3D_GL_RES_TYPE_BUFFER: + case WINED3D_GL_RES_TYPE_COUNT: + break; + } +} + This is kind of pointless. Any of the FramebufferTexture*() calls with a 0 texture will detach the current attachment. You shouldn't need to detach the current attachment before attaching a new one either, but I suppose the existing code already does that.