On 16 May 2015 at 15:29, Stefan Dösinger stefan@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.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2015-05-19 um 12:28 schrieb Henri Verbeet:
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.
I ran into issues without this on some driver (probably r200) and decided to copy the detaching from the post pixel shader blend code. It might have been due to a different bug, possibly in the driver. I'll check.