Created attachment 119247 [details] patch to allow RGBA->RGB multi-sampled resolves When doing a glBlitFramebuffer from an RGBA multisampled texture to a regular RGB texture mesa gives GL_INVALID_OPERATION "(bad src/dst multisample pixel formats)". With the attached patch the operation works fine on a Radeon HD6850 and Intel Core i7-4770R, which hints that the drivers already support it. This issue breaks MSAA in "X Rebirth", both nvidia and amd proprietary drivers support this kind of resolve. We have a clean error log (using debug_output) so afaik we're doing everything correctly.
It looks like in GL 4.4 they have completely removed the restriction that MSAA resolve blits need to have the same format. In the section entitled “Changes in the released Specification of July 22, 2013” it says: “Relax BlitFramebuffer in section 18.3.1 so that format conversion can take place during multisample blits, since drivers already allow this and some apps depend on it.” Maybe we should just entirely remove the restriction in Mesa too. On the Intel driver the multisample resolve is implemented as a shader so I don't think allowing all format conversions would cause any problems.
(In reply to Neil Roberts from comment #1) > It looks like in GL 4.4 they have completely removed the restriction that > MSAA resolve blits need to have the same format. In the section entitled > “Changes in the released Specification of July 22, 2013” it says: > > “Relax BlitFramebuffer in section 18.3.1 so that format conversion can take > place during multisample blits, since drivers already allow this and some > apps depend on it.” Often we take changes like this as, basically, spec bug fixes that should apply to older versions as well. Since other drivers allow this and later specs allow it, we should too. > Maybe we should just entirely remove the restriction in Mesa too. On the > Intel driver the multisample resolve is implemented as a shader so I don't > think allowing all format conversions would cause any problems.
The biggest task will be updating existing piglit tests and adding new ones.
It looks like there is only one test in Piglit that attempts this. I've made a patch to make it expect the new behaviour here: http://patchwork.freedesktop.org/patch/63670/ I also made a patch to completely remove the format restriction in Mesa here: http://patchwork.freedesktop.org/patch/63672/ Surprisingly this exposed a bug on HSW so it needs an additional patch which I also posted. As this patch removes the restriction for all drivers I guess we would need testing on the other drivers as well before being confident we can land it.
Is there any reason this is not getting merged? Is there any way to help getting it merged? It would be great to fix the aforementioned bugs before an 11.1 release.
(In reply to EoD from comment #5) I think we would need some of the nouveau and radeon people to test the Piglit test on their drivers with the patch in order to ensure that it also works there before landing it. If you are able to test both patches on your Radeon card I think that would be a big help. We'd also need to merge the fix for i965 but that already has some review thanks to Ben Widawsky so I'm hoping to land it later today.
OpenGL renderer string: Gallium 0.4 on AMD BARTS (DRM 2.43.0, LLVM 3.7.0) OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.1.0-devel (git-0cfc130) After applying both patches, the patched piglit test passes just fine: http://patchwork.freedesktop.org/patch/63670/ http://patchwork.freedesktop.org/patch/63672/ PIGLIT: {"result": "pass" }
I've pushed the two patches to master. http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c7c9e4602b6ff72eb2ef41 http://cgit.freedesktop.org/piglit/commit/?id=511254db5e3fa8fa104bc7bed9
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.