[PATCH 5/8] wined3d: Introduce wined3d_stream_output_desc.
Józef Kucia
jkucia at codeweavers.com
Thu Mar 23 06:15:48 CDT 2017
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/d3d11/shader.c | 2 +-
dlls/wined3d/device.c | 4 ++--
dlls/wined3d/shader.c | 13 ++++++++-----
dlls/wined3d/stateblock.c | 2 +-
dlls/wined3d/wined3d.spec | 2 +-
dlls/wined3d/wined3d_private.h | 3 +--
include/wine/wined3d.h | 24 +++++++++++++++++++++++-
7 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/dlls/d3d11/shader.c b/dlls/d3d11/shader.c
index 547181e..a22a0c3 100644
--- a/dlls/d3d11/shader.c
+++ b/dlls/d3d11/shader.c
@@ -1194,7 +1194,7 @@ static HRESULT d3d_geometry_shader_init(struct d3d_geometry_shader *shader, stru
}
desc.max_version = d3d_sm_from_feature_level(device->feature_level);
- hr = wined3d_shader_create_gs(device->wined3d_device, &desc, shader,
+ hr = wined3d_shader_create_gs(device->wined3d_device, &desc, NULL, shader,
&d3d_geometry_shader_wined3d_parent_ops, &shader->wined3d_shader);
shader_free_signature(&desc.input_signature);
shader_free_signature(&desc.output_signature);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9b0fcfb..556d555 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1300,7 +1300,7 @@ void CDECL wined3d_device_set_stream_output(struct wined3d_device *device, UINT
TRACE("device %p, idx %u, buffer %p, offset %u.\n", device, idx, buffer, offset);
- if (idx >= MAX_STREAM_OUT)
+ if (idx >= WINED3D_MAX_STREAM_OUTPUT_BUFFERS)
{
WARN("Invalid stream output %u.\n", idx);
return;
@@ -1324,7 +1324,7 @@ struct wined3d_buffer * CDECL wined3d_device_get_stream_output(struct wined3d_de
{
TRACE("device %p, idx %u, offset %p.\n", device, idx, offset);
- if (idx >= MAX_STREAM_OUT)
+ if (idx >= WINED3D_MAX_STREAM_OUTPUT_BUFFERS)
{
WARN("Invalid stream output %u.\n", idx);
return NULL;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 2c9976d..020e943 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -3781,16 +3781,19 @@ HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const stru
}
HRESULT CDECL wined3d_shader_create_gs(struct wined3d_device *device, const struct wined3d_shader_desc *desc,
- void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
+ const struct wined3d_stream_output_desc *so_desc, void *parent,
+ const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader)
{
struct wined3d_shader *object;
HRESULT hr;
- TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n",
- device, desc, parent, parent_ops, shader);
+ TRACE("device %p, desc %p, so_desc %p, parent %p, parent_ops %p, shader %p.\n",
+ device, desc, so_desc, parent, parent_ops, shader);
- object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
- if (!object)
+ if (so_desc)
+ FIXME("Stream output not supported.\n");
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
if (FAILED(hr = geometry_shader_init(object, device, desc, parent, parent_ops)))
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 8b91353..b197052 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -447,7 +447,7 @@ void state_unbind_resources(struct wined3d_state *state)
}
}
- for (i = 0; i < MAX_STREAM_OUT; ++i)
+ for (i = 0; i < WINED3D_MAX_STREAM_OUTPUT_BUFFERS; ++i)
{
if ((buffer = state->stream_output[i].buffer))
{
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 817deca..ad02eeb 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -218,7 +218,7 @@
@ cdecl wined3d_shader_create_cs(ptr ptr ptr ptr ptr)
@ cdecl wined3d_shader_create_ds(ptr ptr ptr ptr ptr)
-@ cdecl wined3d_shader_create_gs(ptr ptr ptr ptr ptr)
+@ cdecl wined3d_shader_create_gs(ptr ptr ptr ptr ptr ptr)
@ cdecl wined3d_shader_create_hs(ptr ptr ptr ptr ptr)
@ cdecl wined3d_shader_create_ps(ptr ptr ptr ptr ptr)
@ cdecl wined3d_shader_create_vs(ptr ptr ptr ptr ptr)
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b58da36..cb8823d 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -257,7 +257,6 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
}
/* Device caps */
-#define MAX_STREAM_OUT 4
#define MAX_STREAMS 16
#define MAX_TEXTURES 8
#define MAX_FRAGMENT_SAMPLERS 16
@@ -2557,7 +2556,7 @@ struct wined3d_state
const struct wined3d_fb_state *fb;
struct wined3d_vertex_declaration *vertex_declaration;
- struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
+ struct wined3d_stream_output stream_output[WINED3D_MAX_STREAM_OUTPUT_BUFFERS];
struct wined3d_stream_state streams[MAX_STREAMS + 1 /* tesselated pseudo-stream */];
struct wined3d_buffer *index_buffer;
enum wined3d_format_id index_format;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 3b0f6db..bb405fe 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1518,6 +1518,9 @@ enum wined3d_shader_byte_code_format
#define WINED3D_OUTPUT_SLOT_SEMANTIC 0xffffffff
#define WINED3D_OUTPUT_SLOT_UNUSED 0xfffffffe
+#define WINED3D_MAX_STREAM_OUTPUT_BUFFERS 4
+#define WINED3D_STREAM_OUTPUT_GAP 0xffffffff
+
#define WINED3D_VIEW_BUFFER_RAW 0x00000001
#define WINED3D_VIEW_BUFFER_APPEND 0x00000002
#define WINED3D_VIEW_BUFFER_COUNTER 0x00000004
@@ -1975,6 +1978,24 @@ struct wined3d_shader_desc
unsigned int max_version;
};
+struct wined3d_stream_output_element
+{
+ unsigned int stream_idx;
+ unsigned int register_idx;
+ BYTE component_idx;
+ BYTE component_count;
+ BYTE output_slot;
+};
+
+struct wined3d_stream_output_desc
+{
+ struct wined3d_stream_output_element *elements;
+ unsigned int element_count;
+ unsigned int buffer_strides[WINED3D_MAX_STREAM_OUTPUT_BUFFERS];
+ unsigned int buffer_stride_count;
+ unsigned int rasterizer_stream_idx;
+};
+
struct wined3d_view_desc
{
enum wined3d_format_id format_id;
@@ -2486,7 +2507,8 @@ HRESULT __cdecl wined3d_shader_create_cs(struct wined3d_device *device, const st
HRESULT __cdecl wined3d_shader_create_ds(struct wined3d_device *device, const struct wined3d_shader_desc *desc,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader);
HRESULT __cdecl wined3d_shader_create_gs(struct wined3d_device *device, const struct wined3d_shader_desc *desc,
- void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader);
+ const struct wined3d_stream_output_desc *so_desc, void *parent, const struct wined3d_parent_ops *parent_ops,
+ struct wined3d_shader **shader);
HRESULT __cdecl wined3d_shader_create_hs(struct wined3d_device *device, const struct wined3d_shader_desc *desc,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader);
HRESULT __cdecl wined3d_shader_create_ps(struct wined3d_device *device, const struct wined3d_shader_desc *desc,
--
2.10.2
More information about the wine-patches
mailing list