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 9 of 9

Thread: [NV310.33] clear textures

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Germany
    Posts
    13

    [NV310.33] clear textures

    Hey guys,

    sorry about posting potential bugs in this forum, but the nvidia developer forums still seem to have problems.
    The following code worked with prev. drivers, but I get an error now ("GL_INVALID_OPERATION error generated. Texture 0 is base level inconsistent. Check texture size." - card: nv560ti):
    Code :
    GLuint texid;
    GLuint fbid;
    float color[] = {0,0,0,0};
     
    glGenTextures(1, &texid);
    glTextureStorage2DEXT(texid, GL_TEXTURE_2D, 1, GL_RGBA16F, 128, 128);
    glGenFramebuffers(1, &fbid);
    glFramebufferDrawBufferEXT(fbid, GL_COLOR_ATTACHMENT0);
    glNamedFramebufferTextureEXT(fbid, GL_COLOR_ATTACHMENT0, texid, 0);
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbid);
    glClearBufferfv(GL_COLOR, 0, &color[0]);
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
    Am I missing something or is it a bug?

    Thanks for feedback,
    Ambator

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    If Texture 0 is referring to the name 0 it's no wonder you get an error since the default object is not allowed. What's the value of texid after glGenTextures()?

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Germany
    Posts
    13
    ok, I guessed this, but it kind of seemed unreal.
    A quick update: texid has a proper id different from 0, i.e., the texture was created.
    It's also not because of DSA, without, I get the same error.
    However, using the old glClearColor works. -> For some reason, the clearbuffer doesn't notice that there is a texture at drawbuffer 0.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    The thing is, glClearBuffer doesn't generate an INVALID_OPERATION. I'd check the inputs to the texture commands and compare them to the allowed values according to the extension.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Germany
    Posts
    13
    well, the really odd things are:
    - the same code worked before with a couple of drivers
    - I cannot imaging any simpler gl code fragment
    - adding some rendering before (without glclearbuffer) works as it did with the other drivers

    I am using ARB_debug_output to catch the errors, I therefore guess, I am not missing any error before this one.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    Well, if your code is by all means correct I suppose it might be a driver bug. If you can, test it on different hardware and see if it works on Intel and/or AMD hardware (if the ext. is supported by AMD). This should give you enough info.

  7. #7
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Germany
    Posts
    13
    Well, I am not claiming to have bug-free code. However, I posted the super short and simple example and was hoping that someone gives me a hint, if I am missing something.
    I do not have other hardware at hand and I was hoping to get feedback from the nvidia guys, like "nope, works for us" or "indeed, there is something wrong".

  8. #8
    Intern Contributor
    Join Date
    Mar 2010
    Posts
    58
    You can ignore the "GL_INVALID_OPERATION error generated" part of the debug output message. This is a bug in the driver and this message was given the wrong debug type and debug category by mistake. In this case there was no glError generated and, despite the scary debug message, your app will continue to function fine. We'll try to get the debug message fixed soon.

  9. #9
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Germany
    Posts
    13
    oh, ok, thanks.
    I also get an GL_INVALID_VALUE (+ base level inconsistent...) when rendering.
    However, I also have other, more *random* hangs, that I could not yet track down, which is why I thought that this error message has more impact.

Posting Permissions

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