-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-08-22 09:11, schrieb Henri Verbeet:
On 22 August 2013 00:30, Stefan Dösinger stefan@codeweavers.com wrote:
+const char *wined3d_debug_location(DWORD location) +{ + char buf[238];
That number looks a bit arbitrary, although I suppose it's at least large enough.
It's taken from one of the other debug functions, so yeah, it is arbitrary. The amount of location flags will grow with future patches.
- if (volume->resource.pool == WINED3D_POOL_SYSTEM_MEM +
|| volume->resource.pool == WINED3D_POOL_SCRATCH) + { + if (location & ~WINED3D_LOCATION_SYSMEM) + { + ERR("Trying to load a sysmem or scratch volume into %s.\n", + wined3d_debug_location(location)); + return; + } + }
In principle we have resource_access_from_location() and the access_flags field in struct wined3d_resource for this.
I didn't know about that, I'll change this check and the mappable check to use resource.access_flags. I can't reuse resource_access_from_location until surfaces are migrated to the new location flags though.
What I'm not quite happy with is WINED3D_RESOURCE_ACCESS_SCRATCH. Scratch resources are mappable. Having the extra location just complicates things and I see no gain from it.
Surfaces are much more difficult, fixing volumes is just the warm-up :-. The rough plan for surfaces is to enforce mapping restrictions in the external API, but ignore them internally, so we can do things like update_surface on a non-dynamic default pool surface surface with a converted or color keyed format. Maybe staging memory can work for surface-to-surface copies of converted surfaces.
- if (count_bits(location) > 1) + FIXME("Implement
loading two locations with one call\n"); +
I don't think we really want that.
You mean just drop those two lines?
I'm a bit unhappy with the "persistent" flag to surface_modify_location(), and this is essentially the same thing. I think it would be better to just have two separate functions, wined3d_volume_invalidate_location() and wined3d_volume_validate_location(). Perhaps wined3d_volume_update_location() can work too, but in that case I think it should take two location masks, one to set and one to clear.
Ok.