On 10 December 2013 12:23, Stefan Dösinger stefan@codeweavers.com wrote:
@Henri: I'm not sure what kind of control flow you had in mind here. The best understanding I could come up with was a nested if (first check for D3DPOOL_DEFAULT, then handle the D3DPOOL_SYSTEMEM special case), which I think is ugly. I removed the case check for D3DPOOL_SCRATCH, at the cost of not writing a visible FIXME for pool 0x6.
...
if (shared_handle) {
if (pool == D3DPOOL_SYSTEMMEM)
switch (pool) {
if (levels != 1)
case D3DPOOL_DEFAULT:
FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
break;
case D3DPOOL_SYSTEMMEM:
if (levels != 1)
{
WARN("Trying to create a mipmapped user memory texture.\n");
return D3DERR_INVALIDCALL;
}
set_mem = TRUE;
break;
default:
WARN("Trying to create a texture with pool %#x and shared_handle %p.\n",
pool, shared_handle); return D3DERR_INVALIDCALL;
set_mem = TRUE; }
else
}FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
+ { + if (pool != D3DPOOL_DEFAULT) + { + WARN("Trying to create a shared texture in pool %#x.\n", pool); + return D3DERR_INVALIDCALL; + } FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle); + }