Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 957f663174..d9f914f125 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -3298,19 +3298,22 @@ static HRESULT WINAPI d3d8_device_SetPixelShaderConstant(IDirect3DDevice8 *iface }
static HRESULT WINAPI d3d8_device_GetPixelShaderConstant(IDirect3DDevice8 *iface, - DWORD start_register, void *data, DWORD count) + DWORD start_idx, void *constants, DWORD count) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); - HRESULT hr; + const struct wined3d_vec4 *src;
- TRACE("iface %p, start_register %u, data %p, count %u.\n", - iface, start_register, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); + + if (!constants || start_idx >= WINED3D_MAX_PS_CONSTS_F || count > WINED3D_MAX_PS_CONSTS_F - start_idx) + return WINED3DERR_INVALIDCALL;
wined3d_mutex_lock(); - hr = wined3d_device_get_ps_consts_f(device->wined3d_device, start_register, count, data); + src = wined3d_stateblock_get_state(device->state)->ps_consts_f; + memcpy(constants, &src[start_idx], count * sizeof(*src)); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static HRESULT WINAPI d3d8_device_GetPixelShaderFunction(IDirect3DDevice8 *iface,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index d9f914f125..19dc844ee2 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -3290,8 +3290,6 @@ static HRESULT WINAPI d3d8_device_SetPixelShaderConstant(IDirect3DDevice8 *iface
wined3d_mutex_lock(); hr = wined3d_stateblock_set_ps_consts_f(device->update_state, start_register, count, data); - if (SUCCEEDED(hr) && !device->recording) - hr = wined3d_device_set_ps_consts_f(device->wined3d_device, start_register, count, data); wined3d_mutex_unlock();
return hr;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 19dc844ee2..481f4f3846 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2165,8 +2165,18 @@ static HRESULT WINAPI d3d8_device_GetTexture(IDirect3DDevice8 *iface, DWORD stag if (!texture) return D3DERR_INVALIDCALL;
+ if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3) + stage -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS); + + if (stage >= WINED3D_MAX_COMBINED_SAMPLERS) + { + WARN("Ignoring invalid stage %u.\n", stage); + *texture = NULL; + return D3D_OK; + } + wined3d_mutex_lock(); - if ((wined3d_texture = wined3d_device_get_texture(device->wined3d_device, stage))) + if ((wined3d_texture = wined3d_stateblock_get_state(device->state)->textures[stage])) { texture_impl = wined3d_texture_get_parent(wined3d_texture); *texture = &texture_impl->IDirect3DBaseTexture8_iface;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 481f4f3846..7c1a6fe9fd 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2203,9 +2203,6 @@ static HRESULT WINAPI d3d8_device_SetTexture(IDirect3DDevice8 *iface, DWORD stag wined3d_mutex_lock(); wined3d_stateblock_set_texture(device->update_state, stage, texture_impl ? texture_impl->wined3d_texture : NULL); - if (!device->recording) - wined3d_device_set_texture(device->wined3d_device, stage, - texture_impl ? texture_impl->wined3d_texture : NULL); wined3d_mutex_unlock();
return D3D_OK;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65650
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
d3d8: device: Timeout
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 7c1a6fe9fd..41384d84bc 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2251,26 +2251,38 @@ tss_lookup[] = };
static HRESULT WINAPI d3d8_device_GetTextureStageState(IDirect3DDevice8 *iface, - DWORD stage, D3DTEXTURESTAGESTATETYPE Type, DWORD *value) + DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); + const struct wined3d_stateblock_state *device_state; const struct tss_lookup *l;
- TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, Type, value); + TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, state, value); + + if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3) + stage -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS); + + if (stage >= WINED3D_MAX_COMBINED_SAMPLERS) + { + WARN("Invalid stage %u.\n", stage); + *value = 0; + return D3D_OK; + }
- if (Type >= ARRAY_SIZE(tss_lookup)) + if (state >= ARRAY_SIZE(tss_lookup)) { - WARN("Invalid Type %#x passed.\n", Type); + WARN("Invalid state %#x.\n", state); return D3D_OK; }
- l = &tss_lookup[Type]; + l = &tss_lookup[state];
wined3d_mutex_lock(); + device_state = wined3d_stateblock_get_state(device->state); if (l->sampler_state) - *value = wined3d_device_get_sampler_state(device->wined3d_device, stage, l->u.sampler_state); + *value = device_state->sampler_states[stage][l->u.sampler_state]; else - *value = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->u.texture_state); + *value = device_state->texture_states[stage][l->u.texture_state]; wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 41384d84bc..5e18f64550 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2306,17 +2306,9 @@ static HRESULT WINAPI d3d8_device_SetTextureStageState(IDirect3DDevice8 *iface,
wined3d_mutex_lock(); if (l->sampler_state) - { wined3d_stateblock_set_sampler_state(device->update_state, stage, l->u.sampler_state, value); - if (!device->recording) - wined3d_device_set_sampler_state(device->wined3d_device, stage, l->u.sampler_state, value); - } else - { wined3d_stateblock_set_texture_stage_state(device->update_state, stage, l->u.texture_state, value); - if (!device->recording) - wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->u.texture_state, value); - } wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com