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

wined3d: Handle compute shader registers in GLSL backend.

parent 5061abe4
......@@ -2840,6 +2840,22 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
sprintf(register_name, "X%u[%u]", reg->idx[0].offset, reg->idx[1].offset);
break;
case WINED3DSPR_LOCALTHREADINDEX:
sprintf(register_name, "int(gl_LocalInvocationIndex)");
break;
case WINED3DSPR_THREADID:
sprintf(register_name, "ivec3(gl_GlobalInvocationID)");
break;
case WINED3DSPR_THREADGROUPID:
sprintf(register_name, "ivec3(gl_WorkGroupID)");
break;
case WINED3DSPR_LOCALTHREADID:
sprintf(register_name, "ivec3(gl_LocalInvocationID)");
break;
default:
FIXME("Unhandled register type %#x.\n", reg->type);
sprintf(register_name, "unrecognized_register");
......@@ -2928,7 +2944,12 @@ 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)
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)
{
shader_glsl_gen_modifier(wined3d_src->modifiers, glsl_src->reg_name, swizzle_str, glsl_src->param_str);
}
......
......@@ -3596,6 +3596,7 @@ static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
case WINED3DSPR_LOOP: /* aL */
case WINED3DSPR_PREDICATE: /* p0 */
case WINED3DSPR_PRIMID: /* primID */
case WINED3DSPR_LOCALTHREADINDEX: /* vThreadIDInGroupFlattened */
return TRUE;
case WINED3DSPR_MISCTYPE:
......
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