Note that there are some explanatory texts on larger screens.

plurals
  1. POFunction not being called in release mode?
    primarykey
    data
    text
    <p>I'm having trouble with a function is not being called when compiled in release mode, it works fine in debug mode and release mode when <strong>no optimization</strong> are applied. Anyone knows why it does that? I'm using Visual C++ Express 2010.</p> <pre><code>void CShader::SetUniforms(const GLuint NumUniforms, const LPUNIFORM Uniforms) { if(!m_HasUniforms || !Uniforms) return; for(GLuint i = 0; i &lt; NumUniforms; i++) { SetUniformData(i, Uniforms[i].Size, Uniforms[i].NumValues, Uniforms[i].Value); } } </code></pre> <p>As you can see it should call SetUniformData(...) NumUniforms times, however in release mode it just doesn't call it :s. I can't even put a breakpoint inside SetUniformData, it just tells me there's no executable code.<br/><br/>SetUniformData() function looks like this:</p> <pre><code>void CShader::SetUniformData(const GLuint UniformIndex, const GLuint Size, const UINT NumValues, const GLvoid* Data) { switch(Size) { case sizeof(float): glUniform1fv(m_UniformLocations[UniformIndex], NumValues, (GLfloat*)Data); break; case sizeof(Vector2f): glUniform2fv(m_UniformLocations[UniformIndex], NumValues, (GLfloat*)Data); break; case sizeof(Vector3f): glUniform3fv(m_UniformLocations[UniformIndex], NumValues, (GLfloat*)Data); break; case sizeof(Vector4f): glUniform4fv(m_UniformLocations[UniformIndex], NumValues, (GLfloat*)Data); break; case sizeof(Matrix33f): glUniformMatrix3fv(m_UniformLocations[UniformIndex], NumValues, GL_FALSE, (GLfloat*)Data); break; case sizeof(Matrix44f): glUniformMatrix4fv(m_UniformLocations[UniformIndex], NumValues, GL_FALSE, (GLfloat*)Data); break; default: break; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload