wined3d: Take the data type of immediates into account in shader_glsl_get_register_name().

This commit is contained in:
Henri Verbeet 2012-09-23 22:14:49 +02:00 committed by Alexandre Julliard
parent 6909b5143b
commit eb4d20ef31
1 changed files with 40 additions and 4 deletions

View File

@ -1478,13 +1478,49 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
switch (reg->immconst_type) switch (reg->immconst_type)
{ {
case WINED3D_IMMCONST_SCALAR: case WINED3D_IMMCONST_SCALAR:
sprintf(register_name, "%.8e", *(const float *)reg->immconst_data); switch (reg->data_type)
{
case WINED3D_DATA_FLOAT:
sprintf(register_name, "%.8e", *(const float *)reg->immconst_data);
break;
case WINED3D_DATA_INT:
sprintf(register_name, "%#x", reg->immconst_data[0]);
break;
case WINED3D_DATA_RESOURCE:
case WINED3D_DATA_SAMPLER:
case WINED3D_DATA_UINT:
sprintf(register_name, "%#xu", reg->immconst_data[0]);
break;
default:
sprintf(register_name, "<unhandled data type %#x>", reg->data_type);
break;
}
break; break;
case WINED3D_IMMCONST_VEC4: case WINED3D_IMMCONST_VEC4:
sprintf(register_name, "vec4(%.8e, %.8e, %.8e, %.8e)", switch (reg->data_type)
*(const float *)&reg->immconst_data[0], *(const float *)&reg->immconst_data[1], {
*(const float *)&reg->immconst_data[2], *(const float *)&reg->immconst_data[3]); case WINED3D_DATA_FLOAT:
sprintf(register_name, "vec4(%.8e, %.8e, %.8e, %.8e)",
*(const float *)&reg->immconst_data[0], *(const float *)&reg->immconst_data[1],
*(const float *)&reg->immconst_data[2], *(const float *)&reg->immconst_data[3]);
break;
case WINED3D_DATA_INT:
sprintf(register_name, "ivec4(%#x, %#x, %#x, %#x)",
reg->immconst_data[0], reg->immconst_data[1],
reg->immconst_data[2], reg->immconst_data[3]);
break;
case WINED3D_DATA_RESOURCE:
case WINED3D_DATA_SAMPLER:
case WINED3D_DATA_UINT:
sprintf(register_name, "uvec4(%#xu, %#xu, %#xu, %#xu)",
reg->immconst_data[0], reg->immconst_data[1],
reg->immconst_data[2], reg->immconst_data[3]);
break;
default:
sprintf(register_name, "<unhandled data type %#x>", reg->data_type);
break;
}
break; break;
default: default: