Using imageStore() in vertex shader

Hi Everyone,

I read this article about Atomic Counters in OF and tried it using a vertex shader instead of compute shader, that works fine. Then I tried to use imageStore in my vertex shader instead of atomicCounterIncrement(). I allocated my ofBufferObject with a vectorglm::vec4 and can read it back after the shader runs but imageStore() doesn’t have any effect. Am I going about this all wrong? I have tried almost everything but haven’t had any luck. If anyone can shed some light on this I would be most grateful!

Here’s what I’m doing:

	counter.resize(20);
	counter[0].x = 3;
	ofBufferObject counterBuffer;
	
//I've tried almost every combination of these targets
	counterBuffer.allocate(counter, GL_DYNAMIC_READ);
	counterBuffer.bindBase(GL_UNIFORM_BUFFER, 0);
	counterBuffer.bind(GL_UNIFORM_BUFFER);
	
	bufftest.begin();
	box.OF_3dPrimitive.draw();
	glMemoryBarrier(GL_UNIFORM_BARRIER_BIT);
	bufftest.end();

	glm::vec4 result[20];
	glGetNamedBufferSubData(counterBuffer.getId(), 0, counterBuffer.size(), result);
	
	for (int i = 0; i < 8; ++i)
	{
		cout <<result[i].x << "," << result[i].y << "," << result[i].z << "    ";
	}
	cout << "\n";
	counterBuffer.unmap();

and here is the vertex shader:

#version 430 core
layout (binding = 0, rgba32f) writeonly uniform image1D counter;

void main(void)
{
imageStore(counter, gl_VertexID,  vec4(5));
}