wined3d: Add support for immediate constants to the GLSL backend.

This commit is contained in:
Henri Verbeet 2009-05-07 16:36:08 +02:00 committed by Alexandre Julliard
parent 96005c0fca
commit 69cbb57bfd
2 changed files with 28 additions and 0 deletions

View file

@ -1220,6 +1220,25 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
}
break;
case WINED3DSPR_IMMCONST:
switch (reg->immconst_type)
{
case WINED3D_IMMCONST_FLOAT:
sprintf(register_name, "%.8e", *(float *)reg->immconst_data);
break;
case WINED3D_IMMCONST_FLOAT4:
sprintf(register_name, "vec4(%.8e, %.8e, %.8e, %.8e)",
*(float *)&reg->immconst_data[0], *(float *)&reg->immconst_data[1],
*(float *)&reg->immconst_data[2], *(float *)&reg->immconst_data[3]);
break;
default:
FIXME("Unhandled immconst type %#x\n", reg->immconst_type);
sprintf(register_name, "<unhandled_immconst_type %#x>", reg->immconst_type);
}
break;
default:
FIXME("Unhandled register name Type(%d)\n", reg->type);
sprintf(register_name, "unrecognized_register");

View file

@ -2621,6 +2621,15 @@ static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
return FALSE;
}
case WINED3DSPR_IMMCONST:
switch(reg->immconst_type)
{
case WINED3D_IMMCONST_FLOAT:
return TRUE;
default:
return FALSE;
}
default:
return FALSE;
}