Compute shader with texture input

Hi there, I’m having trouble with a compute shader (for particles) where I want to use a texture as input. I’ve tried binding a regular texture and using uniform sampler2D uTex and reading with texture(uTex, uv). I also tried declaring the uniform using layout(binding = 1, rgba8) uniform readonly image2D uTex and reading data using imageLoad(uTex, ivec2(imageSize(uTex) * uv)) (my uv is from 0 to 1), with no luck, I’m always getting black pixels. (note that for the second case, I had to add a GL_IMAGE_2D case to checkUniformType(), as mentioned in this thread, so that the uniform setting call doesn’t fail when I pass it texture unit 1. (I’m also activating the appropriate texture unit and binding my texture before running the compute shader)

Has anybody got something similar working (image input to a compute shader in Cinder)?

Never mind, it was user error. I was setting the texture incorrectly, after all. It does work with sampler2D and calling texture() just fine from the compute shader…phew!