0 Replies Latest reply on Jan 22, 2016 3:20 PM by dutta

    Resize texture bound to image breaks it?

    dutta

      Hi!

       

      I have a somewhat strange problem. My scenario is this, each frame I render 4 passes using a compute shader where for each pass I attach different textures. This works just fine as long as the textures stay the same size. If I resize any of the textures using glTexImage2D at any point after they have been bound to the compute shader using glBindImageTexture, the textures seem to become incomplete, that is, any subsequent calls to glDispatchCompute produce no result.

       

      I've tried to unbind all of the textures being used by the compute shaders prior to resizing, and also using glFlush to ensure that any operation working on said textures is complete, but to no avail. I have also noticed how this problem seems to be present on both nvidia and AMD GPUs, so I'm assuming there is something I am doing wrong with using the API.

       

      Any help is appreciated!

       

      Edit: Just tried it on an nvidia machine, and it works fine. However I do remember this issue being present on nvidia cards in the past.

       

      Edit: Performing a glDeleteTexture and glGenTextures, and then resize it works properly, however this is only required on ATI cards. So the scenario is this:
      1. Bind texture to compute shader.

      2. Perform an image store on it.

      3. Run glTexImage2D on texture used for image store/load to resize it.

      4. Texture becomes incomplete. Any reads or writes, or even glGetTexImage() only returns 0.

      5. glDeleteTextures and glGenTextures and then doing glTexImage2D works.

       

      Is this the expected behaviour?