On 17 September 2013 11:39, Stefan Dösinger stefan@codeweavers.com wrote:
dlls/wined3d/volume.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 7 deletions(-)
Can't most of this be done on the resource level instead?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-09-17 13:55, schrieb Henri Verbeet:
On 17 September 2013 11:39, Stefan Dösinger stefan@codeweavers.com wrote:
--- dlls/wined3d/volume.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 7 deletions(-)
Can't most of this be done on the resource level instead?
Yes, but I'd prefer to migrate surfaces and buffers to the new location flags and clean up VBO/PBO handling before merging the map implementations. I also think it's better to have the tests in place without lots of todos before such a restructuring.
Error checking is a fairly minor detail in this in my opinion. The more interesting part is MAP_DISCARD handling, especially with regard to the command stream.
I have the surface cleanup partially done, buffers are still on the todo list.
On 17 September 2013 14:58, Stefan Dösinger stefan@codeweavers.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-09-17 13:55, schrieb Henri Verbeet:
On 17 September 2013 11:39, Stefan Dösinger stefan@codeweavers.com wrote:
--- dlls/wined3d/volume.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 88 insertions(+), 7 deletions(-)
Can't most of this be done on the resource level instead?
Yes, but I'd prefer to migrate surfaces and buffers to the new location flags and clean up VBO/PBO handling before merging the map implementations. I also think it's better to have the tests in place without lots of todos before such a restructuring.
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.
-----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.