[PATCH 2/7] wined3d: Fix handling of SM4+ integer registers.
Henri Verbeet
hverbeet at gmail.com
Thu Feb 23 12:15:33 CST 2017
On 23 February 2017 at 15:00, Józef Kucia <jkucia at codeweavers.com> wrote:
> @@ -2972,40 +3016,27 @@ static void shader_glsl_add_src_param_ext(const struct wined3d_shader_instructio
> shader_glsl_get_register_name(&wined3d_src->reg, glsl_src->reg_name, &is_color, ins);
> shader_glsl_get_swizzle(wined3d_src, is_color, mask, swizzle_str);
>
> - if (wined3d_src->reg.type == WINED3DSPR_IMMCONST
> - || wined3d_src->reg.type == WINED3DSPR_PRIMID
> - || wined3d_src->reg.type == WINED3DSPR_LOCALTHREADINDEX
> - || wined3d_src->reg.type == WINED3DSPR_THREADID
> - || wined3d_src->reg.type == WINED3DSPR_THREADGROUPID
> - || wined3d_src->reg.type == WINED3DSPR_LOCALTHREADID)
> + switch (wined3d_src->reg.type)
> {
> - shader_glsl_gen_modifier(wined3d_src->modifiers, glsl_src->reg_name, swizzle_str, glsl_src->param_str);
> + case WINED3DSPR_IMMCONST:
> + param_data_type = data_type;
> + break;
This matches the existing behaviour, and in that regard this is fine,
and it probably won't matter in practice, but note that
shader_glsl_get_register_name() uses "reg->data_type", which isn't
necessarily the same as "data_type" here.
I think the usage of sprintf() is more problematic. That too matches
the existing code, but we should be using string_buffer_sprintf() for
this kind of thing.
More information about the wine-devel
mailing list