wined3d: Implement SV_IsFrontFace input sysval semantic.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-07-27 23:33:43 +02:00 committed by Alexandre Julliard
parent 3449c79d13
commit a5852dec9c
2 changed files with 11 additions and 3 deletions

View File

@ -5310,6 +5310,10 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w
shader->u.ps.input_reg_map[input->register_idx], reg_mask, reg_mask);
else if (args->pointsprite && shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_TEXCOORD))
shader_addline(buffer, "ps_in[%u] = vec4(gl_PointCoord.xy, 0.0, 0.0);\n", input->register_idx);
else if (input->sysval_semantic == WINED3D_SV_IS_FRONT_FACE)
shader_addline(buffer, "ps_in[%u] = vec4("
"uintBitsToFloat(gl_FrontFacing ? 0xffffffffu : 0u), 0.0, 0.0, 0.0);\n",
input->register_idx);
else
shader_addline(buffer, "ps_in[%u]%s = ps_link[%u]%s;\n",
shader->u.ps.input_reg_map[input->register_idx], reg_mask,

View File

@ -1311,9 +1311,13 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
for (i = 0; i < input_signature->element_count; ++i)
{
reg_maps->input_registers |= 1u << input_signature->elements[i].register_idx;
if (shader_version.type == WINED3D_SHADER_TYPE_PIXEL
&& input_signature->elements[i].sysval_semantic == WINED3D_SV_POSITION)
if (shader_version.type == WINED3D_SHADER_TYPE_PIXEL)
{
if (input_signature->elements[i].sysval_semantic == WINED3D_SV_POSITION)
reg_maps->vpos = 1;
else if (input_signature->elements[i].sysval_semantic == WINED3D_SV_IS_FRONT_FACE)
reg_maps->usesfacing = 1;
}
}
}
else if (!input_signature->elements && reg_maps->input_registers)