On 13 December 2013 12:30, Stefan Dösinger stefan@codeweavers.com wrote:
switch(hr)
{
case WINED3DERR_INVALIDCALL:
wined3d_mutex_unlock();
return DDERR_INVALIDPARAMS;
default:
break; /* Go on */
}
That's called hr_ddraw_from_wined3d().
On its own this patch is perhaps innocent enough, but it looks like this is supposed to make 4/5 safe, in which case that patch ends up depending on a somewhat obscure implementation detail. I think it may be better to merge wined3d_surface_set_mem() into wined3d_surface_update_desc(), at least as far as the public interface is concerned. (And in the long term we really want that to be wined3d_texture_update_desc().)
Am 13.12.2013 um 14:18 schrieb Henri Verbeet:
On its own this patch is perhaps innocent enough, but it looks like this is supposed to make 4/5 safe, in which case that patch ends up depending on a somewhat obscure implementation detail. I think it may be better to merge wined3d_surface_set_mem() into wined3d_surface_update_desc(), at least as far as the public interface is concerned.
The result would be pretty close to ddraw_suface::SetSufaceDesc, and I'm not particularly happy with that design. We'd have to provide similar constraints about which properties must be set together and which properties can remain untouched.
But if you think that's better than relying on the call order of update_desc and set_mem I'll see if I can make it work in a way I like.
On 13 December 2013 14:50, Stefan Dösinger stefandoesinger@gmail.com wrote:
Am 13.12.2013 um 14:18 schrieb Henri Verbeet:
On its own this patch is perhaps innocent enough, but it looks like this is supposed to make 4/5 safe, in which case that patch ends up depending on a somewhat obscure implementation detail. I think it may be better to merge wined3d_surface_set_mem() into wined3d_surface_update_desc(), at least as far as the public interface is concerned.
The result would be pretty close to ddraw_suface::SetSufaceDesc, and I'm not particularly happy with that design. We'd have to provide similar constraints about which properties must be set together and which properties can remain untouched.
I think we'd want the callers to always specify everything, but only do the more expensive things like e.g. resource_unload() when required.
Am 13.12.2013 um 15:06 schrieb Henri Verbeet:
I think we'd want the callers to always specify everything, but only do the more expensive things like e.g. resource_unload() when required.
I don't think so. At least a NULL memory pointer should be allowed for device_reset. d3d9 will need to be able to specify a pitch of 0, otherwise we'll have to deal with block-based surfaces with custom pitches and calculate a compressed surface pitch in d3d9.
I guess we can require a width and height != zero, that'll limit the complexity of the error checking.