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 10 of 11

Thread: Latest OpenGL AMD/NV driver bugs (with repro code)

Hybrid View

  1. #1
    Junior Member Newbie Closed's Avatar
    Join Date
    Sep 2011
    Location
    Moscow
    Posts
    8

    Angry Latest OpenGL AMD/NV driver bugs (with repro code)

    1. gl(Tex/Texture)Storage doesn't work with any depth-format on AMD:

    void Bug_AMD_TexStorage_Depth()
    {
    GLuint tex;
    glGenTextures(1, &tex);
    glTextureStorage2DEXT(tex, GL_TEXTURE_2D, 1, GL_DEPTH_COMPONENT24, 64, 64);

    // BUG: err = GL_INVALID_OPERATION
    GLenum err = glGetError();
    }

    2. gl(Tex/Texture)Storage doesn't work with cubemaps on AMD:

    void Bug_AMD_TexStorage_CubeMap()
    {
    GLuint tex;
    glGenTextures(1, &tex);
    glTextureStorage2DEXT(tex, GL_TEXTURE_CUBE_MAP, 1, GL_RGBA8, 64, 64);

    // BUG: err = GL_INVALID_ENUM
    GLenum err = glGetError();
    }

    3. gl(Tex/Texture)Storage will not work if PBO is active on AMD:

    void Bug_AMD_TexStorage_PBO()
    {
    GLuint buffer;
    glGenBuffers(1, &buffer);
    glNamedBufferDataEXT(buffer, 1024, NULL, GL_STATIC_DRAW);

    // NOTE: bug is here
    // WORKAROUND: before TexStorage always do glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)
    glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buffer);

    GLuint tex;
    glGenTextures(1, &tex);
    glTextureStorage2DEXT(tex, GL_TEXTURE_2D, 1, GL_RGBA8, 64, 64);

    // BUG: err = GL_INVALID_OPERATION
    GLenum err = glGetError();
    }

    4. Calling glGenQueries between glBeginQuery/glEndQuery on AMD, leads to invalid operation:

    void Bug_AMD_Query()
    {
    GLuint query1;
    glGenQueries(1, &query1);

    glBeginQuery(GL_SAMPLES_PASSED, query1);

    GLuint query2;
    glGenQueries(1, &query2);

    // BUG: err = GL_INVALID_OPERATION
    GLenum err = glGetError();

    glEndQuery(GL_SAMPLES_PASSED);
    }

    5. textureGather<Offset>(samplerRECT...) is not work on NV:

    any shader with this code will be compiled with this output:

    target not supported by the TXG instruction
    -- internal assembly text --
    // very long assemply here...

    P.S. to be continued...
    Last edited by Closed; 07-18-2012 at 08:18 AM.

  2. #2
    Member Regular Contributor malexander's Avatar
    Join Date
    Aug 2009
    Location
    Ontario
    Posts
    315
    4. Calling glGenQueries between glBeginQuery/glEndQuery on AMD, leads to invalid operation:
    I ran into this a while back, and it turns out this is the correct behaviour as stated by the extension (GL_ARB_occlusion_query, section 4.1.6A):

    Calling either GenQueriesARB or DeleteQueriesARB while any query of any target is active causes an INVALID_OPERATION error to be generated.
    However, this language isn't in the OpenGL 3.3 specification, so it looks like it should be valid. It's likely this feature was never updated to core in the AMD driver.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    The official API reference for glGenQueries doesn't reflect that as well.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    Quote Originally Posted by malexander View Post
    I ran into this a while back, and it turns out this is the correct behaviour as stated by the extension (GL_ARB_occlusion_query, section 4.1.6A).
    However, this language isn't in the OpenGL 3.3 specification, so it looks like it should be valid. It's likely this feature was never updated to core in the AMD driver.
    I would rather say it's a specification bug. I don't think it would be a good idea to allow GenQueries/DeleteQueries between BeginQuery/EndQuery, especially delete.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    Quote Originally Posted by aqnuep
    I would rather say it's a specification bug. I don't think it would be a good idea to allow GenQueries/DeleteQueries between BeginQuery/EndQuery, especially delete.
    IMHO, I don't think that glGenQueries inside a glBeginQuery/glEndQuery would be a problem because getting names for yet unused query and untyped query objects shouldn't have any side-effects other than reducing the set of available IDs. What really looks like a bug though is that glDeleteQueries() also isn't restricted from use while a query is active, at least according to the API reference. So you could simply try to delete an object which is currently active for a specific target.

  6. #6
    Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    268
    Actually GL spec is pretty explicit that glDeleteQueries does work even if deleted query is active

    If an active
    query object is deleted its name immediately becomes unused, but the underlying
    object is not deleted until it is no longer active
    As there is nowhere any mention that glGenQuery is forbidden when there is an active query, the only possible outcome is that it has to work, ie ATI has a bug.

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    Quote Originally Posted by kyle_
    Actually GL spec is pretty explicit that glDeleteQueries does work even if deleted query is active
    Ok, faulty API reference again. There's no mention of this IMHO vital piece of information.

  8. #8
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    Quote Originally Posted by kyle_ View Post
    As there is nowhere any mention that glGenQuery is forbidden when there is an active query, the only possible outcome is that it has to work, ie ATI has a bug.
    Actually, to be pendanic, probably the appropriate behavior should be the following: glGenQueriesARB and glDeleteQueriesARB should generate an error between glBeginQuery[ARB] and glEndQuery[ARB] (as those should respect the GL_ARB_occlusion_query spec, not the core spec). It doesn't matter, however, whether you use the ARB or core version of begin and end query as the active state is aliased between the two.

    The debate about glGenQueries and glDeleteQueries (the core functions) are more tricky as when these were originally introduced to the core spec they behaved like their ARB counterpart and only since version 3.0 they started to behave differently (at least according to the spec).

    So the thing is, I still would say that this is a specification bug as it makes 3.0 non-backwards compatible with 2.1 (even though it should be as no features were actually removed there). However, if we really have to insist on it, then it means that from 3.0 glGenQueries and glDeleteQueries should behave differently than glGenQueriesARB and glDeleteQueriesARB.

    This shouldn't be a problem in general, but think of the following case:
    1. Somebody implements an application on a GPU supporting OpenGL 3.3 (compatibility profile).
    2. The application is meant to be backwards compatible as it doesn't use any new features besides e.g. OpenGL 2.0.
    3. He/she puts a glGenQueries or glDeleteQueries call inside glBeginQuery and glEndQuery (this should work fine, according to the OpenGL 3.3 spec).
    4. Now somebody wants to execute the same application on a GPU supporting only OpenGL 2.1 (occlusion queries are in core there too so one might expect that it should work out-of-the-box, considering that compatibility profile should be fully backwards compatible).

    So unintentionally, the developer made the application non-backwards compatible with OpenGL 2.1 despite he/she used compatibility profile and didn't use any GL 3.x features.
    Last edited by aqnuep; 07-20-2012 at 04:06 PM.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

Tags for this Thread

Posting Permissions

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