retro_alt's picture

GL.UniformMatrix4 Doesn't work with an array or pointer on NVidia Card.

Project:The Open Toolkit library
Version:1.0.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (invalid)
Description
unsafe
{
	GL.UniformMatrix4(getUniformLocation(name), 16, false, (float*)ptr);
}

Have tested this code on two different machines with the exact same code. On the ATI machine it works just fine. On the NVidia machine, I get a GraphicsErrorException with the error being "InvalidOperation".

If I construct an OpenTK.Matrix4 from the array, and use that I works with no problems.

Thanks!
Greg


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Status:open» need info

You are trying to pass 16 matrices to the shader. Is that what you meant to do? Does your uniform declaration match this in the shader? (i.e. are you declaring a mat4[16] array?)

From the documentation:

  • GL_INVALID_OPERATION is generated if there is no current program object.
  • GL_INVALID_OPERATION is generated if the size of the uniform variable declared in the shader does not match the size indicated by the glUniform command.
  • GL_INVALID_OPERATION is generated if one of the integer variants of this function is used to load a uniform variable of type float, vec2, vec3, vec4, or an array of these, or if one of the floating-point variants of this function is used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
  • GL_INVALID_OPERATION is generated if location is an invalid uniform location for the current program object and location is not equal to -1.
  • GL_INVALID_OPERATION is generated if count is greater than 1 and the indicated uniform variable is not an array variable.
  • GL_INVALID_OPERATION is generated if a sampler is loaded using a command other than glUniform1i and glUniform1iv.
  • GL_INVALID_OPERATION is generated if glUniform is executed between the execution of glBegin and the corresponding execution of glEnd.
retro_alt's picture

#2

Status:need info» closed (invalid)

ooooooh. For some reason I thought it was the number of components, which I suppose in retrospect would be rather redundant.

Thanks!
Greg