-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-09-17 15:05, schrieb Henri Verbeet:
I was mostly thinking of merging e.g. wined3d_surface_get_pitch() and wined3d_volume_get_pitch() into wined3d_resource_get_pitch(). I don't feel strongly about doing that first though, so if you're saying you'll get to that eventually that's ok.
The rough plan is to make load_location, validate_location and invalidate_location generic for all resources, with a resource-type specific callback for load_location. resource_map will load or validate LOCATION_SYSMEM, LOCATION_BUFFER, LOCATION_USERPTR or LOCATION_DIB, map the GL buffer and calculate the correct offset.
It will need some information about the error checking behavior, e.g. if nested maps are allowed. A field is needed to specify the correct map memory (sysmem, buffer, user-specified memory, dib section).
The resource can flush the correct memory ranges in the BO, but loading the GL texture or renderbuffer has to be handled by surfaces and volumes.
With the CS, the resource code will also handle swapping the sysmem pointer and buffers in case of DISCARD maps.