mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Added patch to implement support for indirect drawing / compute shader dispatching.
This commit is contained in:
parent
f47fa538c5
commit
4d2afbf14b
@ -442,6 +442,7 @@ patch_enable_all ()
|
||||
enable_wined3d_Copy_Resource_Typeless="$1"
|
||||
enable_wined3d_Core_Context="$1"
|
||||
enable_wined3d_DXTn="$1"
|
||||
enable_wined3d_DrawIndirect="$1"
|
||||
enable_wined3d_GTX_560M="$1"
|
||||
enable_wined3d_Limit_Vram="$1"
|
||||
enable_wined3d_QUERY_Stubs="$1"
|
||||
@ -1591,6 +1592,9 @@ patch_enable ()
|
||||
wined3d-DXTn)
|
||||
enable_wined3d_DXTn="$2"
|
||||
;;
|
||||
wined3d-DrawIndirect)
|
||||
enable_wined3d_DrawIndirect="$2"
|
||||
;;
|
||||
wined3d-GTX_560M)
|
||||
enable_wined3d_GTX_560M="$2"
|
||||
;;
|
||||
@ -2191,6 +2195,13 @@ if test "$enable_wined3d_WINED3D_RS_COLORWRITEENABLE" -eq 1; then
|
||||
enable_d3d11_Depth_Bias=1
|
||||
fi
|
||||
|
||||
if test "$enable_wined3d_DrawIndirect" -eq 1; then
|
||||
if test "$enable_wined3d_draw_primitive_arrays" -gt 1; then
|
||||
abort "Patchset wined3d-draw_primitive_arrays disabled, but wined3d-DrawIndirect depends on that."
|
||||
fi
|
||||
enable_wined3d_draw_primitive_arrays=1
|
||||
fi
|
||||
|
||||
if test "$enable_wined3d_Core_Context" -eq 1; then
|
||||
if test "$enable_d3d11_Depth_Bias" -gt 1; then
|
||||
abort "Patchset d3d11-Depth_Bias disabled, but wined3d-Core_Context depends on that."
|
||||
@ -9450,6 +9461,48 @@ if test "$enable_wined3d_Core_Context" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-draw_primitive_arrays
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/d3d11/tests/d3d11.c, dlls/wined3d/directx.c, dlls/wined3d/drawprim.c, dlls/wined3d/wined3d_gl.h
|
||||
# |
|
||||
if test "$enable_wined3d_draw_primitive_arrays" -eq 1; then
|
||||
patch_apply wined3d-draw_primitive_arrays/0001-d3d11-tests-Add-basic-instance-offset-drawing-test.patch
|
||||
patch_apply wined3d-draw_primitive_arrays/0002-wined3d-Add-support-for-start-instance-in-draw_primi.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add basic instance offset drawing test.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "wined3d: Add support for start instance in draw_primitive_arrays.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-DrawIndirect
|
||||
# |
|
||||
# | This patchset has the following (direct or indirect) dependencies:
|
||||
# | * wined3d-draw_primitive_arrays
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#43405] Implement support for indirect drawing / compute shader dispatching
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/cs.c, dlls/wined3d/device.c, dlls/wined3d/directx.c,
|
||||
# | dlls/wined3d/drawprim.c, dlls/wined3d/wined3d.spec, dlls/wined3d/wined3d_gl.h, dlls/wined3d/wined3d_private.h,
|
||||
# | include/wine/wined3d.h
|
||||
# |
|
||||
if test "$enable_wined3d_DrawIndirect" -eq 1; then
|
||||
patch_apply wined3d-DrawIndirect/0001-wined3d-Implement-indirect-compute-dispatch.patch
|
||||
patch_apply wined3d-DrawIndirect/0002-d3d11-tests-Add-a-basic-test-for-DispatchIndirect.patch
|
||||
patch_apply wined3d-DrawIndirect/0003-wined3d-Implement-indirect-drawing.patch
|
||||
patch_apply wined3d-DrawIndirect/0004-wined3d-Implement-DrawInstancedIndirect.patch
|
||||
patch_apply wined3d-DrawIndirect/0005-d3d11-tests-Add-a-basic-test-for-DrawInstancedIndire.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Józef Kucia", "wined3d: Implement indirect compute dispatch.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "d3d11/tests: Add a basic test for DispatchIndirect.", 1 },';
|
||||
printf '%s\n' '+ { "Józef Kucia", "wined3d: Implement indirect drawing.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "wined3d: Implement DrawInstancedIndirect.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "d3d11/tests: Add a basic test for DrawInstancedIndirect.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-GTX_560M
|
||||
# |
|
||||
# | Modified files:
|
||||
@ -9545,20 +9598,6 @@ if test "$enable_wined3d_convervative_depth" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-draw_primitive_arrays
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/d3d11/tests/d3d11.c, dlls/wined3d/directx.c, dlls/wined3d/drawprim.c, dlls/wined3d/wined3d_gl.h
|
||||
# |
|
||||
if test "$enable_wined3d_draw_primitive_arrays" -eq 1; then
|
||||
patch_apply wined3d-draw_primitive_arrays/0001-d3d11-tests-Add-basic-instance-offset-drawing-test.patch
|
||||
patch_apply wined3d-draw_primitive_arrays/0002-wined3d-Add-support-for-start-instance-in-draw_primi.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Michael Müller", "d3d11/tests: Add basic instance offset drawing test.", 1 },';
|
||||
printf '%s\n' '+ { "Michael Müller", "wined3d: Add support for start instance in draw_primitive_arrays.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset wined3d-sample_c_lz
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@ -37,7 +37,7 @@ diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -405,6 +405,9 @@ struct wined3d_cs_update_sub_resource
|
||||
@@ -398,6 +398,9 @@ struct wined3d_cs_update_sub_resource
|
||||
unsigned int sub_resource_idx;
|
||||
struct wined3d_box box;
|
||||
struct wined3d_sub_resource_data data;
|
||||
@ -47,7 +47,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
};
|
||||
|
||||
struct wined3d_cs_add_dirty_texture_region
|
||||
@@ -2164,6 +2167,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2241,6 +2244,53 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
unsigned int slice_pitch)
|
||||
{
|
||||
struct wined3d_cs_update_sub_resource *op;
|
||||
@ -101,7 +101,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
|
||||
op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
|
||||
@@ -2177,8 +2227,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2254,8 +2304,10 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
wined3d_resource_acquire(resource);
|
||||
|
||||
cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP);
|
||||
@ -112,7 +112,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
|
||||
}
|
||||
|
||||
@@ -2481,6 +2533,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2558,6 +2610,13 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_COPY_STRUCTURE_COUNT */ wined3d_cs_exec_copy_structure_count,
|
||||
};
|
||||
|
||||
@ -126,7 +126,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
static void *wined3d_cs_st_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (size > (cs->data_size - cs->end))
|
||||
@@ -2534,6 +2593,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2611,6 +2670,9 @@ static void wined3d_cs_st_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_st_ops =
|
||||
{
|
||||
@ -136,7 +136,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
wined3d_cs_st_require_space,
|
||||
wined3d_cs_st_submit,
|
||||
wined3d_cs_st_finish,
|
||||
@@ -2566,6 +2628,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2643,6 +2705,21 @@ static void wined3d_cs_mt_submit(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
wined3d_cs_queue_submit(&cs->queue[queue_id], cs);
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size_t size, struct wined3d_cs *cs)
|
||||
{
|
||||
size_t queue_size = ARRAY_SIZE(queue->data);
|
||||
@@ -2627,6 +2704,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
@@ -2704,6 +2781,16 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
|
||||
return packet->data;
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, enum wined3d_cs_queue_id queue_id)
|
||||
{
|
||||
if (cs->thread_id == GetCurrentThreadId())
|
||||
@@ -2646,6 +2733,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
@@ -2723,6 +2810,9 @@ static void wined3d_cs_mt_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id
|
||||
|
||||
static const struct wined3d_cs_ops wined3d_cs_mt_ops =
|
||||
{
|
||||
@ -198,7 +198,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_device_delete_opengl_contexts(device);
|
||||
|
||||
if (device->fb.depth_stencil)
|
||||
@@ -4179,6 +4182,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
|
||||
@@ -4205,6 +4208,7 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
if (dst_texture->sub_resources[dst_sub_resource_idx].map_count)
|
||||
{
|
||||
WARN("Destination sub-resource %u is mapped.\n", dst_sub_resource_idx);
|
||||
@@ -4189,6 +4193,19 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
|
||||
@@ -4215,6 +4219,19 @@ HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *dev
|
||||
{
|
||||
WARN("Source sub-resource %u is mapped.\n", src_sub_resource_idx);
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
@ -226,7 +226,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
}
|
||||
|
||||
if (!src_box)
|
||||
@@ -4282,8 +4299,10 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
|
||||
@@ -4308,8 +4325,10 @@ void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, str
|
||||
return;
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
wined3d_cs_emit_update_sub_resource(device->cs, resource, sub_resource_idx, box, data, row_pitch, depth_pitch);
|
||||
}
|
||||
|
||||
@@ -5248,3 +5267,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
@@ -5274,3 +5293,58 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
else
|
||||
return CallWindowProcA(proc, window, message, wparam, lparam);
|
||||
}
|
||||
@ -619,7 +619,7 @@ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2774,6 +2774,16 @@ struct wined3d_state
|
||||
@@ -2822,6 +2822,16 @@ struct wined3d_state
|
||||
struct wined3d_rasterizer_state *rasterizer_state;
|
||||
};
|
||||
|
||||
@ -636,7 +636,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
#define WINED3D_UNMAPPED_STAGE ~0u
|
||||
|
||||
/* Multithreaded flag. Removed from the public header to signal that
|
||||
@@ -2885,6 +2895,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
@@ -2933,6 +2943,12 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
|
||||
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
|
||||
@ -649,7 +649,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
|
||||
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
|
||||
{
|
||||
@@ -3072,7 +3088,11 @@ struct wined3d_texture
|
||||
@@ -3120,7 +3136,11 @@ struct wined3d_texture
|
||||
|
||||
unsigned int map_count;
|
||||
DWORD locations;
|
||||
@ -661,7 +661,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
} sub_resources[1];
|
||||
};
|
||||
|
||||
@@ -3387,6 +3407,9 @@ struct wined3d_cs_queue
|
||||
@@ -3435,6 +3455,9 @@ struct wined3d_cs_queue
|
||||
|
||||
struct wined3d_cs_ops
|
||||
{
|
||||
|
@ -0,0 +1,235 @@
|
||||
From ed7b6749de73056ab073634b6f561f2138e24f00 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=B3zef=20Kucia?= <jkucia@codeweavers.com>
|
||||
Date: Sun, 23 Jul 2017 23:19:51 +0200
|
||||
Subject: wined3d: Implement indirect compute dispatch.
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 12 +++++++++++-
|
||||
dlls/wined3d/cs.c | 38 ++++++++++++++++++++++++++++++--------
|
||||
dlls/wined3d/device.c | 8 ++++++++
|
||||
dlls/wined3d/drawprim.c | 20 +++++++++++++++++---
|
||||
dlls/wined3d/wined3d.spec | 1 +
|
||||
dlls/wined3d/wined3d_private.h | 27 ++++++++++++++++++++++++++-
|
||||
include/wine/wined3d.h | 2 ++
|
||||
7 files changed, 95 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index f25ff8b3700..9cffa8a9961 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -1812,7 +1812,17 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_Dispatch(ID3D11DeviceConte
|
||||
static void STDMETHODCALLTYPE d3d11_immediate_context_DispatchIndirect(ID3D11DeviceContext *iface,
|
||||
ID3D11Buffer *buffer, UINT offset)
|
||||
{
|
||||
- FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset);
|
||||
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
|
||||
+ struct d3d_buffer *d3d_buffer;
|
||||
+
|
||||
+ TRACE("iface %p, buffer %p, offset %u.\n", iface, buffer, offset);
|
||||
+
|
||||
+ d3d_buffer = unsafe_impl_from_ID3D11Buffer(buffer);
|
||||
+
|
||||
+ wined3d_mutex_lock();
|
||||
+ wined3d_device_dispatch_compute_indirect(device->wined3d_device,
|
||||
+ d3d_buffer->wined3d_buffer, offset);
|
||||
+ wined3d_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceContext *iface,
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 4314a4807a8..171287dc99c 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -113,9 +113,7 @@ struct wined3d_cs_clear
|
||||
struct wined3d_cs_dispatch
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
- unsigned int group_count_x;
|
||||
- unsigned int group_count_y;
|
||||
- unsigned int group_count_z;
|
||||
+ struct wined3d_dispatch_parameters parameters;
|
||||
};
|
||||
|
||||
struct wined3d_cs_draw
|
||||
@@ -717,8 +715,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
|
||||
const struct wined3d_cs_dispatch *op = data;
|
||||
struct wined3d_state *state = &cs->state;
|
||||
|
||||
- dispatch_compute(cs->device, state,
|
||||
- op->group_count_x, op->group_count_y, op->group_count_z);
|
||||
+ dispatch_compute(cs->device, state, &op->parameters);
|
||||
+
|
||||
+ if (op->parameters.indirect)
|
||||
+ wined3d_resource_release(&op->parameters.u.indirect.buffer->resource);
|
||||
|
||||
release_shader_resources(state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
|
||||
release_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_COMPUTE],
|
||||
@@ -733,9 +733,31 @@ void wined3d_cs_emit_dispatch(struct wined3d_cs *cs,
|
||||
|
||||
op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
|
||||
op->opcode = WINED3D_CS_OP_DISPATCH;
|
||||
- op->group_count_x = group_count_x;
|
||||
- op->group_count_y = group_count_y;
|
||||
- op->group_count_z = group_count_z;
|
||||
+ op->parameters.indirect = FALSE;
|
||||
+ op->parameters.u.direct.group_count_x = group_count_x;
|
||||
+ op->parameters.u.direct.group_count_y = group_count_y;
|
||||
+ op->parameters.u.direct.group_count_z = group_count_z;
|
||||
+
|
||||
+ acquire_shader_resources(state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
|
||||
+ acquire_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_COMPUTE],
|
||||
+ state->unordered_access_view[WINED3D_PIPELINE_COMPUTE]);
|
||||
+
|
||||
+ cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
|
||||
+}
|
||||
+
|
||||
+void wined3d_cs_emit_dispatch_indirect(struct wined3d_cs *cs,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset)
|
||||
+{
|
||||
+ const struct wined3d_state *state = &cs->device->state;
|
||||
+ struct wined3d_cs_dispatch *op;
|
||||
+
|
||||
+ op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
|
||||
+ op->opcode = WINED3D_CS_OP_DISPATCH;
|
||||
+ op->parameters.indirect = TRUE;
|
||||
+ op->parameters.u.indirect.buffer = buffer;
|
||||
+ op->parameters.u.indirect.offset = offset;
|
||||
+
|
||||
+ wined3d_resource_acquire(&buffer->resource);
|
||||
|
||||
acquire_shader_resources(state, 1u << WINED3D_SHADER_TYPE_COMPUTE);
|
||||
acquire_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_COMPUTE],
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 4839f09aee3..54a058ae1ed 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -3701,6 +3701,14 @@ void CDECL wined3d_device_dispatch_compute(struct wined3d_device *device,
|
||||
wined3d_cs_emit_dispatch(device->cs, group_count_x, group_count_y, group_count_z);
|
||||
}
|
||||
|
||||
+void CDECL wined3d_device_dispatch_compute_indirect(struct wined3d_device *device,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset)
|
||||
+{
|
||||
+ TRACE("device %p, buffer %p, offset %u.\n", device, buffer, offset);
|
||||
+
|
||||
+ wined3d_cs_emit_dispatch_indirect(device->cs, buffer, offset);
|
||||
+}
|
||||
+
|
||||
void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device,
|
||||
enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
|
||||
{
|
||||
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
|
||||
index 353e9aac5f9..6de0d613d2d 100644
|
||||
--- a/dlls/wined3d/drawprim.c
|
||||
+++ b/dlls/wined3d/drawprim.c
|
||||
@@ -683,7 +683,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
}
|
||||
|
||||
void dispatch_compute(struct wined3d_device *device, const struct wined3d_state *state,
|
||||
- unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z)
|
||||
+ const struct wined3d_dispatch_parameters *parameters)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info;
|
||||
struct wined3d_context *context;
|
||||
@@ -713,8 +713,22 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state
|
||||
return;
|
||||
}
|
||||
|
||||
- GL_EXTCALL(glDispatchCompute(group_count_x, group_count_y, group_count_z));
|
||||
- checkGLcall("glDispatchCompute");
|
||||
+ if (!parameters->indirect)
|
||||
+ {
|
||||
+ GL_EXTCALL(glDispatchCompute(parameters->u.direct.group_count_x,
|
||||
+ parameters->u.direct.group_count_y, parameters->u.direct.group_count_z));
|
||||
+ checkGLcall("dispatch compute");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ struct wined3d_buffer *buffer = parameters->u.indirect.buffer;
|
||||
+
|
||||
+ wined3d_buffer_load(buffer, context, state);
|
||||
+ GL_EXTCALL(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, buffer->buffer_object));
|
||||
+ GL_EXTCALL(glDispatchComputeIndirect((GLintptr)0 + parameters->u.indirect.offset));
|
||||
+ GL_EXTCALL(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, 0));
|
||||
+ checkGLcall("dispatch compute indirect");
|
||||
+ }
|
||||
|
||||
GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS));
|
||||
checkGLcall("glMemoryBarrier");
|
||||
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
|
||||
index f0f6871a8a2..122e39ba8ee 100644
|
||||
--- a/dlls/wined3d/wined3d.spec
|
||||
+++ b/dlls/wined3d/wined3d.spec
|
||||
@@ -42,6 +42,7 @@
|
||||
@ cdecl wined3d_device_create(ptr long long ptr long long ptr ptr)
|
||||
@ cdecl wined3d_device_decref(ptr)
|
||||
@ cdecl wined3d_device_dispatch_compute(ptr long long long)
|
||||
+@ cdecl wined3d_device_dispatch_compute_indirect(ptr ptr long)
|
||||
@ cdecl wined3d_device_draw_indexed_primitive(ptr long long)
|
||||
@ cdecl wined3d_device_draw_indexed_primitive_instanced(ptr long long long long)
|
||||
@ cdecl wined3d_device_draw_primitive(ptr long long)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 3eeb3aef55e..e2461100a5a 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -1481,11 +1481,34 @@ void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_inf
|
||||
const struct wined3d_state *state, const struct wined3d_gl_info *gl_info,
|
||||
const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN;
|
||||
|
||||
+struct wined3d_direct_dispatch_parameters
|
||||
+{
|
||||
+ unsigned int group_count_x;
|
||||
+ unsigned int group_count_y;
|
||||
+ unsigned int group_count_z;
|
||||
+};
|
||||
+
|
||||
+struct wined3d_indirect_dispatch_parameters
|
||||
+{
|
||||
+ struct wined3d_buffer *buffer;
|
||||
+ unsigned int offset;
|
||||
+};
|
||||
+
|
||||
+struct wined3d_dispatch_parameters
|
||||
+{
|
||||
+ BOOL indirect;
|
||||
+ union
|
||||
+ {
|
||||
+ struct wined3d_direct_dispatch_parameters direct;
|
||||
+ struct wined3d_indirect_dispatch_parameters indirect;
|
||||
+ } u;
|
||||
+};
|
||||
+
|
||||
void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state,
|
||||
int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
|
||||
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
|
||||
void dispatch_compute(struct wined3d_device *device, const struct wined3d_state *state,
|
||||
- unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
|
||||
+ const struct wined3d_dispatch_parameters *dispatch_parameters) DECLSPEC_HIDDEN;
|
||||
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
|
||||
|
||||
#define eps 1e-8f
|
||||
@@ -3432,6 +3455,8 @@ 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_dispatch(struct wined3d_cs *cs,
|
||||
unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_dispatch_indirect(struct wined3d_cs *cs,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, unsigned int patch_vertex_count,
|
||||
int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
|
||||
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 4a85aac2cae..a99dbf64686 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -2240,6 +2240,8 @@ HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx,
|
||||
ULONG __cdecl wined3d_device_decref(struct wined3d_device *device);
|
||||
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_instanced(struct wined3d_device *device,
|
||||
UINT start_idx, UINT index_count, UINT start_instance, UINT instance_count);
|
||||
--
|
||||
2.13.1
|
||||
|
@ -0,0 +1,69 @@
|
||||
From 92202c3bca8682b20eac8dd896e1a38e8123fb66 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 24 Jul 2017 19:38:41 +0200
|
||||
Subject: d3d11/tests: Add a basic test for DispatchIndirect.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 17 ++++++++++++++---
|
||||
1 file changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index 8c1e5809533..c1b7dfff839 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -668,9 +668,10 @@ static void check_uav_desc_(unsigned int line, const D3D11_UNORDERED_ACCESS_VIEW
|
||||
}
|
||||
}
|
||||
|
||||
-#define create_buffer(a, b, c, d) create_buffer_(__LINE__, a, b, c, d)
|
||||
+#define create_buffer(a, b, c, d) create_buffer_(__LINE__, a, b, 0, c, d)
|
||||
+#define create_buffer_misc(a, b, c, d, e) create_buffer_(__LINE__, a, b, c, d, e)
|
||||
static ID3D11Buffer *create_buffer_(unsigned int line, ID3D11Device *device,
|
||||
- unsigned int bind_flags, unsigned int size, const void *data)
|
||||
+ unsigned int bind_flags, unsigned int misc_flags, unsigned int size, const void *data)
|
||||
{
|
||||
D3D11_SUBRESOURCE_DATA resource_data;
|
||||
D3D11_BUFFER_DESC buffer_desc;
|
||||
@@ -681,7 +682,7 @@ static ID3D11Buffer *create_buffer_(unsigned int line, ID3D11Device *device,
|
||||
buffer_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
buffer_desc.BindFlags = bind_flags;
|
||||
buffer_desc.CPUAccessFlags = 0;
|
||||
- buffer_desc.MiscFlags = 0;
|
||||
+ buffer_desc.MiscFlags = misc_flags;
|
||||
buffer_desc.StructureByteStride = 0;
|
||||
|
||||
resource_data.pSysMem = data;
|
||||
@@ -16567,6 +16568,7 @@ static void test_uav_load(void)
|
||||
|
||||
static void test_cs_uav_store(void)
|
||||
{
|
||||
+ static const unsigned int params[4] = {16, 16, 16, 0};
|
||||
static const D3D_FEATURE_LEVEL feature_level = D3D_FEATURE_LEVEL_11_0;
|
||||
D3D11_UNORDERED_ACCESS_VIEW_DESC uav_desc;
|
||||
static const float zero[4] = {0.0f};
|
||||
@@ -16578,6 +16580,7 @@ static void test_cs_uav_store(void)
|
||||
ID3D11Texture2D *texture;
|
||||
ID3D11ComputeShader *cs;
|
||||
ID3D11Device *device;
|
||||
+ ID3D11Buffer *buffer;
|
||||
ID3D11Buffer *cb;
|
||||
ULONG refcount;
|
||||
HRESULT hr;
|
||||
@@ -16844,6 +16847,14 @@ static void test_cs_uav_store(void)
|
||||
ID3D11DeviceContext_Dispatch(context, 16, 16, 1);
|
||||
check_texture_float(texture, 0.7f, 2);
|
||||
|
||||
+ input.x = 0.8f;
|
||||
+ buffer = create_buffer_misc(device, D3D11_BIND_UNORDERED_ACCESS,
|
||||
+ D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS, sizeof(params), params);
|
||||
+ ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &input, 0, 0);
|
||||
+ ID3D11DeviceContext_DispatchIndirect(context, buffer, 0);
|
||||
+ check_texture_float(texture, 0.8f, 2);
|
||||
+ ID3D11Buffer_Release(buffer);
|
||||
+
|
||||
ID3D11ComputeShader_Release(cs);
|
||||
|
||||
hr = ID3D11Device_CreateComputeShader(device, cs_group_index_code, sizeof(cs_group_index_code), NULL, &cs);
|
||||
--
|
||||
2.13.1
|
||||
|
@ -0,0 +1,427 @@
|
||||
From 016f75697806c91b84dd0099396f13fce147e066 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=B3zef=20Kucia?= <jkucia@codeweavers.com>
|
||||
Date: Sun, 23 Jul 2017 23:59:28 +0200
|
||||
Subject: wined3d: Implement indirect drawing.
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 12 ++++-
|
||||
dlls/wined3d/cs.c | 99 ++++++++++++++++++++++++++++++++----------
|
||||
dlls/wined3d/device.c | 9 ++++
|
||||
dlls/wined3d/directx.c | 5 +++
|
||||
dlls/wined3d/drawprim.c | 68 ++++++++++++++++++++++++-----
|
||||
dlls/wined3d/wined3d.spec | 1 +
|
||||
dlls/wined3d/wined3d_gl.h | 1 +
|
||||
dlls/wined3d/wined3d_private.h | 31 ++++++++++++-
|
||||
include/wine/wined3d.h | 2 +
|
||||
9 files changed, 192 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 9cffa8a9961..2ecce826042 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -1786,7 +1786,17 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawAuto(ID3D11DeviceConte
|
||||
static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstancedIndirect(ID3D11DeviceContext *iface,
|
||||
ID3D11Buffer *buffer, UINT offset)
|
||||
{
|
||||
- FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset);
|
||||
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
|
||||
+ struct d3d_buffer *d3d_buffer;
|
||||
+
|
||||
+ TRACE("iface %p, buffer %p, offset %u.\n", iface, buffer, offset);
|
||||
+
|
||||
+ 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_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstancedIndirect(ID3D11DeviceContext *iface,
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 171287dc99c..805867a3e20 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -121,12 +121,7 @@ struct wined3d_cs_draw
|
||||
enum wined3d_cs_op opcode;
|
||||
GLenum primitive_type;
|
||||
GLint patch_vertex_count;
|
||||
- int base_vertex_idx;
|
||||
- unsigned int start_idx;
|
||||
- unsigned int index_count;
|
||||
- unsigned int start_instance;
|
||||
- unsigned int instance_count;
|
||||
- BOOL indexed;
|
||||
+ struct wined3d_draw_parameters parameters;
|
||||
};
|
||||
|
||||
struct wined3d_cs_flush
|
||||
@@ -772,13 +767,6 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
const struct wined3d_cs_draw *op = data;
|
||||
unsigned int i;
|
||||
|
||||
- if (!cs->device->adapter->gl_info.supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]
|
||||
- && state->load_base_vertex_index != op->base_vertex_idx)
|
||||
- {
|
||||
- state->load_base_vertex_index = op->base_vertex_idx;
|
||||
- device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX);
|
||||
- }
|
||||
-
|
||||
if (state->gl_primitive_type != op->primitive_type)
|
||||
{
|
||||
if (state->gl_primitive_type == GL_POINTS || op->primitive_type == GL_POINTS)
|
||||
@@ -787,10 +775,27 @@ static void wined3d_cs_exec_draw(struct wined3d_cs *cs, const void *data)
|
||||
}
|
||||
state->gl_patch_vertices = op->patch_vertex_count;
|
||||
|
||||
- draw_primitive(cs->device, state, op->base_vertex_idx, op->start_idx,
|
||||
- op->index_count, op->start_instance, op->instance_count, op->indexed);
|
||||
+ if (!op->parameters.indirect)
|
||||
+ {
|
||||
+ const struct wined3d_direct_draw_parameters *p = &op->parameters.u.direct;
|
||||
+
|
||||
+ if (!cs->device->adapter->gl_info.supported[ARB_DRAW_ELEMENTS_BASE_VERTEX]
|
||||
+ && state->load_base_vertex_index != p->base_vertex_idx)
|
||||
+ {
|
||||
+ state->load_base_vertex_index = p->base_vertex_idx;
|
||||
+ device_invalidate_state(cs->device, STATE_BASEVERTEXINDEX);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ draw_primitive(cs->device, state, &op->parameters);
|
||||
+
|
||||
+ if (op->parameters.indirect)
|
||||
+ {
|
||||
+ const struct wined3d_indirect_draw_parameters *p = &op->parameters.u.indirect;
|
||||
|
||||
- if (op->indexed)
|
||||
+ wined3d_resource_release(&p->buffer->resource);
|
||||
+ }
|
||||
+ if (op->parameters.indexed)
|
||||
wined3d_resource_release(&state->index_buffer->resource);
|
||||
for (i = 0; i < ARRAY_SIZE(state->streams); ++i)
|
||||
{
|
||||
@@ -831,12 +836,62 @@ void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, unsigned
|
||||
op->opcode = WINED3D_CS_OP_DRAW;
|
||||
op->primitive_type = primitive_type;
|
||||
op->patch_vertex_count = patch_vertex_count;
|
||||
- op->base_vertex_idx = base_vertex_idx;
|
||||
- op->start_idx = start_idx;
|
||||
- op->index_count = index_count;
|
||||
- op->start_instance = start_instance;
|
||||
- op->instance_count = instance_count;
|
||||
- op->indexed = indexed;
|
||||
+ op->parameters.indirect = FALSE;
|
||||
+ op->parameters.u.direct.base_vertex_idx = base_vertex_idx;
|
||||
+ op->parameters.u.direct.start_idx = start_idx;
|
||||
+ op->parameters.u.direct.index_count = index_count;
|
||||
+ op->parameters.u.direct.start_instance = start_instance;
|
||||
+ op->parameters.u.direct.instance_count = instance_count;
|
||||
+ op->parameters.indexed = indexed;
|
||||
+
|
||||
+ if (indexed)
|
||||
+ wined3d_resource_acquire(&state->index_buffer->resource);
|
||||
+ for (i = 0; i < ARRAY_SIZE(state->streams); ++i)
|
||||
+ {
|
||||
+ if (state->streams[i].buffer)
|
||||
+ wined3d_resource_acquire(&state->streams[i].buffer->resource);
|
||||
+ }
|
||||
+ for (i = 0; i < ARRAY_SIZE(state->stream_output); ++i)
|
||||
+ {
|
||||
+ if (state->stream_output[i].buffer)
|
||||
+ wined3d_resource_acquire(&state->stream_output[i].buffer->resource);
|
||||
+ }
|
||||
+ for (i = 0; i < ARRAY_SIZE(state->textures); ++i)
|
||||
+ {
|
||||
+ if (state->textures[i])
|
||||
+ wined3d_resource_acquire(&state->textures[i]->resource);
|
||||
+ }
|
||||
+ for (i = 0; i < cs->device->adapter->gl_info.limits.buffers; ++i)
|
||||
+ {
|
||||
+ if (state->fb->render_targets[i])
|
||||
+ wined3d_resource_acquire(state->fb->render_targets[i]->resource);
|
||||
+ }
|
||||
+ if (state->fb->depth_stencil)
|
||||
+ wined3d_resource_acquire(state->fb->depth_stencil->resource);
|
||||
+ acquire_shader_resources(state, ~(1u << WINED3D_SHADER_TYPE_COMPUTE));
|
||||
+ acquire_unordered_access_resources(state->shader[WINED3D_SHADER_TYPE_PIXEL],
|
||||
+ state->unordered_access_view[WINED3D_PIPELINE_GRAPHICS]);
|
||||
+
|
||||
+ cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
|
||||
+}
|
||||
+
|
||||
+void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, GLenum primitive_type, unsigned int patch_vertex_count,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset, BOOL indexed)
|
||||
+{
|
||||
+ const struct wined3d_state *state = &cs->device->state;
|
||||
+ struct wined3d_cs_draw *op;
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ op = cs->ops->require_space(cs, 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->parameters.indirect = TRUE;
|
||||
+ op->parameters.u.indirect.buffer = buffer;
|
||||
+ op->parameters.u.indirect.offset = offset;
|
||||
+ op->parameters.indexed = indexed;
|
||||
+
|
||||
+ wined3d_resource_acquire(&buffer->resource);
|
||||
|
||||
if (indexed)
|
||||
wined3d_resource_acquire(&state->index_buffer->resource);
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 54a058ae1ed..b6458cfde53 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -3782,6 +3782,15 @@ void CDECL wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device
|
||||
device->state.base_vertex_index, start_idx, index_count, start_instance, instance_count, TRUE);
|
||||
}
|
||||
|
||||
+void CDECL wined3d_device_draw_indexed_primitive_instanced_indirect(struct wined3d_device *device,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset)
|
||||
+{
|
||||
+ TRACE("device %p, buffer %p, offset %u.\n", device, buffer, offset);
|
||||
+
|
||||
+ wined3d_cs_emit_draw_indirect(device->cs, device->state.gl_primitive_type, device->state.gl_patch_vertices,
|
||||
+ buffer, offset, TRUE);
|
||||
+}
|
||||
+
|
||||
HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
|
||||
struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
|
||||
{
|
||||
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
|
||||
index 82f6300d0f5..0553a16ee4e 100644
|
||||
--- a/dlls/wined3d/directx.c
|
||||
+++ b/dlls/wined3d/directx.c
|
||||
@@ -126,6 +126,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
|
||||
{"GL_ARB_derivative_control", ARB_DERIVATIVE_CONTROL },
|
||||
{"GL_ARB_draw_buffers", ARB_DRAW_BUFFERS },
|
||||
{"GL_ARB_draw_elements_base_vertex", ARB_DRAW_ELEMENTS_BASE_VERTEX },
|
||||
+ {"GL_ARB_draw_indirect", ARB_DRAW_INDIRECT },
|
||||
{"GL_ARB_draw_instanced", ARB_DRAW_INSTANCED },
|
||||
{"GL_ARB_ES2_compatibility", ARB_ES2_COMPATIBILITY },
|
||||
{"GL_ARB_ES3_compatibility", ARB_ES3_COMPATIBILITY },
|
||||
@@ -2735,6 +2736,9 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
|
||||
USE_GL_FUNC(glDrawElementsInstancedBaseVertex)
|
||||
USE_GL_FUNC(glDrawRangeElementsBaseVertex)
|
||||
USE_GL_FUNC(glMultiDrawElementsBaseVertex)
|
||||
+ /* GL_ARB_draw_indirect */
|
||||
+ USE_GL_FUNC(glDrawArraysIndirect)
|
||||
+ USE_GL_FUNC(glDrawElementsIndirect)
|
||||
/* GL_ARB_draw_instanced */
|
||||
USE_GL_FUNC(glDrawArraysInstancedARB)
|
||||
USE_GL_FUNC(glDrawElementsInstancedARB)
|
||||
@@ -3886,6 +3890,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
|
||||
{ARB_TIMER_QUERY, MAKEDWORD_VERSION(3, 3)},
|
||||
{ARB_VERTEX_TYPE_2_10_10_10_REV, MAKEDWORD_VERSION(3, 3)},
|
||||
|
||||
+ {ARB_DRAW_INDIRECT, MAKEDWORD_VERSION(4, 0)},
|
||||
{ARB_GPU_SHADER5, MAKEDWORD_VERSION(4, 0)},
|
||||
{ARB_TESSELLATION_SHADER, MAKEDWORD_VERSION(4, 0)},
|
||||
{ARB_TEXTURE_CUBE_MAP_ARRAY, MAKEDWORD_VERSION(4, 0)},
|
||||
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
|
||||
index 6de0d613d2d..bec0155c6ef 100644
|
||||
--- a/dlls/wined3d/drawprim.c
|
||||
+++ b/dlls/wined3d/drawprim.c
|
||||
@@ -168,6 +168,38 @@ static void draw_primitive_arrays(struct wined3d_context *context, const struct
|
||||
}
|
||||
}
|
||||
|
||||
+/* Context activation is done by the caller. */
|
||||
+static void draw_primitive_arrays_indirect(struct wined3d_context *context, const struct wined3d_state *state,
|
||||
+ const void *idx_data, unsigned int idx_size, struct wined3d_buffer *buffer, unsigned int offset)
|
||||
+{
|
||||
+ const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||
+
|
||||
+ if (!gl_info->supported[ARB_DRAW_INDIRECT])
|
||||
+ {
|
||||
+ FIXME("Indirect draw not supported.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ wined3d_buffer_load(buffer, context, state);
|
||||
+ GL_EXTCALL(glBindBuffer(GL_DRAW_INDIRECT_BUFFER, buffer->buffer_object));
|
||||
+
|
||||
+ if (idx_size)
|
||||
+ {
|
||||
+ GLenum idx_type = (idx_size == 2) ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
|
||||
+
|
||||
+ GL_EXTCALL(glDrawElementsIndirect(state->gl_primitive_type, idx_type,
|
||||
+ (const BYTE *)NULL + offset));
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ GL_EXTCALL(glDrawArraysIndirect(state->gl_primitive_type,
|
||||
+ (const BYTE *)NULL + offset));
|
||||
+ }
|
||||
+
|
||||
+ GL_EXTCALL(glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0));
|
||||
+ checkGLcall("draw indirect");
|
||||
+}
|
||||
+
|
||||
static unsigned int get_stride_idx(const void *idx_data, unsigned int idx_size,
|
||||
unsigned int base_vertex_idx, unsigned int start_idx, unsigned int vertex_idx)
|
||||
{
|
||||
@@ -477,8 +509,7 @@ static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primiti
|
||||
|
||||
/* Routine common to the draw primitive and draw indexed primitive routines */
|
||||
void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state,
|
||||
- int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
|
||||
- unsigned int start_instance, unsigned int instance_count, BOOL indexed)
|
||||
+ const struct wined3d_draw_parameters *parameters)
|
||||
{
|
||||
BOOL emulation = FALSE, rasterizer_discard = FALSE;
|
||||
const struct wined3d_fb_state *fb = state->fb;
|
||||
@@ -491,7 +522,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
unsigned int i, idx_size = 0;
|
||||
const void *idx_data = NULL;
|
||||
|
||||
- if (!index_count)
|
||||
+ if (!parameters->indirect && !parameters->u.direct.index_count)
|
||||
return;
|
||||
|
||||
if (!(rtv = fb->render_targets[0]))
|
||||
@@ -558,10 +589,8 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
}
|
||||
|
||||
stream_info = &context->stream_info;
|
||||
- if (context->instance_count)
|
||||
- instance_count = context->instance_count;
|
||||
|
||||
- if (indexed)
|
||||
+ if (parameters->indexed)
|
||||
{
|
||||
struct wined3d_buffer *index_buffer = state->index_buffer;
|
||||
if (!index_buffer->buffer_object || !stream_info->all_vbo)
|
||||
@@ -648,12 +677,29 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
checkGLcall("glPatchParameteri");
|
||||
}
|
||||
|
||||
- if (context->use_immediate_mode_draw || emulation)
|
||||
- draw_primitive_immediate_mode(context, state, stream_info, idx_data,
|
||||
- idx_size, base_vertex_idx, start_idx, index_count, instance_count);
|
||||
+ if (parameters->indirect)
|
||||
+ {
|
||||
+ if (context->use_immediate_mode_draw || emulation)
|
||||
+ FIXME("Indirect draw with immediate mode/emulation is not supported.\n");
|
||||
+ else
|
||||
+ draw_primitive_arrays_indirect(context, state, idx_data, idx_size,
|
||||
+ parameters->u.indirect.buffer, parameters->u.indirect.offset);
|
||||
+ }
|
||||
else
|
||||
- draw_primitive_arrays(context, state, idx_data, idx_size, base_vertex_idx,
|
||||
- start_idx, index_count, start_instance, instance_count);
|
||||
+ {
|
||||
+ unsigned int instance_count = parameters->u.direct.instance_count;
|
||||
+ if (context->instance_count)
|
||||
+ instance_count = context->instance_count;
|
||||
+
|
||||
+ if (context->use_immediate_mode_draw || emulation)
|
||||
+ draw_primitive_immediate_mode(context, state, stream_info, idx_data,
|
||||
+ idx_size, parameters->u.direct.base_vertex_idx,
|
||||
+ parameters->u.direct.start_idx, parameters->u.direct.index_count, instance_count);
|
||||
+ else
|
||||
+ draw_primitive_arrays(context, state, idx_data, idx_size, parameters->u.direct.base_vertex_idx,
|
||||
+ parameters->u.direct.start_idx, parameters->u.direct.index_count,
|
||||
+ parameters->u.direct.start_instance, instance_count);
|
||||
+ }
|
||||
|
||||
if (context->uses_uavs)
|
||||
{
|
||||
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
|
||||
index 122e39ba8ee..2d80b3a8772 100644
|
||||
--- a/dlls/wined3d/wined3d.spec
|
||||
+++ b/dlls/wined3d/wined3d.spec
|
||||
@@ -45,6 +45,7 @@
|
||||
@ cdecl wined3d_device_dispatch_compute_indirect(ptr ptr long)
|
||||
@ cdecl wined3d_device_draw_indexed_primitive(ptr long long)
|
||||
@ cdecl wined3d_device_draw_indexed_primitive_instanced(ptr long long long long)
|
||||
+@ cdecl wined3d_device_draw_indexed_primitive_instanced_indirect(ptr ptr long)
|
||||
@ cdecl wined3d_device_draw_primitive(ptr long long)
|
||||
@ cdecl wined3d_device_draw_primitive_instanced(ptr long long long long)
|
||||
@ cdecl wined3d_device_end_scene(ptr)
|
||||
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
|
||||
index 4fe1971b5e6..4f73478a3b4 100644
|
||||
--- a/dlls/wined3d/wined3d_gl.h
|
||||
+++ b/dlls/wined3d/wined3d_gl.h
|
||||
@@ -60,6 +60,7 @@ enum wined3d_gl_extension
|
||||
ARB_DERIVATIVE_CONTROL,
|
||||
ARB_DRAW_BUFFERS,
|
||||
ARB_DRAW_ELEMENTS_BASE_VERTEX,
|
||||
+ ARB_DRAW_INDIRECT,
|
||||
ARB_DRAW_INSTANCED,
|
||||
ARB_ES2_COMPATIBILITY,
|
||||
ARB_ES3_COMPATIBILITY,
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index e2461100a5a..50143a91425 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -1481,6 +1481,32 @@ void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_inf
|
||||
const struct wined3d_state *state, const struct wined3d_gl_info *gl_info,
|
||||
const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN;
|
||||
|
||||
+struct wined3d_direct_draw_parameters
|
||||
+{
|
||||
+ int base_vertex_idx;
|
||||
+ unsigned int start_idx;
|
||||
+ unsigned int index_count;
|
||||
+ unsigned int start_instance;
|
||||
+ unsigned int instance_count;
|
||||
+};
|
||||
+
|
||||
+struct wined3d_indirect_draw_parameters
|
||||
+{
|
||||
+ struct wined3d_buffer *buffer;
|
||||
+ unsigned int offset;
|
||||
+};
|
||||
+
|
||||
+struct wined3d_draw_parameters
|
||||
+{
|
||||
+ BOOL indirect;
|
||||
+ union
|
||||
+ {
|
||||
+ struct wined3d_direct_draw_parameters direct;
|
||||
+ struct wined3d_indirect_draw_parameters indirect;
|
||||
+ } u;
|
||||
+ BOOL indexed;
|
||||
+};
|
||||
+
|
||||
struct wined3d_direct_dispatch_parameters
|
||||
{
|
||||
unsigned int group_count_x;
|
||||
@@ -1505,8 +1531,7 @@ struct wined3d_dispatch_parameters
|
||||
};
|
||||
|
||||
void draw_primitive(struct wined3d_device *device, const struct wined3d_state *state,
|
||||
- int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
|
||||
- unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
|
||||
+ const struct wined3d_draw_parameters *draw_parameters) DECLSPEC_HIDDEN;
|
||||
void dispatch_compute(struct wined3d_device *device, const struct wined3d_state *state,
|
||||
const struct wined3d_dispatch_parameters *dispatch_parameters) DECLSPEC_HIDDEN;
|
||||
DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
|
||||
@@ -3460,6 +3485,8 @@ void wined3d_cs_emit_dispatch_indirect(struct wined3d_cs *cs,
|
||||
void wined3d_cs_emit_draw(struct wined3d_cs *cs, GLenum primitive_type, unsigned int patch_vertex_count,
|
||||
int base_vertex_idx, unsigned int start_idx, unsigned int index_count,
|
||||
unsigned int start_instance, unsigned int instance_count, BOOL indexed) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_draw_indirect(struct wined3d_cs *cs, GLenum 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_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain,
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index a99dbf64686..0b4c97fad54 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -2245,6 +2245,8 @@ void __cdecl wined3d_device_dispatch_compute_indirect(struct wined3d_device *dev
|
||||
HRESULT __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,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset);
|
||||
HRESULT __cdecl wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count);
|
||||
void __cdecl wined3d_device_draw_primitive_instanced(struct wined3d_device *device,
|
||||
UINT start_vertex, UINT vertex_count, UINT start_instance, UINT instance_count);
|
||||
--
|
||||
2.13.1
|
||||
|
@ -0,0 +1,83 @@
|
||||
From d2b50ac6892808791c4d461317a4b011369fcc39 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 24 Jul 2017 20:30:13 +0200
|
||||
Subject: wined3d: Implement DrawInstancedIndirect.
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 12 +++++++++++-
|
||||
dlls/wined3d/device.c | 9 +++++++++
|
||||
dlls/wined3d/wined3d.spec | 1 +
|
||||
include/wine/wined3d.h | 2 ++
|
||||
4 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 2ecce826042..d3660a12e50 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -1802,7 +1802,17 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstancedIndire
|
||||
static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstancedIndirect(ID3D11DeviceContext *iface,
|
||||
ID3D11Buffer *buffer, UINT offset)
|
||||
{
|
||||
- FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset);
|
||||
+ struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
|
||||
+ struct d3d_buffer *d3d_buffer;
|
||||
+
|
||||
+ TRACE("iface %p, buffer %p, offset %u.\n", iface, buffer, offset);
|
||||
+
|
||||
+ 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_mutex_unlock();
|
||||
}
|
||||
|
||||
static void STDMETHODCALLTYPE d3d11_immediate_context_Dispatch(ID3D11DeviceContext *iface,
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index b6458cfde53..112e7f45ca4 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -3752,6 +3752,15 @@ void CDECL wined3d_device_draw_primitive_instanced(struct wined3d_device *device
|
||||
0, start_vertex, vertex_count, start_instance, instance_count, FALSE);
|
||||
}
|
||||
|
||||
+void CDECL wined3d_device_draw_primitive_instanced_indirect(struct wined3d_device *device,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset)
|
||||
+{
|
||||
+ TRACE("device %p, buffer %p, offset %u.\n", device, buffer, offset);
|
||||
+
|
||||
+ wined3d_cs_emit_draw_indirect(device->cs, device->state.gl_primitive_type, device->state.gl_patch_vertices,
|
||||
+ buffer, offset, FALSE);
|
||||
+}
|
||||
+
|
||||
HRESULT CDECL wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count)
|
||||
{
|
||||
TRACE("device %p, start_idx %u, index_count %u.\n", device, start_idx, index_count);
|
||||
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
|
||||
index 2d80b3a8772..9c48b98b3ac 100644
|
||||
--- a/dlls/wined3d/wined3d.spec
|
||||
+++ b/dlls/wined3d/wined3d.spec
|
||||
@@ -48,6 +48,7 @@
|
||||
@ cdecl wined3d_device_draw_indexed_primitive_instanced_indirect(ptr ptr long)
|
||||
@ cdecl wined3d_device_draw_primitive(ptr long long)
|
||||
@ cdecl wined3d_device_draw_primitive_instanced(ptr long long long long)
|
||||
+@ cdecl wined3d_device_draw_primitive_instanced_indirect(ptr ptr long)
|
||||
@ cdecl wined3d_device_end_scene(ptr)
|
||||
@ cdecl wined3d_device_end_stateblock(ptr ptr)
|
||||
@ cdecl wined3d_device_evict_managed_resources(ptr)
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 0b4c97fad54..b8fb5503e53 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -2250,6 +2250,8 @@ void __cdecl wined3d_device_draw_indexed_primitive_instanced_indirect(struct win
|
||||
HRESULT __cdecl wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count);
|
||||
void __cdecl wined3d_device_draw_primitive_instanced(struct wined3d_device *device,
|
||||
UINT start_vertex, UINT vertex_count, UINT start_instance, UINT instance_count);
|
||||
+void __cdecl wined3d_device_draw_primitive_instanced_indirect(struct wined3d_device *device,
|
||||
+ struct wined3d_buffer *buffer, unsigned int offset);
|
||||
HRESULT __cdecl wined3d_device_end_scene(struct wined3d_device *device);
|
||||
HRESULT __cdecl wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock);
|
||||
void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device);
|
||||
--
|
||||
2.13.1
|
||||
|
@ -0,0 +1,70 @@
|
||||
From 9cf4fd149607487343d264d1ae8b23807957a919 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 24 Jul 2017 20:36:31 +0200
|
||||
Subject: d3d11/tests: Add a basic test for DrawInstancedIndirect.
|
||||
|
||||
---
|
||||
dlls/d3d11/tests/d3d11.c | 19 +++++++++++++++++--
|
||||
1 file changed, 17 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
|
||||
index c1b7dfff839..af71dbef770 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -9940,6 +9940,7 @@ static void test_clear_state(void)
|
||||
|
||||
static void test_il_append_aligned(void)
|
||||
{
|
||||
+ static const unsigned int params[] = {4, 4, 0, 0};
|
||||
struct d3d11_test_context test_context;
|
||||
ID3D11InputLayout *input_layout;
|
||||
ID3D11DeviceContext *context;
|
||||
@@ -9947,6 +9948,7 @@ static void test_il_append_aligned(void)
|
||||
ID3D11VertexShader *vs;
|
||||
ID3D11PixelShader *ps;
|
||||
ID3D11Device *device;
|
||||
+ ID3D11Buffer *buffer;
|
||||
ID3D11Buffer *vb[3];
|
||||
DWORD color;
|
||||
HRESULT hr;
|
||||
@@ -10116,7 +10118,6 @@ static void test_il_append_aligned(void)
|
||||
ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
|
||||
|
||||
ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
|
||||
-
|
||||
ID3D11DeviceContext_DrawInstanced(context, 4, 4, 0, 0);
|
||||
|
||||
color = get_texture_color(test_context.backbuffer, 80, 240);
|
||||
@@ -10129,7 +10130,6 @@ static void test_il_append_aligned(void)
|
||||
ok(compare_color(color, 0xffff00ff, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
|
||||
ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
|
||||
-
|
||||
ID3D11DeviceContext_DrawInstanced(context, 4, 4, 0, 4);
|
||||
|
||||
color = get_texture_color(test_context.backbuffer, 80, 240);
|
||||
@@ -10141,6 +10141,21 @@ static void test_il_append_aligned(void)
|
||||
color = get_texture_color(test_context.backbuffer, 560, 240);
|
||||
ok(compare_color(color, 0xffff0000, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
|
||||
+ buffer = create_buffer_misc(device, D3D11_BIND_UNORDERED_ACCESS,
|
||||
+ D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS, sizeof(params), params);
|
||||
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red);
|
||||
+ ID3D11DeviceContext_DrawInstancedIndirect(context, buffer, 0);
|
||||
+ ID3D11Buffer_Release(buffer);
|
||||
+
|
||||
+ color = get_texture_color(test_context.backbuffer, 80, 240);
|
||||
+ ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = get_texture_color(test_context.backbuffer, 240, 240);
|
||||
+ ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = get_texture_color(test_context.backbuffer, 400, 240);
|
||||
+ ok(compare_color(color, 0xffff0000, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+ color = get_texture_color(test_context.backbuffer, 560, 240);
|
||||
+ ok(compare_color(color, 0xffff00ff, 1), "Got unexpected color 0x%08x.\n", color);
|
||||
+
|
||||
ID3D11PixelShader_Release(ps);
|
||||
ID3D11VertexShader_Release(vs);
|
||||
ID3D11Buffer_Release(vb[2]);
|
||||
--
|
||||
2.13.1
|
||||
|
2
patches/wined3d-DrawIndirect/definition
Normal file
2
patches/wined3d-DrawIndirect/definition
Normal file
@ -0,0 +1,2 @@
|
||||
Fixes: [43405] Implement support for indirect drawing / compute shader dispatching
|
||||
Depends: wined3d-draw_primitive_arrays
|
Loading…
x
Reference in New Issue
Block a user