Attribute not being updated in shader

I’m using a ShaderMaterial with vertex and fragment shaders which require an attribute inTexCoord. However in the vertex shader inTexCoord isn’t being updated.

This is the code I’m using to create the attribute:

    this.texCoord = new Float32Array([0, 0]);

    this.geometry.setAttribute('inTexCoord', new THREE.BufferAttribute(this.texCoord, 2));

And this is how I’m updating the attribute in my animate function:

      this.texCoord[0] = 500;
      this.texCoord[1] = 500;
      const texCoord = this.geometry.getAttribute('inTexCoord');
      texCoord.needsUpdate = true;

Does anyone know what could be the issue?

Hi!
Just out or curiousity, how do you process this attribute in shaders?

I got it working with uniforms.