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 e578e51de68..278bc8677e6 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, 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 %d, 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, start_instance, instance_count, 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 3316d6f6653..ee02914b0fe 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2562,6 +2562,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, 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,
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 f154bfdf480..685551c014c 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -576,14 +576,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(); }
@@ -704,7 +704,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", @@ -712,9 +712,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(); }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
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 278bc8677e6..3b22f7b2086 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, false); }
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 e9e73da9f25..db6b6488e59 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 ee02914b0fe..18dab157834 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 @@ -2564,6 +2565,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, 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,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
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 685551c014c..3b1c42fc592 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1082,7 +1082,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); @@ -1090,15 +1090,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, true); 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); @@ -1106,8 +1105,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, false); wined3d_mutex_unlock(); }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 71 +++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 34 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 3b1c42fc592..2738ff1a5bd 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -4382,7 +4382,7 @@ static void d3d10_device_set_constant_buffers(ID3D10Device1 *iface, { struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]);
- wined3d_device_set_constant_buffer(device->wined3d_device, type, start_slot + i, + wined3d_device_context_set_constant_buffer(device->immediate_context.wined3d_context, type, start_slot + i, buffer ? buffer->wined3d_buffer : NULL); } wined3d_mutex_unlock(); @@ -4412,8 +4412,8 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device1 *i { struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]);
- wined3d_device_set_ps_resource_view(device->wined3d_device, start_slot + i, - view ? view->wined3d_view : NULL); + wined3d_device_context_set_shader_resource_view(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_PIXEL, start_slot + i, view ? view->wined3d_view : NULL); } wined3d_mutex_unlock(); } @@ -4427,7 +4427,8 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device1 *iface, TRACE("iface %p, shader %p\n", iface, shader);
wined3d_mutex_lock(); - wined3d_device_set_pixel_shader(device->wined3d_device, ps ? ps->wined3d_shader : NULL); + wined3d_device_context_set_shader(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_PIXEL, ps ? ps->wined3d_shader : NULL); wined3d_mutex_unlock(); }
@@ -4445,8 +4446,8 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device1 *iface, { struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]);
- wined3d_device_set_ps_sampler(device->wined3d_device, start_slot + i, - sampler ? sampler->wined3d_sampler : NULL); + wined3d_device_context_set_sampler(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_PIXEL, start_slot + i, sampler ? sampler->wined3d_sampler : NULL); } wined3d_mutex_unlock(); } @@ -4460,7 +4461,8 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device1 *iface, TRACE("iface %p, shader %p\n", iface, shader);
wined3d_mutex_lock(); - wined3d_device_set_vertex_shader(device->wined3d_device, vs ? vs->wined3d_shader : NULL); + wined3d_device_context_set_shader(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_VERTEX, vs ? vs->wined3d_shader : NULL); wined3d_mutex_unlock(); }
@@ -4473,8 +4475,8 @@ static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device1 *iface, UIN 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(device->immediate_context.wined3d_context, + base_vertex_location, start_index_location, index_count, 0, 0); wined3d_mutex_unlock(); }
@@ -4487,7 +4489,7 @@ static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device1 *iface, UINT verte iface, vertex_count, start_vertex_location);
wined3d_mutex_lock(); - wined3d_device_draw_primitive(device->wined3d_device, start_vertex_location, vertex_count); + wined3d_device_context_draw(device->immediate_context.wined3d_context, start_vertex_location, vertex_count, 0, 0); wined3d_mutex_unlock(); }
@@ -4510,7 +4512,7 @@ static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device1 *iface TRACE("iface %p, input_layout %p\n", iface, input_layout);
wined3d_mutex_lock(); - wined3d_device_set_vertex_declaration(device->wined3d_device, + wined3d_device_context_set_vertex_declaration(device->immediate_context.wined3d_context, layout ? layout->wined3d_decl : NULL); wined3d_mutex_unlock(); } @@ -4529,7 +4531,7 @@ static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device1 *ifa { struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]);
- wined3d_device_set_stream_source(device->wined3d_device, start_slot + i, + wined3d_device_context_set_stream_source(device->immediate_context.wined3d_context, start_slot + i, buffer ? buffer->wined3d_buffer : NULL, offsets[i], strides[i]); } wined3d_mutex_unlock(); @@ -4545,7 +4547,7 @@ static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device1 *iface iface, buffer, debug_dxgi_format(format), offset);
wined3d_mutex_lock(); - wined3d_device_set_index_buffer(device->wined3d_device, + wined3d_device_context_set_index_buffer(device->immediate_context.wined3d_context, buffer_impl ? buffer_impl->wined3d_buffer : NULL, wined3dformat_from_dxgi_format(format), offset); wined3d_mutex_unlock(); @@ -4563,9 +4565,8 @@ static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device1 *i 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(device->immediate_context.wined3d_context, base_vertex_location, + start_index_location, instance_index_count, start_instance_location, instance_count); wined3d_mutex_unlock(); }
@@ -4580,7 +4581,7 @@ static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device1 *iface, start_vertex_location, start_instance_location);
wined3d_mutex_lock(); - wined3d_device_draw_primitive_instanced(device->wined3d_device, start_vertex_location, + wined3d_device_context_draw(device->immediate_context.wined3d_context, start_vertex_location, instance_vertex_count, start_instance_location, instance_count); wined3d_mutex_unlock(); } @@ -4603,7 +4604,8 @@ static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device1 *iface, ID3 TRACE("iface %p, shader %p.\n", iface, shader);
wined3d_mutex_lock(); - wined3d_device_set_geometry_shader(device->wined3d_device, gs ? gs->wined3d_shader : NULL); + wined3d_device_context_set_shader(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_GEOMETRY, gs ? gs->wined3d_shader : NULL); wined3d_mutex_unlock(); }
@@ -4633,8 +4635,8 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device1 *i { struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]);
- wined3d_device_set_vs_resource_view(device->wined3d_device, start_slot + i, - view ? view->wined3d_view : NULL); + wined3d_device_context_set_shader_resource_view(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_VERTEX, start_slot + i, view ? view->wined3d_view : NULL); } wined3d_mutex_unlock(); } @@ -4653,8 +4655,8 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device1 *iface, { struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]);
- wined3d_device_set_vs_sampler(device->wined3d_device, start_slot + i, - sampler ? sampler->wined3d_sampler : NULL); + wined3d_device_context_set_sampler(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_VERTEX, start_slot + i, sampler ? sampler->wined3d_sampler : NULL); } wined3d_mutex_unlock(); } @@ -4668,7 +4670,8 @@ static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device1 *iface,
query = unsafe_impl_from_ID3D10Query((ID3D10Query *)predicate); wined3d_mutex_lock(); - wined3d_device_set_predication(device->wined3d_device, query ? query->wined3d_query : NULL, value); + wined3d_device_context_set_predication(device->immediate_context.wined3d_context, + query ? query->wined3d_query : NULL, value); wined3d_mutex_unlock(); }
@@ -4686,8 +4689,8 @@ static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device1 *i { struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]);
- wined3d_device_set_gs_resource_view(device->wined3d_device, start_slot + i, - view ? view->wined3d_view : NULL); + wined3d_device_context_set_shader_resource_view(device->immediate_context.wined3d_context, + WINED3D_SHADER_TYPE_GEOMETRY, start_slot + i, view ? view->wined3d_view : NULL); } wined3d_mutex_unlock(); } @@ -4706,8 +4709,8 @@ static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device1 *iface, { struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]);
- wined3d_device_set_gs_sampler(device->wined3d_device, start_slot + i, - sampler ? sampler->wined3d_sampler : NULL); + wined3d_device_context_set_sampler(device->immediate_context.wined3d_context, WINED3D_SHADER_TYPE_GEOMETRY, + start_slot + i, sampler ? sampler->wined3d_sampler : NULL); } wined3d_mutex_unlock(); } @@ -4728,16 +4731,16 @@ static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device1 *ifa { struct d3d_rendertarget_view *rtv = unsafe_impl_from_ID3D10RenderTargetView(render_target_views[i]);
- wined3d_device_set_rendertarget_view(device->wined3d_device, i, + wined3d_device_context_set_rendertarget_view(device->immediate_context.wined3d_context, i, rtv ? rtv->wined3d_view : NULL, FALSE); } for (; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) { - wined3d_device_set_rendertarget_view(device->wined3d_device, i, NULL, FALSE); + wined3d_device_context_set_rendertarget_view(device->immediate_context.wined3d_context, i, NULL, FALSE); }
dsv = unsafe_impl_from_ID3D10DepthStencilView(depth_stencil_view); - wined3d_device_set_depth_stencil_view(device->wined3d_device, + wined3d_device_context_set_depth_stencil_view(device->immediate_context.wined3d_context, dsv ? dsv->wined3d_view : NULL); wined3d_mutex_unlock(); } @@ -4784,13 +4787,13 @@ static void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device1 *iface, { struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(targets[i]);
- wined3d_device_set_stream_output(device->wined3d_device, i, + wined3d_device_context_set_stream_output(device->immediate_context.wined3d_context, i, buffer ? buffer->wined3d_buffer : NULL, offsets[i]); }
for (i = count; i < D3D10_SO_BUFFER_SLOT_COUNT; ++i) { - wined3d_device_set_stream_output(device->wined3d_device, i, NULL, 0); + wined3d_device_context_set_stream_output(device->immediate_context.wined3d_context, i, NULL, 0); } wined3d_mutex_unlock(); } @@ -4835,7 +4838,7 @@ static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device1 *iface, }
wined3d_mutex_lock(); - wined3d_device_set_viewports(device->wined3d_device, viewport_count, wined3d_vp); + wined3d_device_context_set_viewports(device->immediate_context.wined3d_context, viewport_count, wined3d_vp); wined3d_mutex_unlock(); }
@@ -4850,7 +4853,7 @@ static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device1 *ifac return;
wined3d_mutex_lock(); - wined3d_device_set_scissor_rects(device->wined3d_device, rect_count, rects); + wined3d_device_context_set_scissor_rects(device->immediate_context.wined3d_context, rect_count, rects); wined3d_mutex_unlock(); }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com