-
Notifications
You must be signed in to change notification settings - Fork 994
Using "viewport" texture in shaders does not work for multisample levels > 1 #2232
Comments
This seems to be an oversight in Graphics::ResolveToTexture(Texture2D* destination, const IntRect& viewport) .. basically, resolving backbuffer to a texture. If the texture is multisampled and has autoresolve on, it should be marked "resolve dirty" so that it will be resolved to non-MS the next time before being sampled by a shader. The following code needs to be inserted into the function (all API versions) to fix. Oddly, OpenGL appeared to work for me without.
|
@cadaver I tried the fix that you suggested and it did not work. I tried adding the line both at function entry point and exit point, and it didn't make a difference. I only tried for DX11 on an Intel chipset. |
You're right. It does work on D3D9, but on D3D11 there's something further missing, probably the backbuffer is not being copied right to a multisampled texture. In which case your fix is OK too, and likely better for performance. |
My fix was not based on knowledge of what needs to be done, but rather on reverting the change for that particular case. Right now I don't know enough about that portion of code to come up with a robust fix, but this temporary solution seems to work OK for my application until a proper fix is developed. |
I suspect this may have worked with older drivers (because a black screen in the post-process sample should have been noticeable); however on OpenGL it seems to have always worked, ie. the multisample contents seem to be transported almost "magically" to the texture being sampled. Will submit a PR which essentially reverts the change. |
Steps to reproduce:
Notes:
The text was updated successfully, but these errors were encountered: