Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: soft emulator necessary in the driver for GLSL?

  1. #1
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264

    soft emulator necessary in the driver for GLSL?

    From what I understand, the driver has to kick into sw emulation when the program exceeds the hw limits. Is this correct?

    I guess it won't (or is it optional) for the driver to do a multipass.

    Another thing.
    If I have

    vec3 val;
    vec4 val2;
    result=dot(val, val2);

    The compiler complains about dot because one is vec3 and the other vec4. Can't it do dot3 here?
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  2. #2
    Junior Member Regular Contributor
    Join Date
    May 2003
    Location
    Germany
    Posts
    229

    Re: soft emulator necessary in the driver for GLSL?

    Originally posted by V-man:
    From what I understand, the driver has to kick into sw emulation when the program exceeds the hw limits. Is this correct?
    No, if you exceed the maximum number of instructions, the compiler will tell you that. So you'll have to split your shaders by yourself. But if you use some function that isn't available through HW, then a (final) glSlang-implementation has to support a SW-Emulation for that (see noise in FS on ATI for example).

    Another thing.
    If I have

    vec3 val;
    vec4 val2;
    result=dot(val, val2);

    The compiler complains about dot because one is vec3 and the other vec4. Can't it do dot3 here?
    result = dot(val, vec3(val))
    or
    result = dot(vec4(val), vec3)




    [This message has been edited by PanzerSchreck (edited 01-31-2004).]

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,576

    Re: soft emulator necessary in the driver for GLSL?

    No, if you exceed the maximum number of instructions, the compiler will tell you that. So you'll have to split your shaders by yourself. But if you use some function that isn't available through HW, then a (final) glSlang-implementation has to support a SW-Emulation for that (see noise in FS on ATI for example).
    That's actually an odd part of the spec.

    Let's say that the problem with a noise function is that it would take 250 opcodes to pull off. So, ATi could easily claim that they "support" the noise function, but it just so happens to throw every shader over the resource limits. By the spec, this behavior is OK. Just as if your shader was near the resource limits, and then you add an instruction that transates to more hardware ops than are avaliable.

    To be honest, I'd prefer it this way. Better to get a "shader compile failed error" than have to actually test the shader on the hardware to know if it's going to kill your performance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •