Re: [PATCH 1/7] d3dx9/tests: Add test for skip_constants effect parameter.
2017-07-06 13:15 GMT+02:00 Paul Gofman <gofmanp(a)gmail.com>:
+static void test_effect_skip_constants(IDirect3DDevice9 *device) +{ + HRESULT hr; + ID3DXEffect *effect; + unsigned int passes_count; + D3DXVECTOR4 fvect; + unsigned int i; + + hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob), + NULL, NULL, "v3", 0, NULL, &effect, NULL); + todo_wine + ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); + if (SUCCEEDED(hr)) + effect->lpVtbl->Release(effect); + hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob), + NULL, NULL, "v4", 0, NULL, &effect, NULL); + todo_wine + ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); + if (SUCCEEDED(hr)) + effect->lpVtbl->Release(effect); + + hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob), + NULL, NULL, " v1#,.+-= &\t\nv2*/!\"'v5 v6[1]", 0, NULL, &effect, NULL); + ok(hr == D3D_OK, "Got result %#x.\n", hr);
Maybe also add a test with the "expected" syntax for the skip_constants parameters? MSDN mentions a semicolon-separated list. Of course it's not strictly needed, given this test...
+ + todo_wine + ok(!effect->lpVtbl->IsParameterUsed(effect, "v1", "tech0"), + "Unexpected IsParameterUsed result.\n"); + todo_wine + ok(!effect->lpVtbl->IsParameterUsed(effect, "v2", "tech0"), + "Unexpected IsParameterUsed result.\n"); + ok(effect->lpVtbl->IsParameterUsed(effect, "v3", "tech0"), + "Unexpected IsParameterUsed result.\n"); + ok(effect->lpVtbl->IsParameterUsed(effect, "v4", "tech0"), + "Unexpected IsParameterUsed result.\n"); + ok(!effect->lpVtbl->IsParameterUsed(effect, "v5", "tech0"), + "Unexpected IsParameterUsed result.\n");
What about "v6"?
On 07/10/2017 11:43 PM, Matteo Bruni wrote:
2017-07-06 13:15 GMT+02:00 Paul Gofman <gofmanp(a)gmail.com>:
+static void test_effect_skip_constants(IDirect3DDevice9 *device) +{ + HRESULT hr; + ID3DXEffect *effect; + unsigned int passes_count; + D3DXVECTOR4 fvect; + unsigned int i; + + hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob), + NULL, NULL, "v3", 0, NULL, &effect, NULL); + todo_wine + ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); + if (SUCCEEDED(hr)) + effect->lpVtbl->Release(effect); + hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob), + NULL, NULL, "v4", 0, NULL, &effect, NULL); + todo_wine + ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); + if (SUCCEEDED(hr)) + effect->lpVtbl->Release(effect); + + hr = D3DXCreateEffectEx(device, test_effect_skip_constants_blob, sizeof(test_effect_skip_constants_blob), + NULL, NULL, " v1#,.+-= &\t\nv2*/!\"'v5 v6[1]", 0, NULL, &effect, NULL); + ok(hr == D3D_OK, "Got result %#x.\n", hr); Maybe also add a test with the "expected" syntax for the skip_constants parameters? MSDN mentions a semicolon-separated list. Of course it's not strictly needed, given this test...
+ + todo_wine + ok(!effect->lpVtbl->IsParameterUsed(effect, "v1", "tech0"), + "Unexpected IsParameterUsed result.\n"); + todo_wine + ok(!effect->lpVtbl->IsParameterUsed(effect, "v2", "tech0"), + "Unexpected IsParameterUsed result.\n"); + ok(effect->lpVtbl->IsParameterUsed(effect, "v3", "tech0"), + "Unexpected IsParameterUsed result.\n"); + ok(effect->lpVtbl->IsParameterUsed(effect, "v4", "tech0"), + "Unexpected IsParameterUsed result.\n"); + ok(!effect->lpVtbl->IsParameterUsed(effect, "v5", "tech0"), + "Unexpected IsParameterUsed result.\n"); What about "v6"?
I will add these as the last patch of the series extending the test.
participants (2)
-
Matteo Bruni -
Paul Gofman