Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualNumberXaero

Posted 10 May 2013 - 06:21 PM

There have been times ive found glGetUniformLocation being called too often during run time to be a problem, after building the shader get the uniform location and save it, look it up locally at run time and by pass calling glGetUniformLocation at run time, unless the shader changes dynamically the location shouldnt change.

 

Also, you may not always want to consider -1 locations as incorrect, -1 uniform locations can mean a few things. If the shader doesnt make use of a uniform, either it was optimized out or commented out but still declared, the shader may run fine even with a uniform having a -1 location, it doesnt always mean a the uniform had a typo or wasnt found.

 

my model has more faces than the maximum unsigned short supported

 

the index buffer indexes vertices, not faces, many faces may share the same vertex, reducing the vertex count, the whole purpose of index buffers. So if the numbers from your first post are correct the vertex count easily fits in unsigned short.

 

 

In general dont call the "glGet*()" series of commands as they stall rendering to retrieve the state being asked for.

So assert(isInUse()); calls glGetInteger() which is probably the problem, comment all those out.


#2NumberXaero

Posted 10 May 2013 - 06:19 PM

There have been times ive found glGetUniformLocation being called too often during run time to be a problem, after building the shader get the uniform location and save it, look it up locally at run time and by pass calling glGetUniformLocation at run time, unless the shader changes dynamically the location shouldnt change.

 

Also, you may not always want to consider -1 locations as incorrect, -1 uniform locations can mean a few things. If the shader doesnt make use of a uniform, either it was optimized out or commented out but still declared, the shader may run fine even with a uniform having a -1 location, it doesnt always mean a the uniform had a typo or wasnt found.

 

my model has more faces than the maximum unsigned short supported

 

the index buffer indexes vertices, not faces, many faces may share the same vertex, reducing the vertex count, the whole purpose of index buffers. So if the numbers from your first post are correct the vertex count easily fits in unsigned short.

 

 

In general dont call the "glGet*()" series of commands as they stall rendering to retrieve the state being asked for.


#1NumberXaero

Posted 10 May 2013 - 06:18 PM

There have been times ive found glGetUniformLocation being called too often during run time to be a problem, after building the shader get the uniform location and save it, look it up locally at run time and by pass calling glGetUniformLocation at run time, unless the shader changes dynamically the location shouldnt change.

 

Also, you may not always want to consider -1 locations as incorrect, -1 uniform locations can mean a few things. If the shader doesnt make use of a uniform, either it was optimized out or commented out but still declared, the shader may run fine even with a uniform having a -1 location, it doesnt always mean a the uniform had a typo or wasnt found.

 

my model has more faces than the maximum unsigned short supported

 

the index buffer indexes vertices, not faces, many faces may share the same vertex, reducing the vertex count, the whole purpose of index buffers. So if the numbers from your first post are correct the vertex count easily fits in unsigned short.


PARTNERS