Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d8/device.c | 13 +++++++++---- dlls/d3d8/tests/device.c | 2 +- dlls/d3d9/device.c | 19 +++++++++++-------- dlls/ddraw/device.c | 6 +++--- dlls/wined3d/device.c | 14 +------------- include/wine/wined3d.h | 2 +- 6 files changed, 26 insertions(+), 30 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index f4bdb748275..f0bfab660a7 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2518,22 +2518,27 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitive(IDirect3DDevice8 *iface, struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); unsigned int index_count; int base_vertex_index; - HRESULT hr;
TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, start_idx %u, primitive_count %u.\n", iface, primitive_type, min_vertex_idx, vertex_count, start_idx, primitive_count);
index_count = vertex_count_from_primitive_count(primitive_type, primitive_count); wined3d_mutex_lock(); + if (!device->stateblock_state->index_buffer) + { + wined3d_mutex_unlock(); + WARN("Index buffer not set, returning D3D_OK.\n"); + return D3D_OK; + } base_vertex_index = device->stateblock_state->base_vertex_index; d3d8_device_upload_sysmem_vertex_buffers(device, base_vertex_index + min_vertex_idx, vertex_count); d3d8_device_upload_sysmem_index_buffer(device, start_idx, index_count); wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count); + wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
/* The caller is responsible for wined3d locking */ @@ -2752,7 +2757,7 @@ static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface
wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count); + wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); wined3d_stateblock_set_index_buffer(device->state, NULL, WINED3DFMT_UNKNOWN); diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 4eb1ab65e72..fc94dcaaad7 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -10176,7 +10176,7 @@ static void test_draw_primitive(void) hr = IDirect3DDevice8_SetIndices(device, NULL, 0); ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); hr = IDirect3DDevice8_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 4, 0, 2); - todo_wine ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed, hr %#x.\n", hr); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
/* Valid index buffer, NULL stream source. */ hr = IDirect3DDevice8_SetIndices(device, index_buffer, 1); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 229fc59521c..aa216edfcc0 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3049,7 +3049,6 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); unsigned int index_count; - HRESULT hr;
TRACE("iface %p, primitive_type %#x, base_vertex_idx %u, min_vertex_idx %u, " "vertex_count %u, start_idx %u, primitive_count %u.\n", @@ -3063,6 +3062,12 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface WARN("Called without a valid vertex declaration set.\n"); return D3DERR_INVALIDCALL; } + if (!device->stateblock_state->index_buffer) + { + wined3d_mutex_unlock(); + WARN("Called without a valid index buffer set.\n"); + return D3DERR_INVALIDCALL; + } index_count = vertex_count_from_primitive_count(primitive_type, primitive_count); d3d9_device_upload_sysmem_vertex_buffers(device, base_vertex_idx, min_vertex_idx, vertex_count); d3d9_device_upload_sysmem_index_buffer(device, start_idx, index_count); @@ -3070,12 +3075,11 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface wined3d_stateblock_set_base_vertex_index(device->state, base_vertex_idx); wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); - hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count); - if (SUCCEEDED(hr)) - d3d9_rts_flag_auto_gen_mipmap(device); + wined3d_device_draw_indexed_primitive(device->wined3d_device, start_idx, index_count); + d3d9_rts_flag_auto_gen_mipmap(device); wined3d_mutex_unlock();
- return hr; + return D3D_OK; }
/* The caller is responsible for wined3d locking */ @@ -3322,13 +3326,12 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
wined3d_device_apply_stateblock(device->wined3d_device, device->state); wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_d3d(primitive_type), 0); - hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count); + wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / idx_fmt_size, idx_count);
wined3d_stateblock_set_stream_source(device->state, 0, NULL, 0, 0); wined3d_stateblock_set_index_buffer(device->state, NULL, WINED3DFMT_UNKNOWN);
- if (SUCCEEDED(hr)) - d3d9_rts_flag_auto_gen_mipmap(device); + d3d9_rts_flag_auto_gen_mipmap(device);
done: wined3d_mutex_unlock(); diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index bf2e77e5b71..ce937b0c543 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -3736,7 +3736,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface, wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / stride); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); - hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(*indices), index_count); + wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(*indices), index_count);
done: wined3d_mutex_unlock(); @@ -4200,7 +4200,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface, wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); - hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count); + wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
done: wined3d_mutex_unlock(); @@ -4478,7 +4478,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, wined3d_device_set_primitive_type(device->wined3d_device, wined3d_primitive_type_from_ddraw(primitive_type), 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); d3d_device_sync_surfaces(device); - hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count); + wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
wined3d_mutex_unlock();
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 71ca6740c37..0389a73b924 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4480,26 +4480,14 @@ void CDECL wined3d_device_draw_primitive_instanced_indirect(struct wined3d_devic state->patch_vertex_count, buffer, offset, false); }
-HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) +void CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) { struct wined3d_state *state = device->cs->c.state;
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
- if (!state->index_buffer) - { - /* D3D9 returns D3DERR_INVALIDCALL when DrawIndexedPrimitive is called - * without an index buffer set. (The first time at least...) - * D3D8 simply dies, but I doubt it can do much harm to return - * D3DERR_INVALIDCALL there as well. */ - WARN("Called without a valid index buffer set, returning WINED3DERR_INVALIDCALL.\n"); - return WINED3DERR_INVALIDCALL; - } - wined3d_device_context_emit_draw(&device->cs->c, state->primitive_type, state->patch_vertex_count, state->base_vertex_index, start_idx, index_count, 0, 0, true); - - return WINED3D_OK; }
void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device *device, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 197a56d1952..bc6f2e29b7f 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2372,7 +2372,7 @@ void __cdecl wined3d_device_dispatch_compute(struct wined3d_device *device, unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z); void __cdecl wined3d_device_dispatch_compute_indirect(struct wined3d_device *device, struct wined3d_buffer *buffer, unsigned int offset); -HRESULT __cdecl wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count); +void __cdecl wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count); void __cdecl wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device *device, UINT start_idx, UINT index_count, UINT start_instance, UINT instance_count); void __cdecl wined3d_device_draw_indexed_primitive_instanced_indirect(struct wined3d_device *device,
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/device.c | 19 +++++++++++++++---- dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 0389a73b924..c5b3f10bac2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2409,6 +2409,18 @@ void CDECL wined3d_device_context_draw(struct wined3d_device_context *context, u 0, start_vertex, vertex_count, start_instance, instance_count, false); }
+void CDECL wined3d_device_context_draw_indexed(struct wined3d_device_context *context, unsigned int base_vertex_index, + unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count) +{ + struct wined3d_state *state = context->state; + + TRACE("context %p, base_vertex_index %u, start_index %u, index_count %u, start_instance %u, instance_count %u.\n", + context, base_vertex_index, start_index, index_count, start_instance, instance_count); + + wined3d_device_context_emit_draw(context, state->primitive_type, state->patch_vertex_count, + base_vertex_index, start_index, index_count, 0, 0, true); +} + void CDECL wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader) { TRACE("device %p, shader %p.\n", device, shader); @@ -4486,8 +4498,7 @@ void CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device,
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
- wined3d_device_context_emit_draw(&device->cs->c, state->primitive_type, state->patch_vertex_count, - state->base_vertex_index, start_idx, index_count, 0, 0, true); + wined3d_device_context_draw_indexed(&device->cs->c, state->base_vertex_index, start_idx, index_count, 0, 0); }
void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device *device, @@ -4498,8 +4509,8 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device TRACE("device %p, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n", device, start_idx, index_count, start_instance, instance_count);
- wined3d_device_context_emit_draw(&device->cs->c, state->primitive_type, state->patch_vertex_count, - state->base_vertex_index, start_idx, index_count, start_instance, instance_count, true); + wined3d_device_context_draw_indexed(&device->cs->c, state->base_vertex_index, + start_idx, index_count, start_instance, instance_count); }
void CDECL wined3d_device_draw_indexed_primitive_instanced_indirect(struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 087a6bead13..bae5a6d42f0 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -167,6 +167,7 @@ @ cdecl wined3d_device_validate_device(ptr ptr)
@ cdecl wined3d_device_context_draw(ptr long long long long) +@ cdecl wined3d_device_context_draw_indexed(ptr long long long long long) @ cdecl wined3d_device_context_dispatch(ptr long long long) @ cdecl wined3d_device_context_dispatch_indirect(ptr ptr long) @ cdecl wined3d_device_context_set_blend_state(ptr ptr ptr long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index bc6f2e29b7f..0ae0929d587 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2561,6 +2561,8 @@ void __cdecl wined3d_device_context_dispatch_indirect(struct wined3d_device_cont struct wined3d_buffer *buffer, unsigned int offset); void __cdecl wined3d_device_context_draw(struct wined3d_device_context *context, unsigned int start_vertex, unsigned int vertex_count, unsigned int start_instance, unsigned int instance_count); +void __cdecl wined3d_device_context_draw_indexed(struct wined3d_device_context *context, unsigned int base_vertex_index, + unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count); void __cdecl wined3d_device_context_set_blend_state(struct wined3d_device_context *context, struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask); void __cdecl wined3d_device_context_set_constant_buffer(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=88028
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 Task: Patch failed to apply
On Wed, 31 Mar 2021 at 18:38, Zebediah Figura z.figura12@gmail.com wrote:
+void CDECL wined3d_device_context_draw_indexed(struct wined3d_device_context *context, unsigned int base_vertex_index,
unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count)
The base vertex index is signed. Passing it as an unsigned integer in the API will probably work out fine in practice, but it would probably be best avoided.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4c8aa8c854c..7311f6e4d7b 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -575,14 +575,14 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetShader(ID3D11DeviceCo static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexed(ID3D11DeviceContext1 *iface, UINT index_count, UINT start_index_location, INT base_vertex_location) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n", iface, index_count, start_index_location, base_vertex_location);
wined3d_mutex_lock(); - wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_location); - wined3d_device_draw_indexed_primitive(device->wined3d_device, start_index_location, index_count); + wined3d_device_context_draw_indexed(context->wined3d_context, + base_vertex_location, start_index_location, index_count, 0, 0); wined3d_mutex_unlock(); }
@@ -703,7 +703,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstanced(ID3D1 UINT instance_index_count, UINT instance_count, UINT start_index_location, INT base_vertex_location, UINT start_instance_location) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface);
TRACE("iface %p, instance_index_count %u, instance_count %u, start_index_location %u, " "base_vertex_location %d, start_instance_location %u.\n", @@ -711,9 +711,8 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstanced(ID3D1 base_vertex_location, start_instance_location);
wined3d_mutex_lock(); - wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_location); - wined3d_device_draw_indexed_primitive_instanced(device->wined3d_device, start_index_location, - instance_index_count, start_instance_location, instance_count); + wined3d_device_context_draw_indexed(context->wined3d_context, base_vertex_location, + start_index_location, instance_index_count, start_instance_location, instance_count); wined3d_mutex_unlock(); }
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=88029
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 Task: Patch failed to apply
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/cs.c | 16 ++++++++-------- dlls/wined3d/device.c | 10 ++-------- dlls/wined3d/wined3d.spec | 1 + dlls/wined3d/wined3d_private.h | 3 --- include/wine/wined3d.h | 3 +++ 5 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index cbc97d3614a..ef3c0c76c14 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -1072,17 +1072,17 @@ void wined3d_device_context_emit_draw(struct wined3d_device_context *context, wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); }
-void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, enum wined3d_primitive_type primitive_type, - unsigned int patch_vertex_count, struct wined3d_buffer *buffer, unsigned int offset, bool indexed) +void CDECL wined3d_device_context_draw_indirect(struct wined3d_device_context *context, + struct wined3d_buffer *buffer, unsigned int offset, bool indexed) { - const struct wined3d_d3d_info *d3d_info = &cs->c.device->adapter->d3d_info; - const struct wined3d_state *state = cs->c.state; + const struct wined3d_d3d_info *d3d_info = &context->device->adapter->d3d_info; + const struct wined3d_state *state = context->state; struct wined3d_cs_draw *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_DRAW; - op->primitive_type = primitive_type; - op->patch_vertex_count = patch_vertex_count; + op->primitive_type = state->primitive_type; + op->patch_vertex_count = state->patch_vertex_count; op->parameters.indirect = TRUE; op->parameters.u.indirect.buffer = buffer; op->parameters.u.indirect.offset = offset; @@ -1091,7 +1091,7 @@ void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, enum wined3d_primitive acquire_graphics_pipeline_resources(state, indexed, d3d_info); wined3d_resource_acquire(&buffer->resource);
- wined3d_device_context_submit(&cs->c, WINED3D_CS_QUEUE_DEFAULT); + wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); }
static void wined3d_cs_exec_flush(struct wined3d_cs *cs, const void *data) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c5b3f10bac2..38292e9daa8 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4484,12 +4484,9 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device void CDECL wined3d_device_draw_primitive_instanced_indirect(struct wined3d_device *device, struct wined3d_buffer *buffer, unsigned int offset) { - struct wined3d_state *state = device->cs->c.state; - TRACE("device %p, buffer %p, offset %u.\n", device, buffer, offset);
- wined3d_cs_emit_draw_indirect(device->cs, state->primitive_type, - state->patch_vertex_count, buffer, offset, false); + wined3d_device_context_draw_indirect(&device->cs->c, buffer, offset, true); }
void CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count) @@ -4516,12 +4513,9 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device void CDECL wined3d_device_draw_indexed_primitive_instanced_indirect(struct wined3d_device *device, struct wined3d_buffer *buffer, unsigned int offset) { - struct wined3d_state *state = device->cs->c.state; - TRACE("device %p, buffer %p, offset %u.\n", device, buffer, offset);
- wined3d_cs_emit_draw_indirect(device->cs, state->primitive_type, - state->patch_vertex_count, buffer, offset, true); + wined3d_device_context_draw_indirect(&device->cs->c, buffer, offset, true); }
HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index bae5a6d42f0..918e9e253cc 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -168,6 +168,7 @@
@ cdecl wined3d_device_context_draw(ptr long long long long) @ cdecl wined3d_device_context_draw_indexed(ptr long long long long long) +@ cdecl wined3d_device_context_draw_indirect(ptr ptr long long) @ cdecl wined3d_device_context_dispatch(ptr long long long) @ cdecl wined3d_device_context_dispatch_indirect(ptr ptr long) @ cdecl wined3d_device_context_set_blend_state(ptr ptr ptr long) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index a60c3691c82..e3c3cde2cdc 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4735,9 +4735,6 @@ void wined3d_cs_emit_clear_unordered_access_view_uint(struct wined3d_cs *cs, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) DECLSPEC_HIDDEN; void wined3d_cs_emit_copy_uav_counter(struct wined3d_cs *cs, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav) DECLSPEC_HIDDEN; -void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, enum wined3d_primitive_type primitive_type, - unsigned int patch_vertex_count, struct wined3d_buffer *buffer, - unsigned int offset, bool indexed) DECLSPEC_HIDDEN; void wined3d_cs_emit_flush(struct wined3d_cs *cs) DECLSPEC_HIDDEN; void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN; void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 0ae0929d587..36efb7349dc 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -26,6 +26,7 @@ #ifndef __WINE_WINED3D_H #define __WINE_WINED3D_H
+#include <stdbool.h> #include "wine/list.h"
#define WINED3D_OK S_OK @@ -2563,6 +2564,8 @@ void __cdecl wined3d_device_context_draw(struct wined3d_device_context *context, unsigned int vertex_count, unsigned int start_instance, unsigned int instance_count); void __cdecl wined3d_device_context_draw_indexed(struct wined3d_device_context *context, unsigned int base_vertex_index, unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count); +void __cdecl wined3d_device_context_draw_indirect(struct wined3d_device_context *context, + struct wined3d_buffer *buffer, unsigned int offset, bool indexed); void __cdecl wined3d_device_context_set_blend_state(struct wined3d_device_context *context, struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask); void __cdecl wined3d_device_context_set_constant_buffer(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=88030
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 error: patch failed: dlls/wined3d/cs.c:1072 error: patch failed: dlls/wined3d/device.c:4484 error: patch failed: dlls/wined3d/wined3d.spec:168 error: patch failed: dlls/wined3d/wined3d_private.h:4735 error: patch failed: include/wine/wined3d.h:2563 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 error: patch failed: dlls/wined3d/cs.c:1072 error: patch failed: dlls/wined3d/device.c:4484 error: patch failed: dlls/wined3d/wined3d.spec:168 error: patch failed: dlls/wined3d/wined3d_private.h:4735 error: patch failed: include/wine/wined3d.h:2563 Task: Patch failed to apply
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7311f6e4d7b..fe9fa7482c6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1081,7 +1081,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawAuto(ID3D11DeviceConte static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstancedIndirect(ID3D11DeviceContext1 *iface, ID3D11Buffer *buffer, UINT offset) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct d3d_buffer *d3d_buffer;
TRACE("iface %p, buffer %p, offset %u.\n", iface, buffer, offset); @@ -1089,15 +1089,14 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstancedIndire d3d_buffer = unsafe_impl_from_ID3D11Buffer(buffer);
wined3d_mutex_lock(); - wined3d_device_draw_indexed_primitive_instanced_indirect(device->wined3d_device, - d3d_buffer->wined3d_buffer, offset); + wined3d_device_context_draw_indirect(context->wined3d_context, d3d_buffer->wined3d_buffer, offset, false); wined3d_mutex_unlock(); }
static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstancedIndirect(ID3D11DeviceContext1 *iface, ID3D11Buffer *buffer, UINT offset) { - struct d3d_device *device = device_from_immediate_ID3D11DeviceContext1(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); struct d3d_buffer *d3d_buffer;
TRACE("iface %p, buffer %p, offset %u.\n", iface, buffer, offset); @@ -1105,8 +1104,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstancedIndirect(ID3D d3d_buffer = unsafe_impl_from_ID3D11Buffer(buffer);
wined3d_mutex_lock(); - wined3d_device_draw_primitive_instanced_indirect(device->wined3d_device, - d3d_buffer->wined3d_buffer, offset); + wined3d_device_context_draw_indirect(context->wined3d_context, d3d_buffer->wined3d_buffer, offset, true); wined3d_mutex_unlock(); }
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=88031
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 error: patch failed: dlls/wined3d/cs.c:1072 error: patch failed: dlls/wined3d/device.c:4484 error: patch failed: dlls/wined3d/wined3d.spec:168 error: patch failed: dlls/wined3d/wined3d_private.h:4735 error: patch failed: include/wine/wined3d.h:2563 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 error: patch failed: dlls/wined3d/device.c:2409 error: patch failed: dlls/wined3d/wined3d.spec:167 error: patch failed: include/wine/wined3d.h:2561 error: patch failed: dlls/wined3d/cs.c:1072 error: patch failed: dlls/wined3d/device.c:4484 error: patch failed: dlls/wined3d/wined3d.spec:168 error: patch failed: dlls/wined3d/wined3d_private.h:4735 error: patch failed: include/wine/wined3d.h:2563 Task: Patch failed to apply
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=88027
Your paranoid android.
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 Task: Patch failed to apply
=== debiant2 (build log) ===
error: patch failed: dlls/wined3d/device.c:4480 Task: Patch failed to apply