PDA

View Full Version : 1.#R values from the Gpu



driver
11-08-2013, 08:17 PM
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

tonyo_au
11-09-2013, 12:53 AM
How are you printing it out - it looks like a format problem

driver
11-14-2013, 01:16 PM
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);