Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/stateblock.c | 8 ++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 1 + 3 files changed, 10 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 1d522ad89b8..df0bca33b0b 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1555,6 +1555,14 @@ void CDECL wined3d_stateblock_set_viewport(struct wined3d_stateblock *stateblock stateblock->changed.viewport = TRUE; }
+void CDECL wined3d_stateblock_set_scissor_rect(struct wined3d_stateblock *stateblock, const RECT *rect) +{ + TRACE("stateblock %p, rect %s.\n", stateblock, wine_dbgstr_rect(rect)); + + stateblock->stateblock_state.scissor_rect = *rect; + stateblock->changed.scissorRect = TRUE; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 48e5ea954bc..4041db56da1 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -272,6 +272,7 @@ @ cdecl wined3d_stateblock_set_ps_consts_i(ptr long long ptr) @ cdecl wined3d_stateblock_set_render_state(ptr long long) @ cdecl wined3d_stateblock_set_sampler_state(ptr long long long) +@ cdecl wined3d_stateblock_set_scissor_rect(ptr ptr) @ cdecl wined3d_stateblock_set_texture(ptr long ptr) @ cdecl wined3d_stateblock_set_texture_stage_state(ptr long long long) @ cdecl wined3d_stateblock_set_transform(ptr long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index c311ded731e..e7236786013 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2684,6 +2684,7 @@ void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stat enum wined3d_render_state state, DWORD value); void __cdecl wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, UINT sampler_idx, enum wined3d_sampler_state state, DWORD value); +void __cdecl wined3d_stateblock_set_scissor_rect(struct wined3d_stateblock *stateblock, const RECT *rect); void __cdecl wined3d_stateblock_set_texture(struct wined3d_stateblock *stateblock, UINT stage, struct wined3d_texture *texture); void __cdecl wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock, UINT stage, enum wined3d_texture_stage_state state, DWORD value);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index b4ba9223e09..d83c24a640b 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2685,7 +2685,9 @@ static HRESULT WINAPI d3d9_device_SetScissorRect(IDirect3DDevice9Ex *iface, cons TRACE("iface %p, rect %p.\n", iface, rect);
wined3d_mutex_lock(); - wined3d_device_set_scissor_rects(device->wined3d_device, 1, rect); + wined3d_stateblock_set_scissor_rect(device->update_state, rect); + if (!device->recording) + wined3d_device_set_scissor_rects(device->wined3d_device, 1, rect); wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/stateblock.c | 14 ++++++++++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 17 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index df0bca33b0b..7d2dcffba5f 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1563,6 +1563,20 @@ void CDECL wined3d_stateblock_set_scissor_rect(struct wined3d_stateblock *stateb stateblock->changed.scissorRect = TRUE; }
+void CDECL wined3d_stateblock_set_index_buffer(struct wined3d_stateblock *stateblock, + struct wined3d_buffer *buffer, enum wined3d_format_id format_id) +{ + TRACE("stateblock %p, buffer %p, format %s.\n", stateblock, buffer, debug_d3dformat(format_id)); + + if (buffer) + wined3d_buffer_incref(buffer); + if (stateblock->stateblock_state.index_buffer) + wined3d_buffer_decref(stateblock->stateblock_state.index_buffer); + stateblock->stateblock_state.index_buffer = buffer; + stateblock->stateblock_state.index_format = format_id; + stateblock->changed.indices = TRUE; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 4041db56da1..614886cc4a1 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -265,6 +265,7 @@ @ cdecl wined3d_stateblock_reset(ptr) @ cdecl wined3d_stateblock_set_blend_factor(ptr ptr) @ cdecl wined3d_stateblock_set_clip_plane(ptr long ptr) +@ cdecl wined3d_stateblock_set_index_buffer(ptr ptr long) @ cdecl wined3d_stateblock_set_material(ptr ptr) @ cdecl wined3d_stateblock_set_pixel_shader(ptr ptr) @ cdecl wined3d_stateblock_set_ps_consts_b(ptr long long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index e7236786013..7c6b2ef1078 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2672,6 +2672,8 @@ void __cdecl wined3d_stateblock_set_blend_factor(struct wined3d_stateblock *stat const struct wined3d_color *blend_factor); HRESULT __cdecl wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock, UINT plane_idx, const struct wined3d_vec4 *plane); +void __cdecl wined3d_stateblock_set_index_buffer(struct wined3d_stateblock *stateblock, + struct wined3d_buffer *index_buffer, enum wined3d_format_id format_id); void __cdecl wined3d_stateblock_set_material(struct wined3d_stateblock *stateblock, const struct wined3d_material *material); void __cdecl wined3d_stateblock_set_pixel_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader); HRESULT __cdecl wined3d_stateblock_set_ps_consts_b(struct wined3d_stateblock *stateblock,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d9/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index d83c24a640b..52a62edecb1 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3721,9 +3721,12 @@ static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3 wined3d_buffer = ib->wined3d_buffer;
wined3d_mutex_lock(); - wined3d_device_set_index_buffer(device->wined3d_device, wined3d_buffer, ib ? ib->format : WINED3DFMT_UNKNOWN, 0); + wined3d_stateblock_set_index_buffer(device->update_state, wined3d_buffer, ib ? ib->format : WINED3DFMT_UNKNOWN); if (!device->recording) + { + wined3d_device_set_index_buffer(device->wined3d_device, wined3d_buffer, ib ? ib->format : WINED3DFMT_UNKNOWN, 0); device->sysmem_ib = ib && ib->draw_buffer; + } wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/stateblock.c | 7 +++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 1 + 3 files changed, 9 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 7d2dcffba5f..f8724da967c 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1577,6 +1577,13 @@ void CDECL wined3d_stateblock_set_index_buffer(struct wined3d_stateblock *stateb stateblock->changed.indices = TRUE; }
+void CDECL wined3d_stateblock_set_base_vertex_index(struct wined3d_stateblock *stateblock, INT base_index) +{ + TRACE("stateblock %p, base_index %d.\n", stateblock, base_index); + + stateblock->stateblock_state.base_vertex_index = base_index; +} + static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info) { union diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 614886cc4a1..8a9c9858e92 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -263,6 +263,7 @@ @ cdecl wined3d_stateblock_decref(ptr) @ cdecl wined3d_stateblock_incref(ptr) @ cdecl wined3d_stateblock_reset(ptr) +@ cdecl wined3d_stateblock_set_base_vertex_index(ptr long) @ cdecl wined3d_stateblock_set_blend_factor(ptr ptr) @ cdecl wined3d_stateblock_set_clip_plane(ptr long ptr) @ cdecl wined3d_stateblock_set_index_buffer(ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 7c6b2ef1078..10e2ae70ebd 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2668,6 +2668,7 @@ HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device, ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); void __cdecl wined3d_stateblock_reset(struct wined3d_stateblock *stateblock); +void __cdecl wined3d_stateblock_set_base_vertex_index(struct wined3d_stateblock *stateblock, INT base_index); void __cdecl wined3d_stateblock_set_blend_factor(struct wined3d_stateblock *stateblock, const struct wined3d_color *blend_factor); HRESULT __cdecl wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock,
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, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 8cd85776f14..5f2235fb72c 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -3063,10 +3063,14 @@ static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface, * problem) */ wined3d_mutex_lock(); - wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx); - wined3d_device_set_index_buffer(device->wined3d_device, wined3d_buffer, ib ? ib->format : WINED3DFMT_UNKNOWN, 0); + wined3d_stateblock_set_base_vertex_index(device->update_state, base_vertex_idx); + wined3d_stateblock_set_index_buffer(device->update_state, wined3d_buffer, ib ? ib->format : WINED3DFMT_UNKNOWN); if (!device->recording) + { + wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_idx); + wined3d_device_set_index_buffer(device->wined3d_device, wined3d_buffer, ib ? ib->format : WINED3DFMT_UNKNOWN, 0); device->sysmem_ib = ib && ib->draw_buffer; + } wined3d_mutex_unlock();
return D3D_OK;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com