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

wined3d: Fix wined3d_sysval_semantic values for tessellation factors.

Apparently, dcl_input_* instructions do not use the same values as sysval semantics in shader signatures. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ec46c5be
......@@ -298,33 +298,33 @@ static const char * const semantic_names[] =
static const struct
{
enum wined3d_sysval_semantic sysval_semantic;
enum wined3d_shader_input_sysval_semantic sysval_semantic;
const char *sysval_name;
}
sysval_semantic_names[] =
shader_input_sysval_semantic_names[] =
{
{WINED3D_SV_POSITION, "SV_Position"},
{WINED3D_SV_CLIP_DISTANCE, "SV_ClipDistance"},
{WINED3D_SV_CULL_DISTANCE, "SV_CullDistance"},
{WINED3D_SV_RENDER_TARGET_ARRAY_INDEX, "SV_RenderTargetArrayIndex"},
{WINED3D_SV_VIEWPORT_ARRAY_INDEX, "SV_ViewportArrayIndex"},
{WINED3D_SV_VERTEX_ID, "SV_VertexID"},
{WINED3D_SV_INSTANCE_ID, "SV_InstanceID"},
{WINED3D_SV_PRIMITIVE_ID, "SV_PrimitiveID"},
{WINED3D_SV_IS_FRONT_FACE, "SV_IsFrontFace"},
{WINED3D_SV_SAMPLE_INDEX, "SV_SampleIndex"},
{WINED3D_SV_QUAD_U0_TESS_FACTOR, "finalQuadUeq0EdgeTessFactor"},
{WINED3D_SV_QUAD_V0_TESS_FACTOR, "finalQuadVeq0EdgeTessFactor"},
{WINED3D_SV_QUAD_U1_TESS_FACTOR, "finalQuadUeq1EdgeTessFactor"},
{WINED3D_SV_QUAD_V1_TESS_FACTOR, "finalQuadVeq1EdgeTessFactor"},
{WINED3D_SV_QUAD_U_INNER_TESS_FACTOR, "finalQuadUInsideTessFactor"},
{WINED3D_SV_QUAD_V_INNER_TESS_FACTOR, "finalQuadVInsideTessFactor"},
{WINED3D_SV_TRIANGLE_U_TESS_FACTOR, "finalTriUeq0EdgeTessFactor"},
{WINED3D_SV_TRIANGLE_V_TESS_FACTOR, "finalTriVeq0EdgeTessFactor"},
{WINED3D_SV_TRIANGLE_W_TESS_FACTOR, "finalTriWeq0EdgeTessFactor"},
{WINED3D_SV_TRIANGLE_INNER_TESS_FACTOR, "finalTriInsideTessFactor"},
{WINED3D_SV_LINE_DETAIL_TESS_FACTOR, "finalLineDetailTessFactor"},
{WINED3D_SV_LINE_DENSITY_TESS_FACTOR, "finalLineDensityTessFactor"},
{WINED3D_SIV_POSITION, "position"},
{WINED3D_SIV_CLIP_DISTANCE, "clip_distance"},
{WINED3D_SIV_CULL_DISTANCE, "cull_distance"},
{WINED3D_SIV_RENDER_TARGET_ARRAY_INDEX, "render_target_array_index"},
{WINED3D_SIV_VIEWPORT_ARRAY_INDEX, "viewport_array_index"},
{WINED3D_SIV_VERTEX_ID, "vertex_id"},
{WINED3D_SIV_INSTANCE_ID, "instance_id"},
{WINED3D_SIV_PRIMITIVE_ID, "primitive_id"},
{WINED3D_SIV_IS_FRONT_FACE, "is_front_face"},
{WINED3D_SIV_SAMPLE_INDEX, "sample_index"},
{WINED3D_SIV_QUAD_U0_TESS_FACTOR, "finalQuadUeq0EdgeTessFactor"},
{WINED3D_SIV_QUAD_V0_TESS_FACTOR, "finalQuadVeq0EdgeTessFactor"},
{WINED3D_SIV_QUAD_U1_TESS_FACTOR, "finalQuadUeq1EdgeTessFactor"},
{WINED3D_SIV_QUAD_V1_TESS_FACTOR, "finalQuadVeq1EdgeTessFactor"},
{WINED3D_SIV_QUAD_U_INNER_TESS_FACTOR, "finalQuadUInsideTessFactor"},
{WINED3D_SIV_QUAD_V_INNER_TESS_FACTOR, "finalQuadVInsideTessFactor"},
{WINED3D_SIV_TRIANGLE_U_TESS_FACTOR, "finalTriUeq0EdgeTessFactor"},
{WINED3D_SIV_TRIANGLE_V_TESS_FACTOR, "finalTriVeq0EdgeTessFactor"},
{WINED3D_SIV_TRIANGLE_W_TESS_FACTOR, "finalTriWeq0EdgeTessFactor"},
{WINED3D_SIV_TRIANGLE_INNER_TESS_FACTOR, "finalTriInsideTessFactor"},
{WINED3D_SIV_LINE_DETAIL_TESS_FACTOR, "finalLineDetailTessFactor"},
{WINED3D_SIV_LINE_DENSITY_TESS_FACTOR, "finalLineDensityTessFactor"},
};
static void shader_dump_src_param(struct wined3d_string_buffer *buffer,
......@@ -1854,20 +1854,21 @@ static void shader_dump_tessellator_partitioning(struct wined3d_string_buffer *b
}
}
static void shader_dump_sysval_semantic(struct wined3d_string_buffer *buffer, enum wined3d_sysval_semantic semantic)
static void shader_dump_shader_input_sysval_semantic(struct wined3d_string_buffer *buffer,
enum wined3d_shader_input_sysval_semantic semantic)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(sysval_semantic_names); ++i)
for (i = 0; i < ARRAY_SIZE(shader_input_sysval_semantic_names); ++i)
{
if (sysval_semantic_names[i].sysval_semantic == semantic)
if (shader_input_sysval_semantic_names[i].sysval_semantic == semantic)
{
shader_addline(buffer, "%s", sysval_semantic_names[i].sysval_name);
shader_addline(buffer, "%s", shader_input_sysval_semantic_names[i].sysval_name);
return;
}
}
shader_addline(buffer, "unknown_sysval_semantic(%#x)", semantic);
shader_addline(buffer, "unknown_shader_input_sysval_semantic(%#x)", semantic);
}
static void shader_dump_decl_usage(struct wined3d_string_buffer *buffer,
......@@ -2727,7 +2728,7 @@ 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_dst_param(&buffer, &ins.declaration.register_semantic.reg, &shader_version);
shader_addline(&buffer, ", ");
shader_dump_sysval_semantic(&buffer, ins.declaration.register_semantic.sysval_semantic);
shader_dump_shader_input_sysval_semantic(&buffer, ins.declaration.register_semantic.sysval_semantic);
}
else if (ins.handler_idx == WINED3DSIH_DCL_INPUT_PS_SIV)
{
......@@ -2736,7 +2737,7 @@ static void shader_trace_init(const struct wined3d_shader_frontend *fe, void *fe
shader_addline(&buffer, " ");
shader_dump_dst_param(&buffer, &ins.declaration.register_semantic.reg, &shader_version);
shader_addline(&buffer, ", ");
shader_dump_sysval_semantic(&buffer, ins.declaration.register_semantic.sysval_semantic);
shader_dump_shader_input_sysval_semantic(&buffer, ins.declaration.register_semantic.sysval_semantic);
}
else if (ins.handler_idx == WINED3DSIH_DCL_INPUT
|| ins.handler_idx == WINED3DSIH_DCL_OUTPUT)
......
......@@ -1099,10 +1099,36 @@ struct wined3d_shader_semantic
struct wined3d_shader_dst_param reg;
};
enum wined3d_shader_input_sysval_semantic
{
WINED3D_SIV_POSITION = 1,
WINED3D_SIV_CLIP_DISTANCE = 2,
WINED3D_SIV_CULL_DISTANCE = 3,
WINED3D_SIV_RENDER_TARGET_ARRAY_INDEX = 4,
WINED3D_SIV_VIEWPORT_ARRAY_INDEX = 5,
WINED3D_SIV_VERTEX_ID = 6,
WINED3D_SIV_PRIMITIVE_ID = 7,
WINED3D_SIV_INSTANCE_ID = 8,
WINED3D_SIV_IS_FRONT_FACE = 9,
WINED3D_SIV_SAMPLE_INDEX = 10,
WINED3D_SIV_QUAD_U0_TESS_FACTOR = 11,
WINED3D_SIV_QUAD_V0_TESS_FACTOR = 12,
WINED3D_SIV_QUAD_U1_TESS_FACTOR = 13,
WINED3D_SIV_QUAD_V1_TESS_FACTOR = 14,
WINED3D_SIV_QUAD_U_INNER_TESS_FACTOR = 15,
WINED3D_SIV_QUAD_V_INNER_TESS_FACTOR = 16,
WINED3D_SIV_TRIANGLE_U_TESS_FACTOR = 17,
WINED3D_SIV_TRIANGLE_V_TESS_FACTOR = 18,
WINED3D_SIV_TRIANGLE_W_TESS_FACTOR = 19,
WINED3D_SIV_TRIANGLE_INNER_TESS_FACTOR = 20,
WINED3D_SIV_LINE_DETAIL_TESS_FACTOR = 21,
WINED3D_SIV_LINE_DENSITY_TESS_FACTOR = 22,
};
struct wined3d_shader_register_semantic
{
struct wined3d_shader_dst_param reg;
enum wined3d_sysval_semantic sysval_semantic;
enum wined3d_shader_input_sysval_semantic sysval_semantic;
};
struct wined3d_shader_structured_resource
......
......@@ -763,18 +763,12 @@ enum wined3d_sysval_semantic
WINED3D_SV_INSTANCE_ID = 8,
WINED3D_SV_IS_FRONT_FACE = 9,
WINED3D_SV_SAMPLE_INDEX = 10,
WINED3D_SV_QUAD_U0_TESS_FACTOR = 11,
WINED3D_SV_QUAD_V0_TESS_FACTOR = 12,
WINED3D_SV_QUAD_U1_TESS_FACTOR = 13,
WINED3D_SV_QUAD_V1_TESS_FACTOR = 14,
WINED3D_SV_QUAD_U_INNER_TESS_FACTOR = 15,
WINED3D_SV_QUAD_V_INNER_TESS_FACTOR = 16,
WINED3D_SV_TRIANGLE_U_TESS_FACTOR = 17,
WINED3D_SV_TRIANGLE_V_TESS_FACTOR = 18,
WINED3D_SV_TRIANGLE_W_TESS_FACTOR = 19,
WINED3D_SV_TRIANGLE_INNER_TESS_FACTOR = 20,
WINED3D_SV_LINE_DETAIL_TESS_FACTOR = 21,
WINED3D_SV_LINE_DENSITY_TESS_FACTOR = 22,
WINED3D_SV_TESS_FACTOR_QUADEDGE = 11,
WINED3D_SV_TESS_FACTOR_QUADINT = 12,
WINED3D_SV_TESS_FACTOR_TRIEDGE = 13,
WINED3D_SV_TESS_FACTOR_TRIINT = 14,
WINED3D_SV_TESS_FACTOR_LINEDET = 15,
WINED3D_SV_TESS_FACTOR_LINEDEN = 16,
};
enum wined3d_component_type
......
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