Commit eb4d20ef authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 6909b514
......@@ -1478,13 +1478,49 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
switch (reg->immconst_type)
{
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;
case WINED3D_IMMCONST_VEC4:
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]);
switch (reg->data_type)
{
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;
default:
......
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