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: 1.#R values from the Gpu

  1. #1
    Intern Contributor
    Join Date
    Oct 2012
    Posts
    53

    1.#R values from the Gpu

    Hi

    I am returning float value , 1.#R , from the gpu. (I am printing it out).

    What does this indicate and why could i be getting this?

    thanks

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    How are you printing it out - it looks like a format problem

  3. #3
    Intern Contributor
    Join Date
    Oct 2012
    Posts
    53
    I use glMapBuffer to map over data from the GPU onto the cpu and obtain a pointer to that memory space.
    char* myMem=(char *)glMapBuffer(GL_SHADER_STORAGE_BUFFER,GL_READ_ONL Y);

    Then I cast portions of my memory to a struct that mirrors the way data exists in the storage buffer.
    struct mystruct{
    std::vector<float> a;
    float b;
    float c;
    }

    Inside my shader, the storage shader buffer object is defined as:
    struct mystruct{
    vec4 a;
    float b;
    float c;
    };
    layout(std430,binding=0) buffer fBuffer{
    mystruct animal_tag[];
    }mystructA;


    On the cpu side, I print out the mapped memory space by casting them to struct, mystruct, like I mentioned above.

    printf ("%.2f,%.2f,%.2f,%.2f) %.2f\n ",(float)mystruct->a.x,(float)mystruct->a.y,(float)mystruct->a.z,(float)mystruct->a.w,(float)mystruct->c);

Tags for this Thread

Posting Permissions

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