diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 33746af53f3..247c6f36417 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5250,6 +5250,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_DCL_TEMPS */ NULL, /* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL, /* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL, + /* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL, /* WINED3DSIH_DCL_UAV_TYPED */ NULL, /* WINED3DSIH_DCL_VERTICES_OUT */ shader_hw_nop, /* WINED3DSIH_DEF */ shader_hw_nop, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 89f5b5e4976..1c59d6348f0 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -8164,6 +8164,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_DCL_TEMPS */ shader_glsl_nop, /* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL, /* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL, + /* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL, /* WINED3DSIH_DCL_UAV_TYPED */ NULL, /* WINED3DSIH_DCL_VERTICES_OUT */ shader_glsl_nop, /* WINED3DSIH_DEF */ shader_glsl_nop, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 4e1a617e30d..eb8f13f7b9d 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -76,6 +76,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_DCL_TEMPS */ "dcl_temps", /* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ "dcl_tessellator_domain", /* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ "dcl_tessellator_output_primitive", + /* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ "dcl_tessellator_partitioning", /* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed", /* WINED3DSIH_DCL_VERTICES_OUT */ "dcl_maxOutputVertexCount", /* WINED3DSIH_DEF */ "def", @@ -1342,6 +1343,29 @@ static void shader_dump_tessellator_output_primitive(struct wined3d_string_buffe } } +static void shader_dump_tessellator_partitioning(struct wined3d_string_buffer *buffer, + enum wined3d_tessellator_partitioning partitioning) +{ + switch (partitioning) + { + case WINED3D_TESSELLATOR_PARTITIONING_INTEGER: + shader_addline(buffer, "integer"); + break; + case WINED3D_TESSELLATOR_PARTITIONING_POW2: + shader_addline(buffer, "pow2"); + break; + case WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD: + shader_addline(buffer, "fractional_odd"); + break; + case WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN: + shader_addline(buffer, "fractional_even"); + break; + default: + shader_addline(buffer, "unknown_tessellator_partitioning(%#x)", partitioning); + break; + } +} + static void shader_dump_sysval_semantic(struct wined3d_string_buffer *buffer, enum wined3d_sysval_semantic semantic) { unsigned int i; @@ -2148,6 +2172,11 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); shader_dump_tessellator_output_primitive(&buffer, ins.declaration.tessellator_output_primitive); } + else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_PARTITIONING) + { + shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_tessellator_partitioning(&buffer, ins.declaration.tessellator_partitioning); + } else if (ins.handler_idx == WINED3DSIH_DEF) { shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e", shader_get_float_offset(ins.dst[0].reg.type, diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 515061b7d77..c5817bee668 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -199,6 +199,7 @@ enum wined3d_sm4_opcode WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT = 0x93, WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT = 0x94, WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN = 0x95, + WINED3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING = 0x96, WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE = 0x97, WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR = 0x98, WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99, @@ -420,6 +421,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT, "", ""}, {WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT, "", ""}, {WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN, WINED3DSIH_DCL_TESSELLATOR_DOMAIN, "", ""}, + {WINED3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING, WINED3DSIH_DCL_TESSELLATOR_PARTITIONING, "", ""}, {WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, "", ""}, {WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR, WINED3DSIH_DCL_HS_MAX_TESSFACTOR, "", ""}, {WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT, WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT, "", ""}, @@ -1056,6 +1058,11 @@ static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wi ins->declaration.tessellator_output_primitive = (opcode_token & WINED3D_SM5_TESSELLATOR_MASK) >> WINED3D_SM5_TESSELLATOR_SHIFT; } + else if (opcode == WINED3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING) + { + ins->declaration.tessellator_partitioning = (opcode_token & WINED3D_SM5_TESSELLATOR_MASK) + >> WINED3D_SM5_TESSELLATOR_SHIFT; + } else if (opcode == WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY) { enum wined3d_sm4_output_primitive_type primitive_type; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0bcc82d2b36..b089d3774c8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -454,6 +454,14 @@ enum wined3d_tessellator_output_primitive WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, }; +enum wined3d_tessellator_partitioning +{ + WINED3D_TESSELLATOR_PARTITIONING_INTEGER = 1, + WINED3D_TESSELLATOR_PARTITIONING_POW2 = 2, + WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, +}; + /* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */ #define WINED3DSI_TEXLD_PROJECT 0x1 #define WINED3DSI_TEXLD_BIAS 0x2 @@ -548,6 +556,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_DCL_TEMPS, WINED3DSIH_DCL_TESSELLATOR_DOMAIN, WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, + WINED3DSIH_DCL_TESSELLATOR_PARTITIONING, WINED3DSIH_DCL_UAV_TYPED, WINED3DSIH_DCL_VERTICES_OUT, WINED3DSIH_DEF, @@ -876,6 +885,7 @@ struct wined3d_shader_instruction struct wined3d_shader_structured_resource structured_resource; enum wined3d_tessellator_domain tessellator_domain; enum wined3d_tessellator_output_primitive tessellator_output_primitive; + enum wined3d_tessellator_partitioning tessellator_partitioning; float max_tessellation_factor; } declaration; };