Texture unit for both glBindImageTexture and glBindTexture


I’m having a problem understanding an issue. I have a single texture that is used in a compute shader and a fragment shader. I bind for the sampler2D with glBindTexture and bind for image2D with glBindImageTexture. Can I bind both to the same texture unit or should each be bound to a unique texture unit?


Images use image units, not texture units. They’re a different “namespace” of binding points, so even if they happen to use the same number, they aren’t referring to the same thing.