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

wined3d: Implement SV_IsFrontFace input sysval semantic.

parent 3449c79d
...@@ -5310,6 +5310,10 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w ...@@ -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); 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)) 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); 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 else
shader_addline(buffer, "ps_in[%u]%s = ps_link[%u]%s;\n", shader_addline(buffer, "ps_in[%u]%s = ps_link[%u]%s;\n",
shader->u.ps.input_reg_map[input->register_idx], reg_mask, shader->u.ps.input_reg_map[input->register_idx], reg_mask,
......
...@@ -1311,9 +1311,13 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st ...@@ -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) for (i = 0; i < input_signature->element_count; ++i)
{ {
reg_maps->input_registers |= 1u << input_signature->elements[i].register_idx; reg_maps->input_registers |= 1u << input_signature->elements[i].register_idx;
if (shader_version.type == WINED3D_SHADER_TYPE_PIXEL if (shader_version.type == WINED3D_SHADER_TYPE_PIXEL)
&& input_signature->elements[i].sysval_semantic == WINED3D_SV_POSITION) {
reg_maps->vpos = 1; 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) else if (!input_signature->elements && reg_maps->input_registers)
......
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