vkd3d-shader/msl: Implement support for VKD3DSPR_TEMP registers.
Introduce a union type for representing 4-components vector registers.
union vkd3d_vec4
{
uint4 u;
int4 i;
float4 f;
};
So add r0.xyzw, r1.xyzw, r2.xyzw
becomes
vkd3d_vec4 r[3];
...
r[0].f.xyzw = r[1].f.xyzw + r[2].f.xyzw;
...
I tested several handcrafted shaders. Metal compiler can always yield the simplest LLVM IR, it can even eliminate bitcast.
Merge request reports
Activity
This is different from the approach used with GLSL (choosing some format and then bitcasting each time that's needed), but I'm open to see whether it turns out to be better or worse. Or maybe just irrelevant.
It's probably nicer. The main reason the GLSL backend doesn't do it this way is that GLSL doesn't have unions.
added 14 commits
-
3d8c7aa7...ebc4f841 - 13 commits from branch
wine:master
- e8b14d76 - vkd3d-shader/msl: Implement support for VKD3DSPR_TEMP registers.
-
3d8c7aa7...ebc4f841 - 13 commits from branch
Please register or sign in to reply