4 Replies Latest reply on Nov 26, 2015 12:21 AM by pinform

    Opengl glTexImage3D memory issues

    bbalazs

      Hello,

       

      i have a strange issue with memory usage of glTexImage3D with JOGL on AMD cards.
      I check memory usage with GPU-Z, Process Explorer and AMD CodeXL.
      I load a 512x512x512 short texture.
      And the result :

      AMD CodeXL : 256 MB (here i can check extact value

      GPU-Z and Process Explore : ~400 MB (here i can only check the increasing memory usage)

       

      Code:

      ShortBuffer data = ShortBuffer.wrap(stack.getData(0));
                  gl.glBindTexture(GL2.GL_TEXTURE_3D, volumeTextureLevelIDs[0]);           

                  gl.glTexParameteri(GL2.GL_TEXTURE_3D, GL2.GL_TEXTURE_MAX_LEVEL, 0);
                  gl.glTexParameteri(GL2.GL_TEXTURE_3D, GL2.GL_TEXTURE_BASE_LEVEL, 0);

       

                  gl.glTexParameteri(GL2.GL_TEXTURE_3D, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);
                  gl.glTexParameteri(GL2.GL_TEXTURE_3D, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);
                  gl.glTexParameteri(GL2.GL_TEXTURE_3D, GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP_TO_EDGE);

       

                  gl.glTexParameteri(GL2.GL_TEXTURE_3D, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
                  gl.glTexParameteri(GL2.GL_TEXTURE_3D, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);

                  gl.glTexImage3D(GL2.GL_TEXTURE_3D, 0, GL2.GL_R16_SNORM, w, h, d, 0, GL2.GL_RED, GL2.GL_SHORT, data.rewind());


                  gl.glBindTexture(GL2.GL_TEXTURE_3D, 0);

      What is the real value of memory usage?