Code generation problem #24

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

Comments

Projects
None yet
1 participant

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.

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