The functin returns D3DERR_INVALIDCALL whenever it is tried on a parameter with elements. A check should be included.
Luis
Am 06.02.2012 18:23, schrieb Luis Carlos Busquets Pérez:
The functin returns D3DERR_INVALIDCALL whenever it is tried on a parameter with elements. A check should be included.
Why do you think this is the case? How did you test this? I think it's not possible to query the ID3DXBaseEffect interface (see http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3dx9_36/tests/effect.... ). Beside that, please have a look at http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3dx9_36/tests/effect.... , which calls ID3DXBaseEffect::SetValue through ID3DXEffect. There it doesn't return D3DERR_INVALIDCALL for D3DXPC_SCALAR, D3DXPC_VECTOR, D3DXPC_MATRIX_ROWS and Elements > 0. This should be tested by e.g. http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3dx9_36/tests/effect.... . Could you please a be a bit more specific, where the D3DERR_INVALIDCALL is returned? Maybe on e.g. D3DXPT_PIXELSHADER, which isn't implemented in wine, yet?
Cheers Rico
Indeed the test I made ist for ID3DXEffect::SetValue and I refer to ID3DXBaseEffect::SetValue as the previous refers to this one in the code. Find attached my test file for your convenienve. In the test case I have found that
1. If the functions returns E_FAIL for a sample then test_effect.c:1917: Test failed: Got result 80004005, expected 0 (D3D_OK) 2. For D3DXPT_VERTEXSHADER and D3DXPT_PIXELSHADER replying with E_FAIL avoids test_effect.c:1812: Test failed: Got result 0, expected 0x80004005 (E_FAIL) test_effect.c:1814: Test failed: Got result 0, expected 0x80004005 (E_FAIL) test_effect.c:1881: Test failed: Got result 0, expected 0x80004005 (E_FAIL) 3. If the function just sets the memory with the data for a bool then test_effect.c:969: Test failed: Got 46, expected 1 4. The errors reported on checking for element are corrected by changing to param->bytes <=bytes as you suggested. 5. Concerning textures, the compiler does not accept arrays of textures, so any change to a texture type should be just a change of the pointer to the texture at param->data (or NULL)
El 06/02/12 19:51, Rico Schüller escribió:
Am 06.02.2012 18:23, schrieb Luis Carlos Busquets Pérez:
The functin returns D3DERR_INVALIDCALL whenever it is tried on a parameter with elements. A check should be included.
Why do you think this is the case? How did you test this? I think it's not possible to query the ID3DXBaseEffect interface (see http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3dx9_36/tests/effect.... ). Beside that, please have a look at http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3dx9_36/tests/effect.... , which calls ID3DXBaseEffect::SetValue through ID3DXEffect. There it doesn't return D3DERR_INVALIDCALL for D3DXPC_SCALAR, D3DXPC_VECTOR, D3DXPC_MATRIX_ROWS and Elements > 0. This should be tested by e.g. http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/d3dx9_36/tests/effect.... . Could you please a be a bit more specific, where the D3DERR_INVALIDCALL is returned? Maybe on e.g. D3DXPT_PIXELSHADER, which isn't implemented in wine, yet?
Cheers Rico
Am 07.02.2012 06:02, schrieb Luis Carlos Busquets Pérez:
- If the functions returns E_FAIL for a sample then test_effect.c:1917: Test failed: Got result 80004005, expected 0 (D3D_OK)
I'll have a look at those.
- For D3DXPT_VERTEXSHADER and D3DXPT_PIXELSHADER replying with E_FAIL
avoids test_effect.c:1812: Test failed: Got result 0, expected 0x80004005 (E_FAIL) test_effect.c:1814: Test failed: Got result 0, expected 0x80004005 (E_FAIL) test_effect.c:1881: Test failed: Got result 0, expected 0x80004005 (E_FAIL)
Sure, that's not implemented, yet. You should get a FIXME for those cases.
- If the function just sets the memory with the data for a bool then test_effect.c:969: Test failed: Got 46, expected 1
In this case it may be required, that the input has to be converted before it is put into data. A solution would be to use Set*Array to set the values. In general, I think it's also fine to convert the values in get_int() and get_float() in the case of D3DXPT_BOOL with get_bool(data) - I'll send a patch for this. But I also think a test to show, that the value is converted while it is set, is still the way to go. Well SetValue isn't complete, yet.
- Concerning textures, the compiler does not accept arrays of textures,
so any change to a texture type should be just a change of the pointer to the texture at param->data (or NULL)
I didn't got the point. Only that it is impossible to declare texture arrays in effect files, which I could confirm. Do you mean, that the HeapAlloc for the additional pointer for textures should be avoided? This could be done, it just needs separate handling for textures. As it is now, it mostly uses the same handling together with the shaders (e.g. IUnknown_Release(*(IUnknown **)param->data)).
Cheers Rico