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

Thread: Problem with NV 3xx.xx drivers and TF

  1. #1
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    895

    Problem with NV 3xx.xx drivers and TF

    Hi All,

    I have an interesting anomaly on NV 3xx.xx drivers. Namely, transform feedback that works correctly on NV 2xx.xx drivers breaks application on Win7 with newest drivers (currently 314.07).
    Probably there is an error somewhere in my code, but I cannot realize what could cause the problem.
    Here's the code:
    Code :
    void GLRenderer::DebugTF(int bufSize, int i, bool bFullBuf)
    {
        unsigned int size = 4 * sizeof(float) * bufSize;
        unsigned int m_TFvboID;
        glGenBuffers(1, &m_TFvboID);
        glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, m_TFvboID);
        glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, size, NULL, GL_DYNAMIC_COPY);
        int index = 0;
        glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, index, m_TFvboID);
        glEnable(GL_RASTERIZER_DISCARD);
        glBeginTransformFeedback(GL_POINTS);
     
        int first = 0, count = bufSize;
        glDrawArrays(GL_POINTS, first, count); 
     
        glEndTransformFeedback();
        glDisable(GL_RASTERIZER_DISCARD);
        glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, m_TFvboID);
     
         float* ptr = (float*)glMapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, GL_READ_ONLY); //<- malicious line
    ...

    glMapBuffer() call cause the problem. Obviously the problem is in the invalid pointers, since the code reports meaningless errors like "fragment shader loading error", and that's my message in the code executed far before DebugTF().

    Any idea what might be the cause of the problem? Again, it works on another computer with NV 27x.xx driver.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,845
    Quote Originally Posted by Aleksandar View Post
    glMapBuffer() call cause the problem.
    I wonder if it might be the whole arrayed vs. non-arrayed bind point thing I recently brought up in another thread.

    Try doing an end-run around the whole bind point issue and use DSA:

    Code cpp:
    void *ptr = glMapNamedBufferRangeEXT( handle, offset, size, access );
    ...
    glUnmapNamedBufferEXT( handle );
    Last edited by Dark Photon; 02-28-2013 at 06:16 PM.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Mar 2009
    Posts
    141
    I would try sending some dummy data to glBufferData instead of passing NULL. NVIDIA has similar problem with textures and ARB_shader_image_load_store. When I initialy pass NULL to glTexImage2D texture does not work correctly as an image. But when I send dummy data to glTexImage2D (instead of just passing NULL) everything works correctly.

    In your case I would try this:

    Code :
    std::vector<GLubyte> data(size);
    glGenBuffers(1, &m_TFvboID);
    glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, m_TFvboID);
    glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, size, &data[0], GL_DYNAMIC_COPY);
    Last edited by randall; 03-01-2013 at 03:24 AM.

  4. #4
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    895
    Thank you for the suggestions guys, but the problem was in totally different place.
    I have completely forgotten on that. When debug_output catches some error I'm opening AfxMessageBox().
    Well... that makes a problem with new NV drivers. I had a confirmation form NV guys a long time ago, but I have forgotten.

    The message is:
    Buffer performance warning: Buffer object 16 (bound to GL_TRANSFORM_FEEDBACK_BUFFER_NV (0), and GL_TRANSFORM_FEEDBACK_BUFFER_NV, usage hint is GL_DYNAMIC_COPY) is being copied/moved from VIDEO memory to DMA CACHED memory.
    After all, this can be a warning for the community not to use AfxMessageBox().

    Sorry for bothering you, and thank you for the help!
    Last edited by Aleksandar; 03-01-2013 at 08:51 AM.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    590
    When debug_output catches some error I'm opening AfxMessageBox().
    Is this a problem with ::MessageBoxA as well?

    I just started seeing
    Buffer performance warning: ...
    message about video buffer being copied to main memory.

Posting Permissions

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