Re: [PATCH 3/5] wined3d: Get rid of surface_set_dirty().
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2013-11-25 12:31, schrieb Henri Verbeet:
static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource, const struct wined3d_box *dirty_region) { - surface_set_dirty(surface_from_resource(sub_resource)); + struct wined3d_surface *surface = surface_from_resource(sub_resource); + + surface_load_location(surface, SFLAG_INSYSMEM); + surface_invalidate_location(surface, ~SFLAG_INSYSMEM); } Why not something like
if (surface->flags & SFLAG_INSYSMEM) surface_invalidate_location(surface, ~SFLAG_INSYSMEM); If the surface doesn't have SFLAG_INSYSMEM set already downloading texture / framebuffer data to sysmem and re-uploading it won't do anything. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSk0bMAAoJEN0/YqbEcdMw1rkP/R4WwqON6LvqMeZo1p37QJnA FmSC16ChtjbraQEJU9BkAbFZJCn1U8jiEybeUl3aayf3T5/OL+tk1eAbuUovuHtf LnOgCL8gHxUitao9kwPgM5gO4gwzo4IfT/kHKZ9/gu1FxqvHZGk/5khgXU67mAJ0 pp3SOhWPTbWu23k/ld6CQvp47DcFbEWoSn3n+20npv2OYGvmcUgVumW8EZIHhN8g EFou2wEKVoeEVyaPZzo85Cauv/nwyvwzJgZAgnRj5cokOu0AEpitf8jTqp2mXq6E V0ozMW5X40l6GkmrsVbHYoEhD6l+cX3Mf30b3WttHUrSd2XHDFqUHs8yONK/KxsV 7VT4zsh8vhWSqQFLp3e7ygNiryojHTBy9gC0eC5ahK9bbjkPpvHIrbj9+sHh58rP GXwAsLcxBLS0FofB2tk6zOYMILhRKWX6PhlldvsZVqvIN0mdAR/NTMoOyre7kxGf pCt/o8yXQZY/ujq3ZoKUXSjzFcV2ilhJq1EoiixCXR+X23Ge3s5WDfnPPe8QWeIZ Bl1wfVHtl9PQPL8Q5kb2g9xr572+J+HPLthT1kz73jHZ6VKSE3xN/c0vW3zzdfaJ OZRWfzmPOcAk+RqQUD3Ko2T7j/voLUH9sU3MD4FtPLfKKsOne4OMstt4VIQ/Qe5k tpOd6QkmBeS0Wq4mHywu =MNOz -----END PGP SIGNATURE-----
On 25 November 2013 13:47, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
Why not something like
if (surface->flags & SFLAG_INSYSMEM) surface_invalidate_location(surface, ~SFLAG_INSYSMEM);
If the surface doesn't have SFLAG_INSYSMEM set already downloading texture / framebuffer data to sysmem and re-uploading it won't do anything.
That's probably ok, but I don't think it should necessarily go into this patch.
On 25 November 2013 14:22, Henri Verbeet <hverbeet(a)gmail.com> wrote:
On 25 November 2013 13:47, Stefan Dösinger <stefandoesinger(a)gmail.com> wrote:
Why not something like
if (surface->flags & SFLAG_INSYSMEM) surface_invalidate_location(surface, ~SFLAG_INSYSMEM);
If the surface doesn't have SFLAG_INSYSMEM set already downloading texture / framebuffer data to sysmem and re-uploading it won't do anything.
That's probably ok, but I don't think it should necessarily go into this patch. Actually, would that do that right thing if the application first calls AddDirtyRect(), and then LockRect() with D3DLOCK_DISCARD | D3DLOCK_NO_DIRTY_UPDATE?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2013-11-25 17:16, schrieb Henri Verbeet:
Actually, would that do that right thing if the application first calls AddDirtyRect(), and then LockRect() with D3DLOCK_DISCARD | D3DLOCK_NO_DIRTY_UPDATE? Good question. It obviously needs a test, but I think yes because only SYSMEM and DEFAULT pool surfaces support D3DLOCK_DISCARD, and I expect that D3DLOCK_NO_DIRTY_UPDATE is ignored on DEFAULT pool surfaces and on SYSMEM surfaces it has a different meaning.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSk3tNAAoJEN0/YqbEcdMwCXsQAI2mrkuXMg+yBFl+Qy8dbtxD obA3KQFtF4lQWHL+sMtZfmIxRbyLWLQmULK1qzBNEYaQK0aJpsxkVPFzN4AxpHsq I68IWS3nBGz1I1ZlyOU6E5Q3DWVKVj6eoz06kLiWxoovpbBr6yWjcWzPDVdFG8nC shpaJfhOPieZLUH8vBYgtvc+hoS48rQ4qK+wPq+syuQX6igCEOivUmzzfZWluzI2 luhvYYes9600k/g/pQtWgyE8IL2hFRLRryU86NLgFSf4Jpb9O/EC0zzsdNc0iSFp +jVg8tSSR70cbopbKJ5pjTjC7qbofL3HkPaevovNQsSqaNqfJ9C3cbAhJo7zQhVv xkIwQTEEtcacnNnHyOQCAeGDyKx5HntlRPsDWjWMnnqTA1Ngmq2GGZe+aDcwOJBA b7UjJCqQngAW/ittWMnOOy2xZt0EIvSaCdm4tvTCvqT8+uQjhhTQoedUbUnQe2y3 mz+As2j+nGn8Xlk2PrJwcCBU9aZuk6Y90yVu2D16rZFXgIY9aauw6LgLXMpeEskO V4a3ps76JqeIKUjakX2rSsddYXdLS7AjZ/Fg5KH0QJ46JjjPThHieC4pxCHDU5ur FTEJT7bHhCczfUcckm3lMiI86jCYIeMFVyLEq4TDLsG+s5Ty4VRjoI7lgsgI5nA9 J6knIEteY0TDtrgODfUf =WSHe -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2013-11-25 17:31, schrieb Stefan Dösinger:
Am 2013-11-25 17:16, schrieb Henri Verbeet:
Actually, would that do that right thing if the application first calls AddDirtyRect(), and then LockRect() with D3DLOCK_DISCARD | D3DLOCK_NO_DIRTY_UPDATE? Good question. It obviously needs a test, but I think yes because only SYSMEM and DEFAULT pool surfaces support D3DLOCK_DISCARD, and I expect that D3DLOCK_NO_DIRTY_UPDATE is ignored on DEFAULT pool surfaces and on SYSMEM surfaces it has a different meaning. That said, I don't think you even need D3DLOCK_DISCARD here. AddDirtyRect on a managed texture followed by a D3DLOCK_NO_DIRTY_UPDATE map is enough to cause trouble for my proposal.
I still recommend a test. Native d3d9 may ignore AddDirtyRect in this case for a similar reason. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJSk30xAAoJEN0/YqbEcdMwGlIP/2w8MZNzxUCtG3pqLjQasXie Rk8NqYYRKcJIJZRudZnu6b7Tdxpj4yKnYyp93rSsUBQY1xV76ePCZs0puePOfkdc T9TwV8Rn5jp2Y2IX1xMSQeqoFSyZUPhZ1vr+289CZ2Mp04cofhTuTc2trqmhbciH j5XJFjt6yYvoldh77h7mrtRMXic5iKe9SmQRvV6zfzY3NNMFMuWLVVwxQvcu+ulr jFydDi4HU6kF/pv4OOLVDsjy24DeDV3kL0G0XREN6ixWs41Fci7y09B8amUBne92 zmiARdzAUZ7ZvOq+pPmADrAEmZQy7uwWd4vKD/49UhDVpTRPrYhfjNw9Y+NdfGuX zOPfMXXjGwV7cv1cGH2AKMj8FNJSU0OgoINlpnB3b/VmOTuheXzgL4HIm7pr3AK2 HeK/hGWrDjAS7BG/7CsCi5CW/lsXbeanh0zNZA/1AhKMQp3w0HM9AZp5/Ty8XFaM BWPEqb8TseimVl4DH/mrHoKNptMuvpr/hTG82yVAaSEzshbRXEeeMXDp55RjACGJ 7Ux5DRf19aDj1GNl1lTlMO5X0HqjSY5cqn9zdAqk1fajt7qTPT4ux4A0Xqe7riXa YBylEEQPl8gZCFPf1uVA1F5YP5KeL7VrG/VpBX+7dGMCBT+Z4jjGWF6/Fg+VHwtO SljmdECQV+XsEOYcu6L7 =rgSe -----END PGP SIGNATURE-----
participants (2)
-
Henri Verbeet -
Stefan Dösinger