Open remage opened 2 weeks ago
Another experiment:
vec3 cam_position = { 0.0, 0.0, 5.0 };
vec3 cam_target = { 0.0, 0.0, 0.0 };
vec3 cam_dir = { 0.0, 0.0, -1.0 }; // normalize(cam_target - cam_position);
This simplifies to:
vec3 d={0.,0.,5.},i={0.,0.,0.};
i={0.,0.,-1.};
It seems to try to reuse the variable i
, but that assignment syntax fails to compile:
error C0000: syntax error, unexpected '{', expecting "::" at token "{"
It compiles when the assignment is fixed (by hand) to:
vec3 d={0.,0.,5.},i={0.,0.,0.};
i=vec3(0.,0.,-1.);
Further experiment: realizing that the fact cam_target
gets reused means that it's not used anywhere else in the code...
So, in this case I can do this (and that is my workaround for now):
vec3 cam_position = { 0.0, 0.0, 5.0 };
// vec3 cam_target = { 0.0, 0.0, 0.0 };
vec3 cam_dir = normalize(vec3(0.0, 0.0, 0.0) - cam_position);
This gets minified and then compiles correctly.
Input:
It gets simplified to this code:
Shader compilation fails inside the normalize() call, with: