Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/d3d9_private.h | 2 +- dlls/d3d9/device.c | 51 +++++++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index a7072162d5..bc9a3b98b2 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -114,7 +114,7 @@ struct d3d9_device
DWORD auto_mipmaps; /* D3D9_MAX_TEXTURE_UNITS */
- unsigned int max_user_clip_planes; + unsigned int max_user_clip_planes, vs_uniform_count;
UINT implicit_swapchain_count; struct wined3d_swapchain **implicit_swapchains; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index fe23625a05..f0741045ad 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3567,26 +3567,29 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i }
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *iface, - UINT reg_idx, float *data, UINT count) + UINT start_idx, float *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; + const struct wined3d_vec4 *src;
- TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
- if (reg_idx + count > D3D9_MAX_VERTEX_SHADER_CONSTANTF) + if (!constants) + return D3DERR_INVALIDCALL; + + if (start_idx >= device->vs_uniform_count || count > device->vs_uniform_count - start_idx) { WARN("Trying to access %u constants, but d3d9 only supports %u\n", - reg_idx + count, D3D9_MAX_VERTEX_SHADER_CONSTANTF); + start_idx + count, device->vs_uniform_count); return D3DERR_INVALIDCALL; }
wined3d_mutex_lock(); - hr = wined3d_device_get_vs_consts_f(device->wined3d_device, - reg_idx, count, (struct wined3d_vec4 *)data); + src = wined3d_stateblock_get_state(device->state)->vs_consts_f; + memcpy(constants, &src[start_idx], count * sizeof(*src)); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantI(IDirect3DDevice9Ex *iface, @@ -3609,19 +3612,24 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantI(IDirect3DDevice9Ex *i }
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantI(IDirect3DDevice9Ex *iface, - UINT reg_idx, int *data, UINT count) + UINT start_idx, int *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; + const struct wined3d_ivec4 *src;
- TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); + + if (!constants || start_idx >= WINED3D_MAX_CONSTS_I) + return WINED3DERR_INVALIDCALL; + if (count > WINED3D_MAX_CONSTS_I - start_idx) + count = WINED3D_MAX_CONSTS_I - start_idx;
wined3d_mutex_lock(); - hr = wined3d_device_get_vs_consts_i(device->wined3d_device, - reg_idx, count, (struct wined3d_ivec4 *)data); + src = wined3d_stateblock_get_state(device->state)->vs_consts_i; + memcpy(constants, &src[start_idx], count * sizeof(*src)); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(IDirect3DDevice9Ex *iface, @@ -3642,18 +3650,22 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(IDirect3DDevice9Ex *i }
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantB(IDirect3DDevice9Ex *iface, - UINT reg_idx, BOOL *data, UINT count) + UINT start_idx, BOOL *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr;
- TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); + + if (!constants || start_idx >= WINED3D_MAX_CONSTS_B) + return WINED3DERR_INVALIDCALL; + if (count > WINED3D_MAX_CONSTS_B - start_idx) + count = WINED3D_MAX_CONSTS_B - start_idx;
wined3d_mutex_lock(); - hr = wined3d_device_get_vs_consts_b(device->wined3d_device, reg_idx, count, data); + memcpy(constants, &wined3d_stateblock_get_state(device->state)->vs_consts_b[start_idx], count * sizeof(*constants)); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static HRESULT WINAPI d3d9_device_SetStreamSource(IDirect3DDevice9Ex *iface, @@ -4609,6 +4621,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine
wined3d_get_device_caps(wined3d, adapter, device_type, &caps); device->max_user_clip_planes = caps.MaxUserClipPlanes; + device->vs_uniform_count = caps.MaxVertexShaderConst; if (flags & D3DCREATE_ADAPTERGROUP_DEVICE) count = caps.NumberOfAdaptersInGroup;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 10 ---------- 1 file changed, 10 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index f0741045ad..63312b939b 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3556,11 +3556,6 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *i wined3d_mutex_lock(); hr = wined3d_stateblock_set_vs_consts_f(device->update_state, reg_idx, count, (const struct wined3d_vec4 *)data); - if (SUCCEEDED(hr) && !device->recording) - { - hr = wined3d_device_set_vs_consts_f(device->wined3d_device, - reg_idx, count, (const struct wined3d_vec4 *)data); - } wined3d_mutex_unlock();
return hr; @@ -3603,9 +3598,6 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantI(IDirect3DDevice9Ex *i wined3d_mutex_lock(); hr = wined3d_stateblock_set_vs_consts_i(device->update_state, reg_idx, count, (const struct wined3d_ivec4 *)data); - if (SUCCEEDED(hr) && !device->recording) - hr = wined3d_device_set_vs_consts_i(device->wined3d_device, - reg_idx, count, (const struct wined3d_ivec4 *)data); wined3d_mutex_unlock();
return hr; @@ -3642,8 +3634,6 @@ static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(IDirect3DDevice9Ex *i
wined3d_mutex_lock(); hr = wined3d_stateblock_set_vs_consts_b(device->update_state, reg_idx, count, data); - if (SUCCEEDED(hr) && !device->recording) - hr = wined3d_device_set_vs_consts_b(device->wined3d_device, reg_idx, count, data); wined3d_mutex_unlock();
return hr;
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=64860
Your paranoid android.
=== debian10 (32 bit report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Report validation errors: d3d9:d3d9ex has no test summary line (early exit of the main process?) d3d9:device has no test summary line (early exit of the main process?) d3d9:device has unaccounted for failure messages d3d9:stateblock has no test summary line (early exit of the main process?) d3d9:visual has no test summary line (early exit of the main process?) d3d9:visual has unaccounted for failure messages
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 63312b939b..04fb158bc6 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3855,9 +3855,6 @@ static HRESULT WINAPI d3d9_device_SetPixelShader(IDirect3DDevice9Ex *iface, IDir wined3d_mutex_lock(); wined3d_stateblock_set_pixel_shader(device->update_state, shader_obj ? shader_obj->wined3d_shader : NULL); - if (!device->recording) - wined3d_device_set_pixel_shader(device->wined3d_device, - shader_obj ? shader_obj->wined3d_shader : 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=64861
Your paranoid android.
=== debian10 (32 bit report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Report validation errors: d3d9:d3d9ex has no test summary line (early exit of the main process?) d3d9:device has no test summary line (early exit of the main process?) d3d9:device has unaccounted for failure messages d3d9:stateblock has no test summary line (early exit of the main process?) d3d9:visual has no test summary line (early exit of the main process?) d3d9:visual has unaccounted for failure messages
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 04fb158bc6..f6ff9466b1 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3908,19 +3908,22 @@ static HRESULT WINAPI d3d9_device_SetPixelShaderConstantF(IDirect3DDevice9Ex *if }
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantF(IDirect3DDevice9Ex *iface, - UINT reg_idx, float *data, UINT count) + UINT start_idx, float *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; + const struct wined3d_vec4 *src;
- TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, 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, - reg_idx, count, (struct wined3d_vec4 *)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 d3d9_device_SetPixelShaderConstantI(IDirect3DDevice9Ex *iface, @@ -3943,19 +3946,24 @@ static HRESULT WINAPI d3d9_device_SetPixelShaderConstantI(IDirect3DDevice9Ex *if }
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantI(IDirect3DDevice9Ex *iface, - UINT reg_idx, int *data, UINT count) + UINT start_idx, int *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr; + const struct wined3d_ivec4 *src;
- TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); + + if (!constants || start_idx >= WINED3D_MAX_CONSTS_I) + return WINED3DERR_INVALIDCALL; + if (count > WINED3D_MAX_CONSTS_I - start_idx) + count = WINED3D_MAX_CONSTS_I - start_idx;
wined3d_mutex_lock(); - hr = wined3d_device_get_ps_consts_i(device->wined3d_device, - reg_idx, count, (struct wined3d_ivec4 *)data); + src = wined3d_stateblock_get_state(device->state)->ps_consts_i; + memcpy(constants, &src[start_idx], count * sizeof(*src)); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static HRESULT WINAPI d3d9_device_SetPixelShaderConstantB(IDirect3DDevice9Ex *iface, @@ -3976,18 +3984,22 @@ static HRESULT WINAPI d3d9_device_SetPixelShaderConstantB(IDirect3DDevice9Ex *if }
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantB(IDirect3DDevice9Ex *iface, - UINT reg_idx, BOOL *data, UINT count) + UINT start_idx, BOOL *constants, UINT count) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - HRESULT hr;
- TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count); + TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count); + + if (!constants || start_idx >= WINED3D_MAX_CONSTS_I) + return WINED3DERR_INVALIDCALL; + if (count > WINED3D_MAX_CONSTS_I - start_idx) + count = WINED3D_MAX_CONSTS_I - start_idx;
wined3d_mutex_lock(); - hr = wined3d_device_get_ps_consts_b(device->wined3d_device, reg_idx, count, data); + memcpy(constants, &wined3d_stateblock_get_state(device->state)->ps_consts_b[start_idx], count * sizeof(*constants)); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
static HRESULT WINAPI d3d9_device_DrawRectPatch(IDirect3DDevice9Ex *iface, UINT handle,
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=64862
Your paranoid android.
=== debian10 (32 bit report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Report validation errors: d3d9:d3d9ex has no test summary line (early exit of the main process?) d3d9:device has no test summary line (early exit of the main process?) d3d9:device has unaccounted for failure messages d3d9:stateblock has no test summary line (early exit of the main process?) d3d9:visual has no test summary line (early exit of the main process?) d3d9:visual has unaccounted for failure messages
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index f6ff9466b1..1ff178881c 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3899,9 +3899,6 @@ static HRESULT WINAPI d3d9_device_SetPixelShaderConstantF(IDirect3DDevice9Ex *if wined3d_mutex_lock(); hr = wined3d_stateblock_set_ps_consts_f(device->update_state, reg_idx, count, (const struct wined3d_vec4 *)data); - if (SUCCEEDED(hr) && !device->recording) - hr = wined3d_device_set_ps_consts_f(device->wined3d_device, - reg_idx, count, (const struct wined3d_vec4 *)data); wined3d_mutex_unlock();
return hr; @@ -3937,9 +3934,6 @@ static HRESULT WINAPI d3d9_device_SetPixelShaderConstantI(IDirect3DDevice9Ex *if wined3d_mutex_lock(); hr = wined3d_stateblock_set_ps_consts_i(device->update_state, reg_idx, count, (const struct wined3d_ivec4 *)data); - if (SUCCEEDED(hr) && !device->recording) - hr = wined3d_device_set_ps_consts_i(device->wined3d_device, - reg_idx, count, (const struct wined3d_ivec4 *)data); wined3d_mutex_unlock();
return hr; @@ -3976,8 +3970,6 @@ static HRESULT WINAPI d3d9_device_SetPixelShaderConstantB(IDirect3DDevice9Ex *if
wined3d_mutex_lock(); hr = wined3d_stateblock_set_ps_consts_b(device->update_state, reg_idx, count, data); - if (SUCCEEDED(hr) && !device->recording) - hr = wined3d_device_set_ps_consts_b(device->wined3d_device, reg_idx, count, data); wined3d_mutex_unlock();
return hr;
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=64863
Your paranoid android.
=== debian10 (32 bit report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Report validation errors: d3d9:d3d9ex has no test summary line (early exit of the main process?) d3d9:device has no test summary line (early exit of the main process?) d3d9:device has unaccounted for failure messages d3d9:stateblock has no test summary line (early exit of the main process?) d3d9:visual has no test summary line (early exit of the main process?) d3d9:visual has unaccounted for failure messages
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
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=64859
Your paranoid android.
=== debian10 (32 bit report) ===
=== debian10 (32 bit Chinese:China report) ===
=== debian10 (32 bit WoW report) ===
=== debian10 (64 bit WoW report) ===
Report validation errors: d3d9:d3d9ex has no test summary line (early exit of the main process?) d3d9:device has no test summary line (early exit of the main process?) d3d9:device has unaccounted for failure messages d3d9:stateblock has no test summary line (early exit of the main process?) d3d9:visual has no test summary line (early exit of the main process?) d3d9:visual has unaccounted for failure messages