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

wined3d: Generate code for domain shaders.

parent 0994528b
......@@ -2625,7 +2625,8 @@ void context_unmap_bo_address(struct wined3d_context *context,
static void context_set_render_offscreen(struct wined3d_context *context, BOOL offscreen)
{
if (context->render_offscreen == offscreen) return;
if (context->render_offscreen == offscreen)
return;
context_invalidate_state(context, STATE_VIEWPORT);
context_invalidate_state(context, STATE_SCISSORRECT);
......@@ -2634,6 +2635,7 @@ static void context_set_render_offscreen(struct wined3d_context *context, BOOL o
context_invalidate_state(context, STATE_FRONTFACE);
context_invalidate_state(context, STATE_POINTSPRITECOORDORIGIN);
context_invalidate_state(context, STATE_TRANSFORM(WINED3D_TS_PROJECTION));
context_invalidate_state(context, STATE_SHADER(WINED3D_SHADER_TYPE_DOMAIN));
}
if (context->gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
context_invalidate_state(context, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL));
......
......@@ -1095,6 +1095,27 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
{
reg_maps->temporary_count = ins.declaration.count;
}
else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_DOMAIN)
{
if (shader_version.type == WINED3D_SHADER_TYPE_DOMAIN)
shader->u.ds.tessellator_domain = ins.declaration.tessellator_domain;
else if (shader_version.type != WINED3D_SHADER_TYPE_HULL)
FIXME("Invalid instruction %#x for shader type %#x.\n", ins.handler_idx, shader_version.type);
}
else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE)
{
if (shader_version.type == WINED3D_SHADER_TYPE_HULL)
shader->u.hs.tessellator_output_primitive = ins.declaration.tessellator_output_primitive;
else
FIXME("Invalid instruction %#x for shader type %#x.\n", ins.handler_idx, shader_version.type);
}
else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_PARTITIONING)
{
if (shader_version.type == WINED3D_SHADER_TYPE_HULL)
shader->u.hs.tessellator_partitioning = ins.declaration.tessellator_partitioning;
else
FIXME("Invalid instruction %#x for shader type %#x.\n", ins.handler_idx, shader_version.type);
}
else if (ins.handler_idx == WINED3DSIH_DCL_TGSM_RAW)
{
if (FAILED(hr = shader_reg_maps_add_tgsm(reg_maps, ins.declaration.tgsm_raw.reg.reg.idx[0].offset,
......@@ -3486,6 +3507,24 @@ static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3
return WINED3D_OK;
}
void find_ds_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
struct ds_compile_args *args, const struct wined3d_context *context)
{
const struct wined3d_shader *hull_shader = state->shader[WINED3D_SHADER_TYPE_HULL];
args->tessellator_output_primitive = hull_shader->u.hs.tessellator_output_primitive;
args->tessellator_partitioning = hull_shader->u.hs.tessellator_partitioning;
args->output_count = state->shader[WINED3D_SHADER_TYPE_GEOMETRY] ?
state->shader[WINED3D_SHADER_TYPE_GEOMETRY]->limits->packed_input :
state->shader[WINED3D_SHADER_TYPE_PIXEL] ? state->shader[WINED3D_SHADER_TYPE_PIXEL]->limits->packed_input
: shader->limits->packed_output;
args->next_shader_type = state->shader[WINED3D_SHADER_TYPE_GEOMETRY] ? WINED3D_SHADER_TYPE_GEOMETRY
: WINED3D_SHADER_TYPE_PIXEL;
args->render_offscreen = context->render_offscreen;
}
void find_gs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
struct gs_compile_args *args)
{
......
......@@ -1329,6 +1329,15 @@ struct vs_compile_args
unsigned int next_shader_input_count;
};
struct ds_compile_args
{
enum wined3d_tessellator_output_primitive tessellator_output_primitive;
enum wined3d_tessellator_partitioning tessellator_partitioning;
unsigned int output_count : 16;
unsigned int next_shader_type : 3;
unsigned int render_offscreen : 1;
};
struct gs_compile_args
{
unsigned int output_count;
......@@ -3698,6 +3707,17 @@ struct wined3d_vertex_shader
struct wined3d_shader_attribute attributes[MAX_ATTRIBS];
};
struct wined3d_domain_shader
{
enum wined3d_tessellator_domain tessellator_domain;
};
struct wined3d_hull_shader
{
enum wined3d_tessellator_output_primitive tessellator_output_primitive;
enum wined3d_tessellator_partitioning tessellator_partitioning;
};
struct wined3d_geometry_shader
{
enum wined3d_primitive_type input_type;
......@@ -3761,6 +3781,8 @@ struct wined3d_shader
union
{
struct wined3d_vertex_shader vs;
struct wined3d_domain_shader ds;
struct wined3d_hull_shader hs;
struct wined3d_geometry_shader gs;
struct wined3d_pixel_shader ps;
struct wined3d_compute_shader cs;
......@@ -3776,6 +3798,9 @@ void find_vs_compile_args(const struct wined3d_state *state, const struct wined3
WORD swizzle_map, struct vs_compile_args *args,
const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN;
void find_ds_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
struct ds_compile_args *args, const struct wined3d_context *context) DECLSPEC_HIDDEN;
void find_gs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
struct gs_compile_args *args) DECLSPEC_HIDDEN;
......
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