PVRFRAME: glCopyTexImage2D issue

This topic contains 5 replies, has 3 voices, and was last updated by  joepix 6 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #30516

    joepix
    Member

    Hello,

    I cant make glCopyTexImage2D working under pvrframe (build 2.08.28.0607, windows 7 x64, catalyst 11.4), I’m trying to copy pixels from a FBO and it always fails and returns error 501, the log is:
    “In glCopyTexImage2D error: 501 (GL_INVALID_VALUE) : (null)”
    I dont think the problem comes from my code as it is working with some other GLES wrappers:

      /* create buffer texture */
      glBindTexture( GL_TEXTURE_2D, tbuffer);
      glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
      glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
      glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
      glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
      glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
      glBindTexture( GL_TEXTURE_2D, 0);

      /* assign texture to fbo */
      glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
                              GL_TEXTURE_2D, tbuffer, 0);

    /* …rendering code.. */

      /* copy result to another texture */
      glBindTexture( GL_TEXTURE_2D, texture);
      glCopyTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA, 0, 0, w, h, 0);
    -> error 501

    Thanks in advance,
    joe

    #34879

    Aaron
    Member

    Could you explain why you are copying the texture?

    Thanks,

    Aaron.

    #34880

    joepix
    Member

    I’m copying the texture because it’s not possible to directly render to a GL_ALPHA texture using fbo (according to GL ES 2 specifications). I could use a RGBA texture, but I try to limit texture memory consumption.

    #34881

    Aaron
    Member

    Ah, the old speed vs size trade-off. I’d suggest at least making the copy step a build option so you can test both (on a real device, PVRVFrame performance doesn’t reflect device performance), in case find you see a performance boost significant enough to outweigh the memory saving.

    The PVRVFrame error you reported will be investigated.

    #34882

    jacekc
    Member

    Is it possible that you send us (devtech@imgtec.com) narrowed example/complete code demonstraiting  that problem?

    Thanks

    #34883

    joepix
    Member

    The code is actually part of a large project, I will try to reproduce the problem with a simple code that I could send you, just need to find some time.

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.