the texture “TexID” is attatched to a FBO,and bind a texture name simultaneously,it is src & dst in a operation,so is it valid?whether it would cut down the performance of my program?
the texture “TexID” is attatched to a FBO,and bind a texture name simultaneously,it is src & dst in a operation,so is it valid?
Grammar note: spaces go after punctuation.
Yes it is valid, as long as you do not bind the same image to the FBO as you are using as texture. Remember: textures contain multiple images. A 2D texture can have several mipmaps, each of which is an image.
As long as you ensure that you don’t read and write from/to the same image, you’re fine. If you do, however, you’re in undefined-land.
No, my program read and write from/to a same image, my program replace a image’s color based on it’s alpha channel, the replace operation is done by a cg shader, the shader read the alpha value from image, and then write a color to the same image because the image is attached to a FBO simultaneously, so whether my program is in undefied-land?