-----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.
On 25 November 2013 13:47, Stefan Dösinger stefandoesinger@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@gmail.com wrote:
On 25 November 2013 13:47, Stefan Dösinger stefandoesinger@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 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.