Posted by
Sven Gothel on
URL: https://forum.jogamp.org/glUniformMatrix4dv-doesn-t-work-tp4026160p4026163.html
On 09/14/2012 12:49 AM, clevengr [via jogamp] wrote:
> Hi all,
> I used glUniformMatrix4dv() to set the values in a uniform mat4 in my vertex
> shader. It kept generating "GL_INVALID_OPERATION". I finally thought to try
> converting the double[] containing the 16 matrix values (which did contain the
> values I wanted) to a float[], and calling glUniformMatrix4fv() instead. It
> immediately started working correctly.
> Is this a bug in JOGL, a bug in my driver (I did try it on two machines with
> substantially different cards, though both were nVidia), or something I'm
> overlooking in the spec somewhere?
GL3 should provide this method, so I assume you properly setup a context
w/ >= GLProfile.GL3 or >= GLProfile.GL3bc - and not just casting :)
Then, all double precision (64bit floats)
are only supported by the extension 'GL_ARB_gpu_shader_fp64' (depends on GL 3.2).
<
http://www.opengl.org/registry/specs/ARB/gpu_shader_fp64.txt>
Hence your code using >= GL3 shall contain:
if( gl.isExtensionAvailable("GL_ARB_gpu_shader_fp64") ) {
// use fp64 -> double
} else {
// use fp32 -> float
}
Given the above yes - sure it should work.
Pls provide a unit test if it fails.
~Sven
>
> Thanks.