Commit 9a27b0ad authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Add support for geometry shaders to the GLSL shader backend.

parent db3b97de
......@@ -65,7 +65,7 @@ const struct wined3d_matrix identity =
/* Note that except for WINED3DPT_POINTLIST and WINED3DPT_LINELIST these
* actually have the same values in GL and D3D. */
static GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
{
switch(primitive_type)
{
......
......@@ -544,6 +544,30 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
else
reg_maps->cb_sizes[reg->idx[0].offset] = reg->idx[1].offset;
}
else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PRIMITIVE)
{
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
shader->u.gs.input_type = ins.declaration.primitive_type;
else
FIXME("Invalid instruction %#x for shader type %#x.\n",
ins.handler_idx, shader_version.type);
}
else if (ins.handler_idx == WINED3DSIH_DCL_OUTPUT_TOPOLOGY)
{
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
shader->u.gs.output_type = ins.declaration.primitive_type;
else
FIXME("Invalid instruction %#x for shader type %#x.\n",
ins.handler_idx, shader_version.type);
}
else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT)
{
if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY)
shader->u.gs.vertices_out = ins.declaration.count;
else
FIXME("Invalid instruction %#x for shader type %#x.\n",
ins.handler_idx, shader_version.type);
}
else if (ins.handler_idx == WINED3DSIH_DEF)
{
struct wined3d_shader_lconst *lconst = HeapAlloc(GetProcessHeap(), 0, sizeof(*lconst));
......
......@@ -2558,6 +2558,7 @@ BOOL getColorBits(const struct wined3d_format *format,
BYTE *redSize, BYTE *greenSize, BYTE *blueSize, BYTE *alphaSize, BYTE *totalSize) DECLSPEC_HIDDEN;
BOOL getDepthStencilBits(const struct wined3d_format *format,
BYTE *depthSize, BYTE *stencilSize) DECLSPEC_HIDDEN;
GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type) DECLSPEC_HIDDEN;
/* Math utils */
void multiply_matrix(struct wined3d_matrix *dest, const struct wined3d_matrix *src1,
......@@ -2603,6 +2604,13 @@ struct wined3d_vertex_shader
struct wined3d_shader_attribute attributes[MAX_ATTRIBS];
};
struct wined3d_geometry_shader
{
enum wined3d_primitive_type input_type;
enum wined3d_primitive_type output_type;
UINT vertices_out;
};
struct wined3d_pixel_shader
{
/* Pixel shader input semantics */
......@@ -2648,6 +2656,7 @@ struct wined3d_shader
union
{
struct wined3d_vertex_shader vs;
struct wined3d_geometry_shader gs;
struct wined3d_pixel_shader ps;
} u;
};
......
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