title: shader storage buffer sends in data wrong
body: <p>I have a shader storage buffer which sends one struct with one vec3 to the shader. I send it like this:</p>
  
  <pre><code>GLint bufMask = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT;
  lightData * ld = (lightData *) glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, sizeof(lightData), bufMask);
  ld[0].ambient = glm::vec3(1.f, 0.5f, 1.f);
  glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
  glBindBufferBase( GL_SHADER_STORAGE_BUFFER, 0, m_lightData );
  </code></pre>
  
  <p>Right now, it's just for testing, so don't wonder why it only has a size of one.</p>
  
  <p>Anyway, in the shader, when I draw vec4(lights[0].ambient.x); I get black, when I draw .y I get white and when I draw .z I get grey. So it seems the elements are off by one. Why is that?</p>
  
  <p>EDIT: </p>
  
  <p>struct:</p>
  
  <pre><code>struct lightData {
      glm::vec3 ambient;
  };
  </code></pre>
  
  <p>buffer generation:</p>
  
  <pre><code>glGenBuffers(1, &amp;m_lightData);
  glBindBuffer(GL_SHADER_STORAGE_BUFFER, m_lightData);
  glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(lightData), NULL, GL_STATIC_DRAW);
  </code></pre>
  
  <p>buffer using: see above</p>
  
  <p>shader:</p>
  
  <pre><code>#version 430 core
  layout(location = 0) out vec4 result;
  struct lightData {
      vec3 ambient;
  };
  layout(std430, binding = 0) buffer BufferObject {
      lightData lights[];
  };
  void main() {
      result = vec4(lights[0].ambient, 1.f);
  }
  </code></pre>
  
  <p>EDIT2: I tried it with a float and that worked. I went back to a vector and now it works! I have no idea what was wrong before. Sorry! Can be closed.</p>