On 22 October 2015 at 12:01, Riccardo Bortolato rikyz619@gmail.com wrote:
enabled previously failing test in device.c removed wined3d_device_update_surface from wined3d and replaced its usage with surface_upload_from_surface.
This was mentioned in the discussion in the other thread, but just for the record, the options are either wined3d_device_update_sub_resource() or wined3d_device_copy_sub_resource_region().
OK, but since I could not find a definite answer I tried another road.
I assume you don't even want to look at it but use those methods instead.
Ciao, Riccardo
2015-10-27 15:40 GMT+01:00 Henri Verbeet hverbeet@gmail.com:
On 22 October 2015 at 12:01, Riccardo Bortolato rikyz619@gmail.com wrote:
enabled previously failing test in device.c removed wined3d_device_update_surface from wined3d and replaced its usage with surface_upload_from_surface.
This was mentioned in the discussion in the other thread, but just for the record, the options are either wined3d_device_update_sub_resource() or wined3d_device_copy_sub_resource_region().
Why wined3d_device_copy_sub_resource_region() isn't implemented for WINED3D_RTYPE_CUBE_TEXTURE?
This seems the easiest option to me (if we exclude the already available one) but it looks like I'm having an issue with them: the destination surface is smaller than the source one.
I'm doing something like
+ if (src_rect) + { + src_box.left = src_rect->left; + src_box.top = src_rect->top; + src_box.right = src_rect->right; + src_box.bottom = src_rect->bottom; + src_box.front = 0; + src_box.back = 1; + } + else + { + src_box.left = 0; + src_box.top = 0; + src_box.right = src_desc.width; + src_box.bottom = src_desc.height; + src_box.front = 0; + src_box.back = 1; + } + + hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + wined3d_texture_get_resource(dst->wined3d_texture), dst->sub_resource_idx, dst_point ? dst_point->x : 0, + dst_point ? dst_point->y : 0, 0, wined3d_texture_get_resource(src->wined3d_texture), + src->sub_resource_idx, &src_box);
But test_cube_wrap() (d3d9/visual.c) fails in UpdateSurface (if I got debug right); the destination surface is smaller than the src rect (I'm I'm either getting the wrong sub index (e.g. the next mip) or
Ciao, Riccardo
2015-10-27 16:15 GMT+01:00 Riccardo Bortolato rikyz619@gmail.com:
OK, but since I could not find a definite answer I tried another road.
I assume you don't even want to look at it but use those methods instead.
Ciao, Riccardo
2015-10-27 15:40 GMT+01:00 Henri Verbeet hverbeet@gmail.com:
On 22 October 2015 at 12:01, Riccardo Bortolato rikyz619@gmail.com wrote:
enabled previously failing test in device.c removed wined3d_device_update_surface from wined3d and replaced its usage with surface_upload_from_surface.
This was mentioned in the discussion in the other thread, but just for the record, the options are either wined3d_device_update_sub_resource() or wined3d_device_copy_sub_resource_region().
Sorry, gmail somehow sent this incomplete draft.. however, here's the complete mail.
Why wined3d_device_copy_sub_resource_region() isn't implemented for WINED3D_RTYPE_CUBE_TEXTURE?
This seems the easiest option to me (if we exclude the already available one) but it looks like I'm having an issue with them: the destination surface is smaller than the source one.
I'm doing something like
+ sub_resource = wined3d_texture_get_sub_resource(src->wined3d_texture, src->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &src_desc); + sub_resource = wined3d_texture_get_sub_resource(dst->wined3d_texture, dst->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &dst_desc); + + if (src_desc.pool != WINED3D_POOL_SYSTEM_MEM || dst_desc.pool != WINED3D_POOL_DEFAULT) + { + WARN("source %p must be SYSTEMMEM and dest %p must be DEFAULT, returning WINED3DERR_INVALIDCALL\n", + src_surface, dst_surface); + wined3d_mutex_unlock(); + return WINED3DERR_INVALIDCALL; + } + + if (src_rect) + { + src_box.left = src_rect->left; + src_box.top = src_rect->top; + src_box.right = src_rect->right; + src_box.bottom = src_rect->bottom; + src_box.front = 0; + src_box.back = 1; + } + else + { + src_box.left = 0; + src_box.top = 0; + src_box.right = src_desc.width; + src_box.bottom = src_desc.height; + src_box.front = 0; + src_box.back = 1; + } + + hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, + wined3d_texture_get_resource(dst->wined3d_texture), dst->sub_resource_idx, dst_point ? dst_point->x : 0, + dst_point ? dst_point->y : 0, 0, wined3d_texture_get_resource(src->wined3d_texture), + src->sub_resource_idx, &src_box);
But test_cube_wrap() (d3d9/visual.c) fails in UpdateSurface (if I got debug right); the destination surface is smaller than the src rect (I'm either getting the wrong sub index (e.g. the next mip) or what?), this happens when the application (in this case the test) calls with null src rect and dst point.
Am I doing anything horribly wrong?
Ciao, Riccardo
2015-10-27 18:59 GMT+01:00 Riccardo Bortolato rikyz619@gmail.com:
Why wined3d_device_copy_sub_resource_region() isn't implemented for WINED3D_RTYPE_CUBE_TEXTURE?
This seems the easiest option to me (if we exclude the already available one) but it looks like I'm having an issue with them: the destination surface is smaller than the source one.
I'm doing something like
- if (src_rect)
- {
- src_box.left = src_rect->left;
- src_box.top = src_rect->top;
- src_box.right = src_rect->right;
- src_box.bottom = src_rect->bottom;
- src_box.front = 0;
- src_box.back = 1;
- }
- else
- {
- src_box.left = 0;
- src_box.top = 0;
- src_box.right = src_desc.width;
- src_box.bottom = src_desc.height;
- src_box.front = 0;
- src_box.back = 1;
- }
- hr = wined3d_device_copy_sub_resource_region(device->wined3d_device,
- wined3d_texture_get_resource(dst->wined3d_texture),
dst->sub_resource_idx, dst_point ? dst_point->x : 0,
- dst_point ? dst_point->y : 0, 0,
wined3d_texture_get_resource(src->wined3d_texture),
- src->sub_resource_idx, &src_box);
But test_cube_wrap() (d3d9/visual.c) fails in UpdateSurface (if I got debug right); the destination surface is smaller than the src rect (I'm I'm either getting the wrong sub index (e.g. the next mip) or
Ciao, Riccardo
2015-10-27 16:15 GMT+01:00 Riccardo Bortolato rikyz619@gmail.com:
OK, but since I could not find a definite answer I tried another road.
I assume you don't even want to look at it but use those methods instead.
Ciao, Riccardo
2015-10-27 15:40 GMT+01:00 Henri Verbeet hverbeet@gmail.com:
On 22 October 2015 at 12:01, Riccardo Bortolato rikyz619@gmail.com wrote:
enabled previously failing test in device.c removed wined3d_device_update_surface from wined3d and replaced its usage with surface_upload_from_surface.
This was mentioned in the discussion in the other thread, but just for the record, the options are either wined3d_device_update_sub_resource() or wined3d_device_copy_sub_resource_region().
On 27 October 2015 at 19:01, Riccardo Bortolato rikyz619@gmail.com wrote:
Sorry, gmail somehow sent this incomplete draft.. however, here's the complete mail.
Why wined3d_device_copy_sub_resource_region() isn't implemented for WINED3D_RTYPE_CUBE_TEXTURE?
No particular reason, it just wasn't needed yet.
But test_cube_wrap() (d3d9/visual.c) fails in UpdateSurface (if I got debug right); the destination surface is smaller than the src rect (I'm either getting the wrong sub index (e.g. the next mip) or what?), this happens when the application (in this case the test) calls with null src rect and dst point.
What are the actual sizes and sub-resource indices you're getting? All the surfaces in test_cube_wrap() should be 128x128.
I was actually wrong comparing stdout with stderr (I re-ran the tests with a single output and identified the failing test better).
It was test_cube_wrap() but it was failing because of:
warn:d3d:wined3d_device_copy_sub_resource_region Resource types (WINED3D_RTYPE_CUBE_TEXTURE / WINED3D_RTYPE_TEXTURE) don't match.
The other errors related to UpdateSurface were most likely expected by other tests, but since I wasn't running with the proper channels I thought they were the ones causing failures.
I sent an updated couple of patches that seem to be working (checking for volume textures instead of resource type matching).
Ciao, Riccardo
2015-10-28 15:02 GMT+01:00 Henri Verbeet hverbeet@gmail.com:
On 27 October 2015 at 19:01, Riccardo Bortolato rikyz619@gmail.com wrote:
Sorry, gmail somehow sent this incomplete draft.. however, here's the complete mail.
Why wined3d_device_copy_sub_resource_region() isn't implemented for WINED3D_RTYPE_CUBE_TEXTURE?
No particular reason, it just wasn't needed yet.
But test_cube_wrap() (d3d9/visual.c) fails in UpdateSurface (if I got debug right); the destination surface is smaller than the src rect (I'm either getting the wrong sub index (e.g. the next mip) or what?), this happens when the application (in this case the test) calls with null src rect and dst point.
What are the actual sizes and sub-resource indices you're getting? All the surfaces in test_cube_wrap() should be 128x128.