Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: "Invalid Operation" on glTexStorage2D Error 1282

  1. #1
    Newbie Newbie
    Join Date
    Aug 2018
    Posts
    1

    "Invalid Operation" on glTexStorage2D Error 1282

    Hi I am trying to render a couple of images on to my HTC Vive device using OpenGl.

    I keep getting an error as follows:

    err= 1282, description = 'invalid operation',baseOperation = glTexStorage2D, cArguments= (GL_TEXTURE_2D, 1, GL_RGBA8, 1827L, 2030L,)

    And a snippet of my code where the error occurs-

    Code :
        image_right = cv2.imread('./sample.png')
        image_left = cv2.imread('./sample_left.jpg')
     
        height, width, channels = image_left.shape
     
        cv2.cvtColor(image_left,cv2.COLOR_BGR2RGB)
        cv2.cvtColor(image_right,cv2.COLOR_BGR2RGB)
     
        w, h = self.vr_system.getRecommendedRenderTargetSize()
     
        glBindTexture(GL_TEXTURE_2D, self.zedTextureID_L);
        glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, w, h);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, image_left)
     
     
        glBindTexture(GL_TEXTURE_2D, self.zedTextureID_R);
        glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, w, h);
        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, image_right)
     
     
        self.texture_t_left.handle = self.zedTextureID_L
        self.texture_t_right.handle = self.zedTextureID_R

    Any ideas of what is going wrong? I'd be most grateful for any help. I can send the rest of my code too but it's quite large....
    I've seen some people with the same error however it's mostly because the levels was set to 0 for the glTexStorage2D function.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,887
    Have you checked that self.zedTextureID_L and self.zedTextureID_R are non-zero?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •