Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/d3d10/effect.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 15b71aab1b7..64dd9ac9312 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3559,33 +3559,33 @@ static BOOL STDMETHODCALLTYPE d3d10_effect_pass_IsValid(ID3D10EffectPass *iface) static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *iface, D3D10_PASS_DESC *desc) { - struct d3d10_effect_pass *This = impl_from_ID3D10EffectPass(iface); + struct d3d10_effect_pass *pass = impl_from_ID3D10EffectPass(iface); struct d3d10_effect_shader_variable *s;
FIXME("iface %p, desc %p partial stub!\n", iface, desc);
- if(This == &null_pass) + if (pass == &null_pass) { WARN("Null pass specified\n"); return E_FAIL; }
- if(!desc) + if (!desc) { WARN("Invalid argument specified\n"); return E_INVALIDARG; }
+ s = &impl_from_ID3D10EffectShaderVariable(pass->vs.pShaderVariable)->u.shader; + memset(desc, 0, sizeof(*desc)); - desc->Name = This->name;
- s = &impl_from_ID3D10EffectVariable((ID3D10EffectVariable *)This->vs.pShaderVariable)->u.shader; + desc->Name = pass->name; desc->pIAInputSignature = (BYTE *)s->input_signature.signature; desc->IAInputSignatureSize = s->input_signature.signature_size; - - desc->StencilRef = This->stencil_ref; - desc->SampleMask = This->sample_mask; - memcpy(desc->BlendFactor, This->blend_factor, 4 * sizeof(float)); + desc->StencilRef = pass->stencil_ref; + desc->SampleMask = pass->sample_mask; + memcpy(desc->BlendFactor, pass->blend_factor, 4 * sizeof(float));
return S_OK; }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
v2: removed memset, that's no longer necessary.
dlls/d3d10/effect.c | 5 ++-- dlls/d3d10/tests/effect.c | 54 +++++++++++++++------------------------ 2 files changed, 22 insertions(+), 37 deletions(-)
diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index 64dd9ac9312..3040cb63528 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -3562,7 +3562,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa struct d3d10_effect_pass *pass = impl_from_ID3D10EffectPass(iface); struct d3d10_effect_shader_variable *s;
- FIXME("iface %p, desc %p partial stub!\n", iface, desc); + TRACE("iface %p, desc %p.\n", iface, desc);
if (pass == &null_pass) { @@ -3578,9 +3578,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_pass_GetDesc(ID3D10EffectPass *ifa
s = &impl_from_ID3D10EffectShaderVariable(pass->vs.pShaderVariable)->u.shader;
- memset(desc, 0, sizeof(*desc)); - desc->Name = pass->name; + desc->Annotations = pass->annotation_count; desc->pIAInputSignature = (BYTE *)s->input_signature.signature; desc->IAInputSignatureSize = s->input_signature.signature_size; desc->StencilRef = pass->stencil_ref; diff --git a/dlls/d3d10/tests/effect.c b/dlls/d3d10/tests/effect.c index e19f4a0f694..e67eb188328 100644 --- a/dlls/d3d10/tests/effect.c +++ b/dlls/d3d10/tests/effect.c @@ -4200,44 +4200,30 @@ SamplerState sampler0 {}; technique10 tech0 { pass pass0 + <string a="text";> { } }; #endif static DWORD fx_test_state_group_defaults[] = { - 0x43425844, 0x920e6905, 0x58225fcd, 0x3b65b423, - 0x67e96b6c, 0x00000001, 0x000001f4, 0x00000001, - 0x00000024, 0x30315846, 0x000001c8, 0xfeff1001, - 0x00000001, 0x00000000, 0x00000004, 0x00000000, - 0x00000000, 0x00000000, 0x00000001, 0x000000ec, - 0x00000000, 0x00000000, 0x00000001, 0x00000001, - 0x00000001, 0x00000001, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x6f6c4724, - 0x736c6162, 0x73615200, 0x69726574, 0x5372657a, - 0x65746174, 0x00000d00, 0x00000200, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000400, - 0x73617200, 0x74735f74, 0x00657461, 0x74706544, - 0x65745368, 0x6c69636e, 0x74617453, 0x00440065, - 0x00020000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00030000, 0x73640000, 0x6174735f, - 0x42006574, 0x646e656c, 0x74617453, 0x007b0065, - 0x00020000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00020000, 0x6c620000, 0x5f646e65, - 0x74617473, 0x61530065, 0x656c706d, 0x61745372, - 0xae006574, 0x02000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x15000000, 0x73000000, - 0x6c706d61, 0x00307265, 0x68636574, 0x61700030, - 0x00307373, 0x00000004, 0x00000000, 0x00000000, - 0x00000000, 0xffffffff, 0x00000000, 0x00000039, - 0x0000001d, 0x00000000, 0xffffffff, 0x00000000, - 0x00000000, 0x00000072, 0x00000056, 0x00000000, - 0xffffffff, 0x00000000, 0x00000000, 0x000000a2, - 0x00000086, 0x00000000, 0xffffffff, 0x00000000, - 0x00000000, 0x000000d7, 0x000000bb, 0x00000000, - 0xffffffff, 0x00000000, 0x00000000, 0x000000e0, - 0x00000001, 0x00000000, 0x000000e6, 0x00000000, - 0x00000000, + 0x43425844, 0xef2bd174, 0x123794f9, 0xbea23fa0, 0x953a31dd, 0x00000001, 0x00000209, 0x00000001, + 0x00000024, 0x30315846, 0x000001dd, 0xfeff1001, 0x00000000, 0x00000000, 0x00000004, 0x00000000, + 0x00000000, 0x00000000, 0x00000001, 0x0000010d, 0x00000000, 0x00000000, 0x00000001, 0x00000001, + 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x74736152, + 0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x44006574, 0x68747065, 0x6e657453, 0x536c6963, + 0x65746174, 0x00003b00, 0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000300, + 0x5f736400, 0x74617473, 0x6c420065, 0x53646e65, 0x65746174, 0x00007200, 0x00000200, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x656c6200, 0x735f646e, 0x65746174, 0x6d615300, + 0x72656c70, 0x74617453, 0x00a50065, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00150000, 0x61730000, 0x656c706d, 0x74003072, 0x30686365, 0x73617000, 0x53003073, 0x6e697274, + 0x00e30067, 0x00020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00610000, + 0x74786574, 0x00003000, 0x00001400, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00006900, + 0x00004d00, 0x00000000, 0xffffff00, 0x000000ff, 0x00000000, 0x00009900, 0x00007d00, 0x00000000, + 0xffffff00, 0x000000ff, 0x00000000, 0x0000ce00, 0x0000b200, 0x00000000, 0xffffff00, 0x000000ff, + 0x00000000, 0x0000d700, 0x00000100, 0x00000000, 0x0000dd00, 0x00000000, 0x00000100, 0x00010600, + 0x0000ea00, 0x00010800, 0x00000000, };
static void test_effect_state_group_defaults(void) @@ -4272,7 +4258,7 @@ static void test_effect_state_group_defaults(void) hr = effect->lpVtbl->GetDesc(effect, &effect_desc); ok(SUCCEEDED(hr), "Failed to get effect description, hr %#x.\n", hr); ok(!effect_desc.IsChildEffect, "Unexpected IsChildEffect.\n"); - ok(effect_desc.ConstantBuffers == 1, "Unexpected constant buffers count %u.\n", + ok(effect_desc.ConstantBuffers == 0, "Unexpected constant buffers count %u.\n", effect_desc.ConstantBuffers); ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n", effect_desc.SharedConstantBuffers); @@ -4373,7 +4359,7 @@ static void test_effect_state_group_defaults(void) hr = pass->lpVtbl->GetDesc(pass, &pass_desc); ok(SUCCEEDED(hr), "Failed to get pass desc, hr %#x.\n", hr); ok(!strcmp(pass_desc.Name, "pass0"), "Got unexpected Name "%s".\n", pass_desc.Name); - ok(!pass_desc.Annotations, "Got unexpected Annotations %#x.\n", pass_desc.Annotations); + ok(pass_desc.Annotations == 1, "Got unexpected Annotations %u.\n", pass_desc.Annotations); ok(!pass_desc.pIAInputSignature, "Got unexpected pIAInputSignature %p.\n", pass_desc.pIAInputSignature); ok(pass_desc.StencilRef == 0, "Got unexpected StencilRef %#x.\n", pass_desc.StencilRef); ok(pass_desc.SampleMask == 0, "Got unexpected SampleMask %#x.\n", pass_desc.SampleMask);
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
From: Nikolay Sivov nsivov@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2 (Matteo): Test GetTechniqueDesc() with a NULL handle.
dlls/d3dx9_36/effect.c | 2 +- dlls/d3dx9_36/tests/effect.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 710e999f27f..22afa649db3 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -3816,7 +3816,7 @@ static HRESULT WINAPI d3dx_effect_FindNextValidTechnique(ID3DXEffect *iface, D3D } }
- *next_technique = get_technique_handle(&effect->techniques[0]); + *next_technique = NULL; return S_FALSE; }
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index ae6f65d52d5..d6998284271 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -7892,9 +7892,9 @@ static void test_effect_find_next_valid_technique(void) D3DPRESENT_PARAMETERS present_parameters = {0}; IDirect3DDevice9 *device; D3DXTECHNIQUE_DESC desc; + D3DXHANDLE tech, tech2; ID3DXEffect *effect; IDirect3D9 *d3d; - D3DXHANDLE tech; ULONG refcount; HWND window; HRESULT hr; @@ -7939,9 +7939,12 @@ static void test_effect_find_next_valid_technique(void) ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
- hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech); + tech2 = tech; + hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2); ok(hr == S_FALSE, "Got result %#x.\n", hr); - hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc); + ok(!tech2, "Unexpected technique handle %p.\n", tech2); + /* Test GetTechniqueDesc() with a NULL handle. */ + hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc); ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
@@ -7957,9 +7960,10 @@ static void test_effect_find_next_valid_technique(void) ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
- hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech); + hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2); ok(hr == S_FALSE, "Got result %#x.\n", hr); - hr = effect->lpVtbl->GetTechniqueDesc(effect, tech, &desc); + ok(!tech2, "Unexpected technique handle %p.\n", tech2); + hr = effect->lpVtbl->GetTechniqueDesc(effect, tech2, &desc); ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech0"), "Got unexpected technique %s.\n", desc.Name);
@@ -7985,8 +7989,9 @@ static void test_effect_find_next_valid_technique(void) ok(hr == D3D_OK, "Got result %#x.\n", hr); ok(!strcmp(desc.Name, "tech1"), "Got unexpected technique %s.\n", desc.Name);
- hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech); + hr = effect->lpVtbl->FindNextValidTechnique(effect, tech, &tech2); ok(hr == S_FALSE, "Got result %#x.\n", hr); + ok(!tech2, "Unexpected technique handle %p.\n", tech2);
hr = effect->lpVtbl->FindNextValidTechnique(effect, "nope", &tech); ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr);