18bcc9b790
This subtle bug removed any expression validation for trivially swizzled variables. Make usage suppression a more explicit concept rather than just hacking off forwarded_temporaries. There is some fallout here with loop generation since our expression invalidation is currently a bit too naive to handle loops properly. The forwarding bug masked this problem until now. If part of the loop condition is also used in the body, we end up reading an invalid expression, which in turn forces a temporary to be generated in the condition block, not good. We'll need to be smarter here ...
21 lines
326 B
Plaintext
21 lines
326 B
Plaintext
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct SSBOScalar
|
|
{
|
|
float2 a;
|
|
packed_float3 b;
|
|
packed_float3 c;
|
|
};
|
|
|
|
kernel void main0(device SSBOScalar& _4 [[buffer(0)]])
|
|
{
|
|
float3 _21 = float3(_4.b);
|
|
float3 _24 = float3(_4.c);
|
|
_4.b = float3(1.0);
|
|
_4.a = _21.xy * _24.yz;
|
|
}
|
|
|