Commit 5bf5655b authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Introduce wined3d_stream_output_desc.

parent 1a1b3fd3
......@@ -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);
......
......@@ -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;
......
......@@ -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)))
......
......@@ -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))
{
......
......@@ -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)
......
......@@ -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;
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment