Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 484130b3103..2cd0ac6bb38 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1348,15 +1348,13 @@ static void wined3d_device_get_transform(const struct wined3d_device *device, * stateblock problems. When capturing the state block, I duplicate the * hashmap, but when recording, just build a chain pretty much of commands to * be replayed. */ -static void wined3d_device_set_light(struct wined3d_device *device, - UINT light_idx, const struct wined3d_light *light) +static void wined3d_device_context_set_light(struct wined3d_device_context *context, + unsigned int light_idx, const struct wined3d_light *light) { struct wined3d_light_info *object = NULL; float rho;
- TRACE("device %p, light_idx %u, light %p.\n", device, light_idx, light); - - if (FAILED(wined3d_light_state_set_light(&device->cs->c.state->light_state, light_idx, light, &object))) + if (FAILED(wined3d_light_state_set_light(&context->state->light_state, light_idx, light, &object))) return;
/* Initialize the object. */ @@ -1445,7 +1443,7 @@ static void wined3d_device_set_light(struct wined3d_device *device, FIXME("Unrecognized light type %#x.\n", light->type); }
- wined3d_device_context_emit_set_light(&device->cs->c, object); + wined3d_device_context_emit_set_light(context, object); }
static void wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable) @@ -1459,7 +1457,7 @@ static void wined3d_device_set_light_enable(struct wined3d_device *device, UINT if (!(light_info = wined3d_light_state_get_light(light_state, light_idx))) { TRACE("Light enabled requested but light not defined, so defining one!\n"); - wined3d_device_set_light(device, light_idx, &WINED3D_default_light); + wined3d_device_context_set_light(&device->cs->c, light_idx, &WINED3D_default_light);
if (!(light_info = wined3d_light_state_get_light(light_state, light_idx))) { @@ -1849,7 +1847,7 @@ void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3 { LIST_FOR_EACH_ENTRY(light, &state->light_state.light_map[i], struct wined3d_light_info, entry) { - wined3d_device_set_light(device, light->OriginalIndex, &light->OriginalParms); + wined3d_device_context_set_light(context, light->OriginalIndex, &light->OriginalParms); wined3d_device_context_emit_set_light_enable(context, light->OriginalIndex, light->glIndex != -1); } } @@ -4046,7 +4044,7 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
LIST_FOR_EACH_ENTRY(light, &state->light_state->light_map[i], struct wined3d_light_info, entry) { - wined3d_device_set_light(device, light->OriginalIndex, &light->OriginalParms); + wined3d_device_context_set_light(context, light->OriginalIndex, &light->OriginalParms); wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1); } }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/cs.c | 7 ++++--- dlls/wined3d/device.c | 4 ++-- dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 21aaa2e54b6..14076defaa9 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1767,16 +1767,17 @@ static void wined3d_cs_exec_set_render_state(struct wined3d_cs *cs, const void * device_invalidate_state(cs->c.device, STATE_RENDER(op->state)); }
-void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) +void wined3d_device_context_emit_set_render_state(struct wined3d_device_context *context, + enum wined3d_render_state state, unsigned int value) { struct wined3d_cs_set_render_state *op;
- op = wined3d_device_context_require_space(&cs->c, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); + op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); op->opcode = WINED3D_CS_OP_SET_RENDER_STATE; op->state = state; op->value = value;
- wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); }
static void wined3d_cs_exec_set_texture_state(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2cd0ac6bb38..7e1297f8896 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1675,7 +1675,7 @@ static void wined3d_device_set_render_state(struct wined3d_device *device, else { device->cs->c.state->render_states[state] = value; - wined3d_cs_emit_set_render_state(device->cs, state, value); + wined3d_device_context_emit_set_render_state(&device->cs->c, state, value); }
if (state == WINED3D_RS_POINTSIZE && value == WINED3D_RESZ_CODE) @@ -1854,7 +1854,7 @@ void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3
for (i = 0; i < WINEHIGHEST_RENDER_STATE + 1; ++i) { - wined3d_cs_emit_set_render_state(device->cs, i, state->render_states[i]); + wined3d_device_context_emit_set_render_state(context, i, state->render_states[i]); }
wined3d_device_context_emit_set_blend_state(context, state->blend_state, &state->blend_factor, state->sample_mask); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f5b1a078907..047185746ef 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4809,6 +4809,8 @@ void wined3d_device_context_emit_set_predication(struct wined3d_device_context * struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_rasterizer_state(struct wined3d_device_context *context, struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN; +void wined3d_device_context_emit_set_render_state(struct wined3d_device_context *context, + enum wined3d_render_state state, unsigned int value) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_rendertarget_view(struct wined3d_device_context *context, unsigned int view_idx, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN; void wined3d_device_context_emit_set_sampler(struct wined3d_device_context *context, enum wined3d_shader_type type,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 2 +- dlls/wined3d/device.c | 7 +++---- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 0819918b2a1..6b3ff22055f 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2839,7 +2839,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_SwapDeviceContextState(ID3D11 state_impl = impl_from_ID3DDeviceContextState(state); if (!(wined3d_state = d3d_device_context_state_get_wined3d_state(state_impl, device))) ERR("Failed to get wined3d state for device context state %p.\n", state_impl); - wined3d_device_set_state(device->wined3d_device, wined3d_state); + wined3d_device_context_set_state(context->wined3d_context, wined3d_state);
if (prev) ID3DDeviceContextState_AddRef(*prev = &prev_impl->ID3DDeviceContextState_iface); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 7e1297f8896..a8383a89617 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1737,15 +1737,14 @@ void CDECL wined3d_device_context_get_scissor_rects(const struct wined3d_device_ *rect_count = state->scissor_rect_count; }
-void CDECL wined3d_device_set_state(struct wined3d_device *device, struct wined3d_state *state) +void CDECL wined3d_device_context_set_state(struct wined3d_device_context *context, struct wined3d_state *state) { - struct wined3d_device_context *context = &device->cs->c; const struct wined3d_light_info *light; unsigned int i, j;
- TRACE("device %p, state %p.\n", device, state); + TRACE("context %p, state %p.\n", context, state);
- device->cs->c.state = state; + context->state = state; wined3d_device_context_emit_set_feature_level(context, state->feature_level);
for (i = 0; i < WINED3D_MAX_RENDER_TARGETS; ++i) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 2879e1653d3..f339d91ee5c 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -129,7 +129,6 @@ @ cdecl wined3d_device_set_rendertarget_view(ptr long ptr long) @ cdecl wined3d_device_set_scissor_rects(ptr long ptr) @ cdecl wined3d_device_set_software_vertex_processing(ptr long) -@ cdecl wined3d_device_set_state(ptr ptr) @ cdecl wined3d_device_set_stream_output(ptr long ptr long) @ cdecl wined3d_device_set_stream_source(ptr long ptr long long) @ cdecl wined3d_device_set_unordered_access_view(ptr long ptr long) @@ -189,6 +188,7 @@ @ cdecl wined3d_device_context_set_scissor_rects(ptr long ptr) @ cdecl wined3d_device_context_set_shader(ptr long ptr) @ cdecl wined3d_device_context_set_shader_resource_view(ptr long long ptr) +@ cdecl wined3d_device_context_set_state(ptr ptr) @ cdecl wined3d_device_context_set_stream_output(ptr long ptr long) @ cdecl wined3d_device_context_set_stream_source(ptr long ptr long long) @ cdecl wined3d_device_context_set_unordered_access_view(ptr long long ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index dd1c15f14ed..d4762b79e6f 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2489,7 +2489,6 @@ HRESULT __cdecl wined3d_device_set_rendertarget_view(struct wined3d_device *devi void __cdecl wined3d_device_set_scissor_rects(struct wined3d_device *device, unsigned int rect_count, const RECT *rect); void __cdecl wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software); -void __cdecl wined3d_device_set_state(struct wined3d_device *device, struct wined3d_state *state); void __cdecl wined3d_device_set_stream_output(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer, UINT offset); HRESULT __cdecl wined3d_device_set_stream_source(struct wined3d_device *device, @@ -2609,6 +2608,7 @@ void __cdecl wined3d_device_context_set_shader(struct wined3d_device_context *co enum wined3d_shader_type type, struct wined3d_shader *shader); void __cdecl wined3d_device_context_set_shader_resource_view(struct wined3d_device_context *context, enum wined3d_shader_type type, unsigned int idx, struct wined3d_shader_resource_view *view); +void __cdecl wined3d_device_context_set_state(struct wined3d_device_context *context, struct wined3d_state *state); void __cdecl wined3d_device_context_set_stream_output(struct wined3d_device_context *context, unsigned int idx, struct wined3d_buffer *buffer, unsigned int offset); HRESULT __cdecl wined3d_device_context_set_stream_source(struct wined3d_device_context *context,
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=90536
Your paranoid android.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9661: Test failed: d3d11.c:15141: Test marked todo: Got hr 0 for WRITE_DISCARD.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com