Memory barrier issue

Im having trouble with memory barrier. GLSL texture() function always samples 0 index of my 1D texture.

Here is geometry shader code

#version 430
...................
layout(rgba32f, binding = 0) uniform image1D Texture;
void main() {
    imageStore(Texture, 0, vec4(0.0, 0.0, 0.0, 0.0));
    imageStore(Texture, 5, vec4(255.0, 0.0, 0.0, 0.0));
}

Here is rendering pipeline

model.DrawOnTexture(); // stores pixels in image1D
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT);
model.Draw(); // samples 1D texture in which i wrote previously

But this still doesnt work. model.Draw() function always samples 0 index of my texture, while i provide the 5th. What should i do?

Your post is a bit confusing probably due to language issues. “Samples 0 index” and “provide the 5th” don’t sufficiently explain what you’re getting back, and how.

Please post the shader code you’re using after the barrier to sample the texture. Include the sampler decl, the texturing function, and the texture coordinate (hard-coded in the shader code) that you’re using to sample the texture, as well as the what you’re using to determine what value you obtained.

Thank you for reply. I found problem - it was just a simple incorrectness in my texture coordinates. I was passing integer instead of float.
Now everything works fine.