Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 0657cc2f766..58bdd7458c2 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2403,7 +2403,7 @@ static HRESULT WINAPI d3d9_device_BeginStateBlock(IDirect3DDevice9Ex *iface) if (device->recording) { wined3d_mutex_unlock(); - WARN("Trying to begin a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n"); + WARN("Trying to begin a stateblock while recording, returning D3DERR_INVALIDCALL.\n"); return D3DERR_INVALIDCALL; }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 564dc9d9d04..9dd3ef016f7 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1905,7 +1905,7 @@ static HRESULT WINAPI d3d8_device_BeginStateBlock(IDirect3DDevice8 *iface) if (device->recording) { wined3d_mutex_unlock(); - WARN("Trying to begin a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n"); + WARN("Trying to begin a stateblock while recording, returning D3DERR_INVALIDCALL.\n"); return D3DERR_INVALIDCALL; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 173 +-------------------------------- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 1 insertion(+), 173 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f2d060184ba..562caf8900a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -533,10 +533,6 @@ void wined3d_device_cleanup(struct wined3d_device *device)
wined3d_cs_destroy(device->cs);
- if (device->recording && wined3d_stateblock_decref(device->recording)) - ERR("Something's still holding the recording stateblock.\n"); - device->recording = NULL; - for (i = 0; i < ARRAY_SIZE(device->multistate_funcs); ++i) { heap_free(device->multistate_funcs[i]); @@ -1283,12 +1279,6 @@ HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UI device->update_stateblock_state->streams[stream_idx].stride = stride; device->update_stateblock_state->streams[stream_idx].offset = offset;
- if (device->recording) - { - device->recording->changed.streamSource |= 1u << stream_idx; - return WINED3D_OK; - } - if (prev_buffer == buffer && stream->stride == stride && stream->offset == offset) @@ -1365,11 +1355,6 @@ HRESULT CDECL wined3d_device_set_stream_source_freq(struct wined3d_device *devic
device->update_stateblock_state->streams[stream_idx].flags = flags; device->update_stateblock_state->streams[stream_idx].frequency = freq; - if (device->recording) - { - device->recording->changed.streamFreq |= 1u << stream_idx; - return WINED3D_OK; - }
stream->flags = flags; stream->frequency = freq; @@ -1406,12 +1391,6 @@ void CDECL wined3d_device_set_transform(struct wined3d_device *device,
/* Handle recording of state blocks. */ device->update_stateblock_state->transforms[d3dts] = *matrix; - if (device->recording) - { - TRACE("Recording... not performing anything.\n"); - device->recording->changed.transform[d3dts >> 5] |= 1u << (d3dts & 0x1f); - return; - }
/* If the new matrix is the same as the current one, * we cut off any further processing. this seems to be a reasonable @@ -1504,8 +1483,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
if (FAILED(hr = wined3d_light_state_set_light(&device->update_stateblock_state->light_state, light_idx, light, &object))) return hr; - if (device->recording) - return WINED3D_OK;
if (FAILED(hr = wined3d_light_state_set_light(&device->state.light_state, light_idx, light, &object))) return hr; @@ -1634,9 +1611,6 @@ HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UIN wined3d_light_state_enable_light(&device->update_stateblock_state->light_state, &device->adapter->d3d_info, light_info, enable);
- if (device->recording) - return WINED3D_OK; - /* Special case - enabling an undefined light creates one with a strict set of parameters. */ if (!(light_info = wined3d_light_state_get_light(&device->state.light_state, light_idx))) { @@ -1685,12 +1659,6 @@ HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device,
device->update_stateblock_state->clip_planes[plane_idx] = *plane;
- if (device->recording) - { - device->recording->changed.clipplane |= 1u << plane_idx; - return WINED3D_OK; - } - if (!memcmp(&device->state.clip_planes[plane_idx], plane, sizeof(*plane))) { TRACE("Application is setting old values over, nothing to do.\n"); @@ -1747,11 +1715,6 @@ void CDECL wined3d_device_set_material(struct wined3d_device *device, const stru TRACE("device %p, material %p.\n", device, material);
device->update_stateblock_state->material = *material; - if (device->recording) - { - device->recording->changed.material = TRUE; - return; - }
device->state.material = *material; wined3d_cs_emit_set_material(device->cs, material); @@ -1791,12 +1754,6 @@ void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, device->update_stateblock_state->index_buffer = buffer; device->update_stateblock_state->index_format = format_id;
- if (device->recording) - { - device->recording->changed.indices = TRUE; - return; - } - if (prev_buffer == buffer && prev_format == format_id && prev_offset == offset) return;
@@ -1826,8 +1783,7 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I TRACE("device %p, base_index %d.\n", device, base_index);
device->update_stateblock_state->base_vertex_index = base_index; - if (!device->recording) - device->state.base_vertex_index = base_index; + device->state.base_vertex_index = base_index; }
INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *device) @@ -1853,14 +1809,6 @@ void CDECL wined3d_device_set_viewports(struct wined3d_device *device, unsigned if (viewport_count) device->update_stateblock_state->viewport = viewports[0];
- /* Handle recording of state blocks */ - if (device->recording) - { - TRACE("Recording... not performing anything\n"); - device->recording->changed.viewport = TRUE; - return; - } - if (viewport_count) memcpy(device->state.viewports, viewports, viewport_count * sizeof(*viewports)); else @@ -1912,11 +1860,6 @@ void CDECL wined3d_device_set_blend_state(struct wined3d_device *device, TRACE("device %p, blend_state %p, blend_factor %s.\n", device, blend_state, debug_color(blend_factor));
device->update_stateblock_state->blend_factor = *blend_factor; - if (device->recording) - { - device->recording->changed.blend_state = TRUE; - return; - }
prev = state->blend_state; if (prev == blend_state && !memcmp(blend_factor, &state->blend_factor, sizeof(*blend_factor))) @@ -1981,14 +1924,6 @@ void CDECL wined3d_device_set_render_state(struct wined3d_device *device,
device->update_stateblock_state->rs[state] = value;
- /* Handle recording of state blocks. */ - if (device->recording) - { - TRACE("Recording... not performing anything.\n"); - device->recording->changed.renderState[state >> 5] |= 1u << (state & 0x1f); - return; - } - if (value == device->state.render_states[state]) TRACE("Application is setting the old value over, nothing to do.\n"); else @@ -2028,14 +1963,6 @@ void CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
device->update_stateblock_state->sampler_states[sampler_idx][state] = value;
- /* Handle recording of state blocks. */ - if (device->recording) - { - TRACE("Recording... not performing anything.\n"); - device->recording->changed.samplerState[sampler_idx] |= 1u << state; - return; - } - if (value == device->state.sampler_states[sampler_idx][state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -2079,12 +2006,6 @@ void CDECL wined3d_device_set_scissor_rects(struct wined3d_device *device, unsig if (rect_count) device->update_stateblock_state->scissor_rect = rects[0];
- if (device->recording) - { - device->recording->changed.scissorRect = TRUE; - return; - } - if (device->state.scissor_rect_count == rect_count && !memcmp(device->state.scissor_rects, rects, rect_count * sizeof(*rects))) { @@ -2127,12 +2048,6 @@ void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device, wined3d_vertex_declaration_decref(device->update_stateblock_state->vertex_declaration); device->update_stateblock_state->vertex_declaration = declaration;
- if (device->recording) - { - device->recording->changed.vertexDecl = TRUE; - return; - } - if (declaration == prev) return;
@@ -2163,12 +2078,6 @@ void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struc wined3d_shader_decref(device->update_stateblock_state->vs); device->update_stateblock_state->vs = shader;
- if (device->recording) - { - device->recording->changed.vertexShader = TRUE; - return; - } - if (shader == prev) return;
@@ -2354,12 +2263,6 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, count = WINED3D_MAX_CONSTS_B - start_idx;
memcpy(&device->update_stateblock_state->vs_consts_b[start_idx], constants, count * sizeof(*constants)); - if (device->recording) - { - for (i = start_idx; i < count + start_idx; ++i) - device->recording->changed.vertexShaderConstantsB |= (1u << i); - return WINED3D_OK; - }
memcpy(&device->state.vs_consts_b[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) @@ -2404,12 +2307,6 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, count = WINED3D_MAX_CONSTS_I - start_idx;
memcpy(&device->update_stateblock_state->vs_consts_i[start_idx], constants, count * sizeof(*constants)); - if (device->recording) - { - for (i = start_idx; i < count + start_idx; ++i) - device->recording->changed.vertexShaderConstantsI |= (1u << i); - return WINED3D_OK; - }
memcpy(&device->state.vs_consts_i[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) @@ -2452,12 +2349,6 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, return WINED3DERR_INVALIDCALL;
memcpy(&device->update_stateblock_state->vs_consts_f[start_idx], constants, count * sizeof(*constants)); - if (device->recording) - { - memset(&device->recording->changed.vs_consts_f[start_idx], 1, - count * sizeof(*device->recording->changed.vs_consts_f)); - return WINED3D_OK; - }
memcpy(&device->state.vs_consts_f[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) @@ -2499,11 +2390,6 @@ void CDECL wined3d_device_set_pixel_shader(struct wined3d_device *device, struct if (device->update_stateblock_state->ps) wined3d_shader_decref(device->update_stateblock_state->ps); device->update_stateblock_state->ps = shader; - if (device->recording) - { - device->recording->changed.pixelShader = TRUE; - return; - }
if (shader == prev) return; @@ -2568,12 +2454,6 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, count = WINED3D_MAX_CONSTS_B - start_idx;
memcpy(&device->update_stateblock_state->ps_consts_b[start_idx], constants, count * sizeof(*constants)); - if (device->recording) - { - for (i = start_idx; i < count + start_idx; ++i) - device->recording->changed.pixelShaderConstantsB |= (1u << i); - return WINED3D_OK; - }
memcpy(&device->state.ps_consts_b[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) @@ -2618,12 +2498,6 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, count = WINED3D_MAX_CONSTS_I - start_idx;
memcpy(&device->update_stateblock_state->ps_consts_i[start_idx], constants, count * sizeof(*constants)); - if (device->recording) - { - for (i = start_idx; i < count + start_idx; ++i) - device->recording->changed.pixelShaderConstantsI |= (1u << i); - return WINED3D_OK; - }
memcpy(&device->state.ps_consts_i[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) @@ -2667,12 +2541,6 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, return WINED3DERR_INVALIDCALL;
memcpy(&device->update_stateblock_state->ps_consts_f[start_idx], constants, count * sizeof(*constants)); - if (device->recording) - { - memset(&device->recording->changed.ps_consts_f[start_idx], 1, - count * sizeof(*device->recording->changed.ps_consts_f)); - return WINED3D_OK; - }
memcpy(&device->state.ps_consts_f[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) @@ -3970,13 +3838,6 @@ void CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device,
device->update_stateblock_state->texture_states[stage][state] = value;
- if (device->recording) - { - TRACE("Recording... not performing anything.\n"); - device->recording->changed.textureState[stage] |= 1u << state; - return; - } - if (value == device->state.texture_states[stage][state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -4026,12 +3887,6 @@ void CDECL wined3d_device_set_texture(struct wined3d_device *device, wined3d_texture_decref(device->update_stateblock_state->textures[stage]); device->update_stateblock_state->textures[stage] = texture;
- if (device->recording) - { - device->recording->changed.textures |= 1u << stage; - return; - } - prev = device->state.textures[stage]; TRACE("Previous texture %p.\n", prev);
@@ -5538,11 +5393,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, if (reset_state) { TRACE("Resetting stateblock.\n"); - if (device->recording) - { - wined3d_stateblock_decref(device->recording); - device->recording = NULL; - } wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state);
@@ -5693,13 +5543,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso ERR("Texture resource %p is still in use, stage %u.\n", resource, i); device->state.textures[i] = NULL; } - - if (device->recording && &device->update_stateblock_state->textures[i]->resource == resource) - { - ERR("Texture resource %p is still in use by recording stateblock %p, stage %u.\n", - resource, device->recording, i); - device->update_stateblock_state->textures[i] = NULL; - } } break;
@@ -5711,13 +5554,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso ERR("Buffer resource %p is still in use, stream %u.\n", resource, i); device->state.streams[i].buffer = NULL; } - - if (device->recording && &device->update_stateblock_state->streams[i].buffer->resource == resource) - { - ERR("Buffer resource %p is still in use by stateblock %p, stream %u.\n", - resource, device->recording, i); - device->update_stateblock_state->streams[i].buffer = NULL; - } }
if (&device->state.index_buffer->resource == resource) @@ -5725,13 +5561,6 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_reso ERR("Buffer resource %p is still in use as index buffer.\n", resource); device->state.index_buffer = NULL; } - - if (device->recording && &device->update_stateblock_state->index_buffer->resource == resource) - { - ERR("Buffer resource %p is still in use by stateblock %p as index buffer.\n", - resource, device->recording); - device->update_stateblock_state->index_buffer = NULL; - } break;
default: diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8ebf377b114..0fedd706ce7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3282,7 +3282,6 @@ struct wined3d_device enum wined3d_feature_level feature_level;
struct wined3d_state state; - struct wined3d_stateblock *recording; struct wined3d_stateblock_state stateblock_state; struct wined3d_stateblock_state *update_stateblock_state;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 10 +++++----- dlls/d3d9/device.c | 4 ++-- dlls/d3d9/stateblock.c | 6 +++--- dlls/ddraw/ddraw.c | 7 ++++--- dlls/ddraw/device.c | 8 ++++---- dlls/wined3d/stateblock.c | 32 +++++++++++++++++--------------- dlls/wined3d/wined3d.spec | 6 +++--- include/wine/wined3d.h | 8 +++++--- 8 files changed, 43 insertions(+), 38 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 9dd3ef016f7..89cdb4e14b0 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1909,7 +1909,7 @@ static HRESULT WINAPI d3d8_device_BeginStateBlock(IDirect3DDevice8 *iface) return D3DERR_INVALIDCALL; }
- if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, WINED3D_SBT_RECORDED, &stateblock))) + if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, NULL, WINED3D_SBT_RECORDED, &stateblock))) device->update_state = device->recording = stateblock; wined3d_mutex_unlock();
@@ -1985,7 +1985,7 @@ static HRESULT WINAPI d3d8_device_ApplyStateBlock(IDirect3DDevice8 *iface, DWORD wined3d_mutex_unlock(); return D3DERR_INVALIDCALL; } - wined3d_stateblock_apply(stateblock); + wined3d_stateblock_apply(stateblock, device->state); device->sysmem_vb = 0; for (i = 0; i < D3D8_MAX_STREAMS; ++i) { @@ -2025,7 +2025,7 @@ static HRESULT WINAPI d3d8_device_CaptureStateBlock(IDirect3DDevice8 *iface, DWO wined3d_mutex_unlock(); return D3DERR_INVALIDCALL; } - wined3d_stateblock_capture(stateblock); + wined3d_stateblock_capture(stateblock, device->state); wined3d_mutex_unlock();
return D3D_OK; @@ -2081,7 +2081,7 @@ static HRESULT WINAPI d3d8_device_CreateStateBlock(IDirect3DDevice8 *iface, WARN("Trying to create a stateblock while recording, returning D3DERR_INVALIDCALL.\n"); return D3DERR_INVALIDCALL; } - hr = wined3d_stateblock_create(device->wined3d_device, (enum wined3d_stateblock_type)type, &stateblock); + hr = wined3d_stateblock_create(device->wined3d_device, device->state, (enum wined3d_stateblock_type)type, &stateblock); if (FAILED(hr)) { wined3d_mutex_unlock(); @@ -3685,7 +3685,7 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine return hr; }
- if (FAILED(hr = wined3d_stateblock_create(device->wined3d_device, WINED3D_SBT_PRIMARY, &device->state))) + if (FAILED(hr = wined3d_stateblock_create(device->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &device->state))) { ERR("Failed to create primary stateblock, hr %#x.\n", hr); wined3d_device_decref(device->wined3d_device); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 58bdd7458c2..2d66c569938 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2407,7 +2407,7 @@ static HRESULT WINAPI d3d9_device_BeginStateBlock(IDirect3DDevice9Ex *iface) return D3DERR_INVALIDCALL; }
- if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, WINED3D_SBT_RECORDED, &stateblock))) + if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, device->state, WINED3D_SBT_RECORDED, &stateblock))) device->update_state = device->recording = stateblock; wined3d_mutex_unlock();
@@ -4593,7 +4593,7 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine if (flags & D3DCREATE_ADAPTERGROUP_DEVICE) count = caps.NumberOfAdaptersInGroup;
- if (FAILED(hr = wined3d_stateblock_create(device->wined3d_device, WINED3D_SBT_PRIMARY, &device->state))) + if (FAILED(hr = wined3d_stateblock_create(device->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &device->state))) { ERR("Failed to create the primary stateblock, hr %#x.\n", hr); wined3d_device_decref(device->wined3d_device); diff --git a/dlls/d3d9/stateblock.c b/dlls/d3d9/stateblock.c index 02213280181..dfb8d8d7551 100644 --- a/dlls/d3d9/stateblock.c +++ b/dlls/d3d9/stateblock.c @@ -106,7 +106,7 @@ static HRESULT WINAPI d3d9_stateblock_Capture(IDirect3DStateBlock9 *iface) WARN("Trying to capture stateblock while recording, returning D3DERR_INVALIDCALL.\n"); return D3DERR_INVALIDCALL; } - wined3d_stateblock_capture(stateblock->wined3d_stateblock); + wined3d_stateblock_capture(stateblock->wined3d_stateblock, device->state); wined3d_mutex_unlock();
return D3D_OK; @@ -134,7 +134,7 @@ static HRESULT WINAPI d3d9_stateblock_Apply(IDirect3DStateBlock9 *iface) WARN("Trying to apply stateblock while recording, returning D3DERR_INVALIDCALL.\n"); return D3DERR_INVALIDCALL; } - wined3d_stateblock_apply(stateblock->wined3d_stateblock); + wined3d_stateblock_apply(stateblock->wined3d_stateblock, device->state); device->sysmem_vb = 0; for (i = 0; i < D3D9_MAX_STREAMS; ++i) { @@ -193,7 +193,7 @@ HRESULT stateblock_init(struct d3d9_stateblock *stateblock, struct d3d9_device * else { wined3d_mutex_lock(); - hr = wined3d_stateblock_create(device->wined3d_device, + hr = wined3d_stateblock_create(device->wined3d_device, device->state, (enum wined3d_stateblock_type)type, &stateblock->wined3d_stateblock); wined3d_mutex_unlock(); if (FAILED(hr)) diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 69ef612cd4a..d744df8c918 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -900,7 +900,8 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, { restore_state = TRUE;
- if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device, WINED3D_SBT_ALL, &stateblock))) + if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device, + ddraw->state, WINED3D_SBT_ALL, &stateblock))) { ERR("Failed to create stateblock, hr %#x.\n", hr); goto done; @@ -937,7 +938,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, wined3d_rendertarget_view_decref(rtv); }
- wined3d_stateblock_apply(stateblock); + wined3d_stateblock_apply(stateblock, ddraw->state); wined3d_stateblock_decref(stateblock); }
@@ -5026,7 +5027,7 @@ HRESULT ddraw_init(struct ddraw *ddraw, DWORD flags, enum wined3d_device_type de
list_init(&ddraw->surface_list);
- if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device, WINED3D_SBT_PRIMARY, &ddraw->state))) + if (FAILED(hr = wined3d_stateblock_create(ddraw->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &ddraw->state))) { ERR("Failed to create the primary stateblock, hr %#x.\n", hr); wined3d_device_decref(ddraw->wined3d_device); diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index faeb7ba1ff8..51576c81e28 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5642,7 +5642,7 @@ static HRESULT d3d_device7_BeginStateBlock(IDirect3DDevice7 *iface) WARN("Trying to begin a stateblock while recording, returning D3DERR_INBEGINSTATEBLOCK.\n"); return D3DERR_INBEGINSTATEBLOCK; } - if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, WINED3D_SBT_RECORDED, &stateblock))) + if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, NULL, WINED3D_SBT_RECORDED, &stateblock))) device->update_state = device->recording = stateblock; wined3d_mutex_unlock();
@@ -5822,7 +5822,7 @@ static HRESULT d3d_device7_ApplyStateBlock(IDirect3DDevice7 *iface, DWORD stateb return D3DERR_INVALIDSTATEBLOCK; }
- wined3d_stateblock_apply(wined3d_sb); + wined3d_stateblock_apply(wined3d_sb, device->state); wined3d_mutex_unlock();
return D3D_OK; @@ -5882,7 +5882,7 @@ static HRESULT d3d_device7_CaptureStateBlock(IDirect3DDevice7 *iface, DWORD stat return D3DERR_INVALIDSTATEBLOCK; }
- wined3d_stateblock_capture(wined3d_sb); + wined3d_stateblock_capture(wined3d_sb, device->state); wined3d_mutex_unlock();
return D3D_OK; @@ -6012,7 +6012,7 @@ static HRESULT d3d_device7_CreateStateBlock(IDirect3DDevice7 *iface, }
/* The D3DSTATEBLOCKTYPE enum is fine here. */ - hr = wined3d_stateblock_create(device->wined3d_device, type, &wined3d_sb); + hr = wined3d_stateblock_create(device->wined3d_device, device->state, type, &wined3d_sb); if (FAILED(hr)) { WARN("Failed to create stateblock, hr %#x.\n", hr); diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index dc714914ec3..1c3704c10a5 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -395,7 +395,7 @@ void CDECL wined3d_stateblock_init_contained_states(struct wined3d_stateblock *s } }
-static void stateblock_init_lights(struct list *dst_map, struct list *src_map) +static void stateblock_init_lights(struct list *dst_map, const struct list *src_map) { unsigned int i;
@@ -757,13 +757,14 @@ static void wined3d_state_record_lights(struct wined3d_light_state *dst_state, } }
-void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) +void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock, + const struct wined3d_stateblock *device_state) { - const struct wined3d_stateblock_state *state = &stateblock->device->stateblock_state; + const struct wined3d_stateblock_state *state = &device_state->stateblock_state; unsigned int i; DWORD map;
- TRACE("stateblock %p.\n", stateblock); + TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
if (stateblock->changed.vertexShader && stateblock->stateblock_state.vs != state->vs) { @@ -1029,14 +1030,15 @@ void CDECL wined3d_stateblock_capture(struct wined3d_stateblock *stateblock) TRACE("Capture done.\n"); }
-void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) +void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, + struct wined3d_stateblock *device_state) { - struct wined3d_stateblock_state *state = &stateblock->device->stateblock_state; + struct wined3d_stateblock_state *state = &device_state->stateblock_state; struct wined3d_device *device = stateblock->device; unsigned int i; DWORD map;
- TRACE("Applying stateblock %p to device %p.\n", stateblock, device); + TRACE("stateblock %p, device_state %p.\n", stateblock, device_state);
if (stateblock->changed.vertexShader) { @@ -1989,7 +1991,7 @@ void wined3d_stateblock_state_init(struct wined3d_stateblock_state *state,
}
-static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, +static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, const struct wined3d_stateblock *device_state, struct wined3d_device *device, enum wined3d_stateblock_type type) { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; @@ -2010,7 +2012,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, { case WINED3D_SBT_ALL: stateblock_init_lights(stateblock->stateblock_state.light_state.light_map, - device->stateblock_state.light_state.light_map); + device_state->stateblock_state.light_state.light_map); stateblock_savedstates_set_all(&stateblock->changed, d3d_info->limits.vs_uniform_count, d3d_info->limits.ps_uniform_count); break; @@ -2022,7 +2024,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
case WINED3D_SBT_VERTEX_STATE: stateblock_init_lights(stateblock->stateblock_state.light_state.light_map, - device->stateblock_state.light_state.light_map); + device_state->stateblock_state.light_state.light_map); stateblock_savedstates_set_vertex(&stateblock->changed, d3d_info->limits.vs_uniform_count); break; @@ -2033,7 +2035,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, }
wined3d_stateblock_init_contained_states(stateblock); - wined3d_stateblock_capture(stateblock); + wined3d_stateblock_capture(stateblock, device_state);
/* According to the tests, stream offset is not updated in the captured state if * the state was captured on state block creation. This is not the case for @@ -2044,19 +2046,19 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, return WINED3D_OK; }
-HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, +HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, const struct wined3d_stateblock *device_state, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock) { struct wined3d_stateblock *object; HRESULT hr;
- TRACE("device %p, type %#x, stateblock %p.\n", - device, type, stateblock); + TRACE("device %p, device_state %p, type %#x, stateblock %p.\n", + device, device_state, type, stateblock);
if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY;
- hr = stateblock_init(object, device, type); + hr = stateblock_init(object, device_state, device, type); if (FAILED(hr)) { WARN("Failed to initialize stateblock, hr %#x.\n", hr); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 9c05dd8e938..fed5ce1b128 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -255,9 +255,9 @@ @ cdecl wined3d_shader_resource_view_get_parent(ptr) @ cdecl wined3d_shader_resource_view_incref(ptr)
-@ cdecl wined3d_stateblock_apply(ptr) -@ cdecl wined3d_stateblock_capture(ptr) -@ cdecl wined3d_stateblock_create(ptr long ptr) +@ cdecl wined3d_stateblock_apply(ptr ptr) +@ cdecl wined3d_stateblock_capture(ptr ptr) +@ cdecl wined3d_stateblock_create(ptr ptr long ptr) @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) @ cdecl wined3d_stateblock_init_contained_states(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index f455cdb979c..eba14e9a022 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2659,9 +2659,11 @@ void __cdecl wined3d_shader_resource_view_generate_mipmaps(struct wined3d_shader void * __cdecl wined3d_shader_resource_view_get_parent(const struct wined3d_shader_resource_view *view); ULONG __cdecl wined3d_shader_resource_view_incref(struct wined3d_shader_resource_view *view);
-void __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock); -void __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock); -HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device, +void __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock, + struct wined3d_stateblock *device_state); +void __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock, + const struct wined3d_stateblock *device_state); +HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device, const struct wined3d_stateblock *device_state, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock); ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
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=60934
Your paranoid android.
=== debian10 (32 bit report) ===
d3d8: device.c:7265: Test failed: second window has pixel format 5, expected 1
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 100 +-------------------------------- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 3 insertions(+), 98 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 562caf8900a..f19a52c884a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1271,14 +1271,6 @@ HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UI stream = &device->state.streams[stream_idx]; prev_buffer = stream->buffer;
- if (buffer) - wined3d_buffer_incref(buffer); - if (device->update_stateblock_state->streams[stream_idx].buffer) - wined3d_buffer_decref(device->update_stateblock_state->streams[stream_idx].buffer); - device->update_stateblock_state->streams[stream_idx].buffer = buffer; - device->update_stateblock_state->streams[stream_idx].stride = stride; - device->update_stateblock_state->streams[stream_idx].offset = offset; - if (prev_buffer == buffer && stream->stride == stride && stream->offset == offset) @@ -1324,8 +1316,8 @@ HRESULT CDECL wined3d_device_get_stream_source(const struct wined3d_device *devi
HRESULT CDECL wined3d_device_set_stream_source_freq(struct wined3d_device *device, UINT stream_idx, UINT divider) { - UINT old_flags, old_freq, flags, freq; struct wined3d_stream_state *stream; + UINT old_flags, old_freq;
TRACE("device %p, stream_idx %u, divider %#x.\n", device, stream_idx, divider);
@@ -1350,14 +1342,8 @@ HRESULT CDECL wined3d_device_set_stream_source_freq(struct wined3d_device *devic old_flags = stream->flags; old_freq = stream->frequency;
- flags = divider & (WINED3DSTREAMSOURCE_INSTANCEDATA | WINED3DSTREAMSOURCE_INDEXEDDATA); - freq = divider & 0x7fffff; - - device->update_stateblock_state->streams[stream_idx].flags = flags; - device->update_stateblock_state->streams[stream_idx].frequency = freq; - - stream->flags = flags; - stream->frequency = freq; + stream->flags = divider & (WINED3DSTREAMSOURCE_INSTANCEDATA | WINED3DSTREAMSOURCE_INDEXEDDATA); + stream->frequency = divider & 0x7fffff; if (stream->frequency != old_freq || stream->flags != old_flags) wined3d_cs_emit_set_stream_source_freq(device->cs, stream_idx, stream->frequency, stream->flags);
@@ -1389,9 +1375,6 @@ void CDECL wined3d_device_set_transform(struct wined3d_device *device, TRACE("%.8e %.8e %.8e %.8e\n", matrix->_31, matrix->_32, matrix->_33, matrix->_34); TRACE("%.8e %.8e %.8e %.8e\n", matrix->_41, matrix->_42, matrix->_43, matrix->_44);
- /* Handle recording of state blocks. */ - device->update_stateblock_state->transforms[d3dts] = *matrix; - /* If the new matrix is the same as the current one, * we cut off any further processing. this seems to be a reasonable * optimization because as was noticed, some apps (warcraft3 for example) @@ -1481,9 +1464,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; }
- if (FAILED(hr = wined3d_light_state_set_light(&device->update_stateblock_state->light_state, light_idx, light, &object))) - return hr; - if (FAILED(hr = wined3d_light_state_set_light(&device->state.light_state, light_idx, light, &object))) return hr;
@@ -1598,19 +1578,9 @@ HRESULT CDECL wined3d_device_get_light(const struct wined3d_device *device, HRESULT CDECL wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable) { struct wined3d_light_info *light_info; - HRESULT hr;
TRACE("device %p, light_idx %u, enable %#x.\n", device, light_idx, enable);
- if (!(light_info = wined3d_light_state_get_light(&device->update_stateblock_state->light_state, light_idx))) - { - if (FAILED(hr = wined3d_light_state_set_light(&device->update_stateblock_state->light_state, light_idx, - &WINED3D_default_light, &light_info))) - return hr; - } - wined3d_light_state_enable_light(&device->update_stateblock_state->light_state, - &device->adapter->d3d_info, light_info, enable); - /* Special case - enabling an undefined light creates one with a strict set of parameters. */ if (!(light_info = wined3d_light_state_get_light(&device->state.light_state, light_idx))) { @@ -1657,8 +1627,6 @@ HRESULT CDECL wined3d_device_set_clip_plane(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; }
- device->update_stateblock_state->clip_planes[plane_idx] = *plane; - if (!memcmp(&device->state.clip_planes[plane_idx], plane, sizeof(*plane))) { TRACE("Application is setting old values over, nothing to do.\n"); @@ -1714,8 +1682,6 @@ void CDECL wined3d_device_set_material(struct wined3d_device *device, const stru { TRACE("device %p, material %p.\n", device, material);
- device->update_stateblock_state->material = *material; - device->state.material = *material; wined3d_cs_emit_set_material(device->cs, material); } @@ -1747,13 +1713,6 @@ void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device, prev_format = device->state.index_format; prev_offset = device->state.index_offset;
- if (buffer) - wined3d_buffer_incref(buffer); - if (device->update_stateblock_state->index_buffer) - wined3d_buffer_decref(device->update_stateblock_state->index_buffer); - device->update_stateblock_state->index_buffer = buffer; - device->update_stateblock_state->index_format = format_id; - if (prev_buffer == buffer && prev_format == format_id && prev_offset == offset) return;
@@ -1782,7 +1741,6 @@ void CDECL wined3d_device_set_base_vertex_index(struct wined3d_device *device, I { TRACE("device %p, base_index %d.\n", device, base_index);
- device->update_stateblock_state->base_vertex_index = base_index; device->state.base_vertex_index = base_index; }
@@ -1806,9 +1764,6 @@ void CDECL wined3d_device_set_viewports(struct wined3d_device *device, unsigned viewports[i].width, viewports[i].height, viewports[i].min_z, viewports[i].max_z); }
- if (viewport_count) - device->update_stateblock_state->viewport = viewports[0]; - if (viewport_count) memcpy(device->state.viewports, viewports, viewport_count * sizeof(*viewports)); else @@ -1859,8 +1814,6 @@ void CDECL wined3d_device_set_blend_state(struct wined3d_device *device,
TRACE("device %p, blend_state %p, blend_factor %s.\n", device, blend_state, debug_color(blend_factor));
- device->update_stateblock_state->blend_factor = *blend_factor; - prev = state->blend_state; if (prev == blend_state && !memcmp(blend_factor, &state->blend_factor, sizeof(*blend_factor))) return; @@ -1922,8 +1875,6 @@ void CDECL wined3d_device_set_render_state(struct wined3d_device *device, return; }
- device->update_stateblock_state->rs[state] = value; - if (value == device->state.render_states[state]) TRACE("Application is setting the old value over, nothing to do.\n"); else @@ -1961,8 +1912,6 @@ void CDECL wined3d_device_set_sampler_state(struct wined3d_device *device, return; /* Windows accepts overflowing this array ... we do not. */ }
- device->update_stateblock_state->sampler_states[sampler_idx][state] = value; - if (value == device->state.sampler_states[sampler_idx][state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -2003,9 +1952,6 @@ void CDECL wined3d_device_set_scissor_rects(struct wined3d_device *device, unsig TRACE("%u: %s\n", i, wine_dbgstr_rect(&rects[i])); }
- if (rect_count) - device->update_stateblock_state->scissor_rect = rects[0]; - if (device->state.scissor_rect_count == rect_count && !memcmp(device->state.scissor_rects, rects, rect_count * sizeof(*rects))) { @@ -2042,12 +1988,6 @@ void CDECL wined3d_device_set_vertex_declaration(struct wined3d_device *device,
TRACE("device %p, declaration %p.\n", device, declaration);
- if (declaration) - wined3d_vertex_declaration_incref(declaration); - if (device->update_stateblock_state->vertex_declaration) - wined3d_vertex_declaration_decref(device->update_stateblock_state->vertex_declaration); - device->update_stateblock_state->vertex_declaration = declaration; - if (declaration == prev) return;
@@ -2072,12 +2012,6 @@ void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struc
TRACE("device %p, shader %p.\n", device, shader);
- if (shader) - wined3d_shader_incref(shader); - if (device->update_stateblock_state->vs) - wined3d_shader_decref(device->update_stateblock_state->vs); - device->update_stateblock_state->vs = shader; - if (shader == prev) return;
@@ -2262,8 +2196,6 @@ HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device, if (count > WINED3D_MAX_CONSTS_B - start_idx) count = WINED3D_MAX_CONSTS_B - start_idx;
- memcpy(&device->update_stateblock_state->vs_consts_b[start_idx], constants, count * sizeof(*constants)); - memcpy(&device->state.vs_consts_b[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { @@ -2306,8 +2238,6 @@ HRESULT CDECL wined3d_device_set_vs_consts_i(struct wined3d_device *device, if (count > WINED3D_MAX_CONSTS_I - start_idx) count = WINED3D_MAX_CONSTS_I - start_idx;
- memcpy(&device->update_stateblock_state->vs_consts_i[start_idx], constants, count * sizeof(*constants)); - memcpy(&device->state.vs_consts_i[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { @@ -2348,8 +2278,6 @@ HRESULT CDECL wined3d_device_set_vs_consts_f(struct wined3d_device *device, || count > d3d_info->limits.vs_uniform_count - start_idx) return WINED3DERR_INVALIDCALL;
- memcpy(&device->update_stateblock_state->vs_consts_f[start_idx], constants, count * sizeof(*constants)); - memcpy(&device->state.vs_consts_f[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { @@ -2385,12 +2313,6 @@ void CDECL wined3d_device_set_pixel_shader(struct wined3d_device *device, struct
TRACE("device %p, shader %p.\n", device, shader);
- if (shader) - wined3d_shader_incref(shader); - if (device->update_stateblock_state->ps) - wined3d_shader_decref(device->update_stateblock_state->ps); - device->update_stateblock_state->ps = shader; - if (shader == prev) return;
@@ -2453,8 +2375,6 @@ HRESULT CDECL wined3d_device_set_ps_consts_b(struct wined3d_device *device, if (count > WINED3D_MAX_CONSTS_B - start_idx) count = WINED3D_MAX_CONSTS_B - start_idx;
- memcpy(&device->update_stateblock_state->ps_consts_b[start_idx], constants, count * sizeof(*constants)); - memcpy(&device->state.ps_consts_b[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { @@ -2497,8 +2417,6 @@ HRESULT CDECL wined3d_device_set_ps_consts_i(struct wined3d_device *device, if (count > WINED3D_MAX_CONSTS_I - start_idx) count = WINED3D_MAX_CONSTS_I - start_idx;
- memcpy(&device->update_stateblock_state->ps_consts_i[start_idx], constants, count * sizeof(*constants)); - memcpy(&device->state.ps_consts_i[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { @@ -2540,8 +2458,6 @@ HRESULT CDECL wined3d_device_set_ps_consts_f(struct wined3d_device *device, || count > d3d_info->limits.ps_uniform_count - start_idx) return WINED3DERR_INVALIDCALL;
- memcpy(&device->update_stateblock_state->ps_consts_f[start_idx], constants, count * sizeof(*constants)); - memcpy(&device->state.ps_consts_f[start_idx], constants, count * sizeof(*constants)); if (TRACE_ON(d3d)) { @@ -3836,8 +3752,6 @@ void CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device, return; }
- device->update_stateblock_state->texture_states[stage][state] = value; - if (value == device->state.texture_states[stage][state]) { TRACE("Application is setting the old value over, nothing to do.\n"); @@ -3881,12 +3795,6 @@ void CDECL wined3d_device_set_texture(struct wined3d_device *device, return; }
- if (texture) - wined3d_texture_incref(texture); - if (device->update_stateblock_state->textures[stage]) - wined3d_texture_decref(device->update_stateblock_state->textures[stage]); - device->update_stateblock_state->textures[stage] = texture; - prev = device->state.textures[stage]; TRACE("Previous texture %p.\n", prev);
@@ -5403,7 +5311,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, state_init(&device->state, &device->fb, &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT); memset(&device->stateblock_state, 0, sizeof(device->stateblock_state)); wined3d_stateblock_state_init(&device->stateblock_state, device, WINED3D_STATE_INIT_DEFAULT); - device->update_stateblock_state = &device->stateblock_state;
device_init_swapchain_state(device, swapchain); if (wined3d_settings.logo) @@ -5653,7 +5560,6 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined
state_init(&device->state, &device->fb, &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT); wined3d_stateblock_state_init(&device->stateblock_state, device, WINED3D_STATE_INIT_DEFAULT); - device->update_stateblock_state = &device->stateblock_state;
device->max_frame_latency = 3;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0fedd706ce7..2e2707c5bd2 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3283,7 +3283,6 @@ struct wined3d_device
struct wined3d_state state; struct wined3d_stateblock_state stateblock_state; - struct wined3d_stateblock_state *update_stateblock_state;
/* Internal use fields */ struct wined3d_device_creation_parameters create_parms;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 11 +---------- dlls/wined3d/wined3d_private.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f19a52c884a..98559e4f6c6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -529,8 +529,6 @@ void wined3d_device_cleanup(struct wined3d_device *device) if (device->swapchain_count) wined3d_device_uninit_3d(device);
- wined3d_stateblock_state_cleanup(&device->stateblock_state); - wined3d_cs_destroy(device->cs);
for (i = 0; i < ARRAY_SIZE(device->multistate_funcs); ++i) @@ -4763,12 +4761,10 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device state->viewports[0].max_z = 1.0f; state->viewport_count = 1; wined3d_cs_emit_set_viewports(device->cs, 1, state->viewports); - device->stateblock_state.viewport = state->viewports[0];
SetRect(&state->scissor_rects[0], 0, 0, view->width, view->height); state->scissor_rect_count = 1; wined3d_cs_emit_set_scissor_rects(device->cs, 1, state->scissor_rects); - device->stateblock_state.scissor_rect = state->scissor_rects[0]; }
prev = device->fb.render_targets[view_idx]; @@ -5103,7 +5099,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, wined3d_texture_decref(device->cursor_texture); device->cursor_texture = NULL; } - wined3d_stateblock_state_cleanup(&device->stateblock_state); state_unbind_resources(&device->state); }
@@ -5300,7 +5295,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
if (reset_state) { - TRACE("Resetting stateblock.\n"); + TRACE("Resetting state.\n"); wined3d_cs_emit_reset_state(device->cs); state_cleanup(&device->state);
@@ -5309,8 +5304,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
memset(&device->state, 0, sizeof(device->state)); state_init(&device->state, &device->fb, &device->adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT); - memset(&device->stateblock_state, 0, sizeof(device->stateblock_state)); - wined3d_stateblock_state_init(&device->stateblock_state, device, WINED3D_STATE_INIT_DEFAULT);
device_init_swapchain_state(device, swapchain); if (wined3d_settings.logo) @@ -5559,7 +5552,6 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined }
state_init(&device->state, &device->fb, &adapter->d3d_info, WINED3D_STATE_INIT_DEFAULT); - wined3d_stateblock_state_init(&device->stateblock_state, device, WINED3D_STATE_INIT_DEFAULT);
device->max_frame_latency = 3;
@@ -5567,7 +5559,6 @@ HRESULT wined3d_device_init(struct wined3d_device *device, struct wined3d *wined { WARN("Failed to create command stream.\n"); state_cleanup(&device->state); - wined3d_stateblock_state_cleanup(&device->stateblock_state); hr = E_FAIL; goto err; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 2e2707c5bd2..3ae7dab858e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3282,7 +3282,6 @@ struct wined3d_device enum wined3d_feature_level feature_level;
struct wined3d_state state; - struct wined3d_stateblock_state stateblock_state;
/* Internal use fields */ struct wined3d_device_creation_parameters create_parms;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com