Skip to content

lima/gpir: support ge, floor, sign

Qiang Yu requested to merge enunes:lima-18.0-gpir-acc-op into lima-18.0

Created by: enunes

For the first patch, there is some discussion at: https://lists.freedesktop.org/archives/mesa-dev/2018-April/192317.html We may have to consider changing the handling of ints/floats as suggested there but as of now it already has one reviewed-by and no doubt it's a bug in the optimization path we're currently hitting.

I tested ge, floor, sign with gbm-surface and the following vertex shaders that insert the according nir op:

ge:

attribute vec3 positionIn;
void main()
{
    vec3 myvar = positionIn;
    if (positionIn.x >= positionIn.y)
        myvar.y = 0.8;
    gl_Position = vec4(myvar, 1);
}

floor:

attribute vec3 positionIn;
void main()
{
    vec3 myvar = positionIn;
    myvar.x += 0.1;
    myvar.y += 0.1;
    myvar.z += 0.1;
    gl_Position = vec4(floor(myvar.x), floor(myvar.y), floor(myvar.z), 1);
}

sign:

attribute vec3 positionIn;
void main()
{
    vec3 myvar = positionIn;
    myvar.x += 0.1;
    myvar.y += 0.1;
    gl_Position = vec4(sign(myvar.x), sign(myvar.y), myvar.z, 1);
}

Merge request reports

Loading