Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenGL ES 2.0/MonoTouch: Linker error
    text
    copied!<p>i currently trying to get my model loader to work and got a error when binding new shader attributes.</p> <p>At this point i would post the error message, but MonoTouch don't let me do this. The only thing i got is "WARNING: Could n", seems to be a issue with MonoTouch, because i used a template of the framework.</p> <p>Here is the shader code:</p> <pre><code>&lt;Shader&gt; &lt;Uniforms&gt; &lt;Uniform type="mat4" name="modelViewMatrix"/&gt; &lt;/Uniforms&gt; &lt;Vertex&gt; &lt;Attributes&gt; &lt;Attribute type="vec3" name="position" binding="Position"/&gt; &lt;Attribute type="vec3" name="normal" binding="Normals"/&gt; &lt;!--&lt;Attribute type="vec4" name="color" binding="Color"/&gt;--&gt; &lt;/Attributes&gt; &lt;Code&gt;&lt;![CDATA[ attribute vec3 position; attribute vec3 normal; varying vec4 colorVarying; uniform mat4 modelViewMatrix; void main() { gl_Position = modelViewMatrix * vec4(position.xyz, 1.0); float z = gl_Position.z / 100.0; colorVarying = vec4(z, z, z, 1.0) ; } ]]&gt;&lt;/Code&gt; &lt;/Vertex&gt; &lt;Pixel&gt; &lt;Code&gt;&lt;![CDATA[ varying lowp vec4 colorVarying; void main() { gl_FragColor = colorVarying; } ]]&gt;&lt;/Code&gt; &lt;/Pixel&gt; &lt;/Shader&gt; </code></pre> <p>The shader works perfectly when removing the "normal" attribute. When adding it i got the following error from mono ( Not from OpenGL ) after calling GL.LinkProgram:</p> <pre><code>App(553,0xacb752c0) malloc: *** error for object 0x1025a3c4: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug </code></pre> <p>I noticed that it has something to do with the attribute binding. Here is the code:</p> <pre><code>// Bind attribute locations for (int i = 0; i &lt; _VertexAttributeList.Length; i++) { ShaderAttribute attribute = _VertexAttributeList[i]; GL.BindAttribLocation(_Program, i, attribute.Name); } </code></pre> <p>When i replace "_VertexAttributeList.Length" with the constant 1 it works without any errors.</p> <p>Cheers Felix</p>
 

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