[PATCH 5/5] wined3d: Implement basic volume location management

Stefan Dösinger stefan at codeweavers.com
Thu Aug 22 02:58:11 CDT 2013


-----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 at 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.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSFcSTAAoJEN0/YqbEcdMwx/0P/361Sz0YfrOKDwjtex5mddmf
L4IVlDb+a3U+Qwg1H7ecEMTaYAdxSy2WEsUn9MSZU6co24ZZcylSWG1ptaOJ63t+
QYVbsjtEGeLbEimUmywvjCfRxsvVbUBex48+Mc5yx20dNywbpJLuX2OfCUBOfpOH
Oh1AjmBmsKpEP4f06AAlUnEvKq7NmNO5ieTrklYehPUQAU8Fn94h5TgteEpoLJeW
N90nV0GoIrJi9S2O76MvVG7OkTZn2kqaUO74TyJUqz/IDRJrYsqtftcjHgibR3OX
jwPZu8BClCS523VWQppIfsQj2O6Q0k95VXGRMfHqasdBz79SRG4Ix7lDaSoqFb6B
r/tS8iA6ppTeWxWfhJYC81griA5RSWTWpUXuD76Bl6qBjpnX+kDFQNqV+5ls+1UB
IercXePRE964TtZO+Liihv2ygWiKPC9K0HLH/P7bC3znoqgVT2fyRLOdHPAAnnY9
w2PWqtb4sjSnisMsL6+6s3Q/FdKU6/fmS85Zau5AreNs3wX7UZgOZSA2wstBKknW
bjgAz+pFwkQWgeS2KkDC5Uv8SjAew+Ed8fU7LQl551Hwj+JY77cHBiPGaLrKOuO6
t3dN6Q6kLbz4qmW8ZWZeCQIk3V7c2fFsLdTQDc+CcVUzPe/kxXKf1A8+jt3N4LBy
j7dOZKslfvnvUUDh1zYo
=TKW/
-----END PGP SIGNATURE-----



More information about the wine-devel mailing list