Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation problem #24

Open
RobDangerous opened this issue Apr 14, 2013 · 1 comment
Open

Code generation problem #24

RobDangerous opened this issue Apr 14, 2013 · 1 comment

Comments

@RobDangerous
Copy link

This glsl code:

#version 100

attribute vec3 vertexPosition;
attribute vec2 texPosition;
uniform mat4 projectionMatrix;
varying vec2 texCoord;

void main() {
    gl_Position = projectionMatrix * vec4(vertexPosition, 1.0);
    texCoord = texPosition;
    gl_Position.z = 0.5;
}

Generates this agal:

mov vt0.w, vc0.x
mov vt0.xyz, va0.xyzz
mov v0, vc0
mov v0.xy, va1.xyyy
m44 op, vt0, vc1
mov op, vc0
mov op.z, vc0.y

and these const fields:

"consts": {
"vc0": [
1,
0.5,
0,
0
]
}

The mov op, vc0 instruction (second last) does not seem to make any sense at all. After removing it the shader works as intended.

@RobDangerous
Copy link
Author

Didn't yet manage to compile on Windows, but I think the problem might be related to line 564 in ir_print_agal_visitor.cpp which tries to insert exactly this instruction when it thinks, an output register was not fully initialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant