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

Thread: Intel HD graphics mutlisampling problem (bug?)

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    14

    Intel HD graphics mutlisampling problem (bug?)

    I think I've found a bug with the Intel HD graphics driver but want to confirm with this community. The problem happens with an Intel HD P4000 video adapter with their latest driver. When I enable multisample above 1x, any drawing to the frame buffer causes the entire frame buffer to clear itself to RGBA color (0,0,0,0). Here's the Windows code that demonstrates the problem:

    Code :
      int numMultiSamples = 4;
      const int attributes[] =
      {
        WGL_SUPPORT_OPENGL_ARB, GL_TRUE,       // need OpenGL supported
        WGL_DRAW_TO_PBUFFER_ARB, GL_TRUE,      // enable render to pbuffer
        WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, // need RGBA colors
        WGL_COLOR_BITS_ARB, 24,                // at least 24 bits for color
        WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,       // enable FSAA
        WGL_SAMPLES_ARB, numMultiSamples,
        NULL                                   // end with a NULL terminator
      };
      int pixelFormat = 0;
      UINT numFormats = 0;
      HWND hWnd = ::GetDesktopWindow();
      HDC hDC = ::GetDC (hWnd);
      wglChoosePixelFormat (hDC, attributes, NULL, 1, &pixelFormat, &numFormats);
     
      HPBUFFERARB hBitmapPbuffer = wglCreatePbuffer (hDC, pixelFormat, 100, 100, NULL);
      HDC hBitmapPbufferDC = wglGetPbufferDC (hBitmapPbuffer);
      HGLRC hBitmapRC = ::wglCreateContext (hBitmapPbufferDC);
      VERIFY(wglMakeCurrent (hBitmapPbufferDC, hBitmapRC) != FALSE);
     
      glDrawBuffer (GL_FRONT);
      glClearColor(1.0f,1.0f,1.0f,1.0f);
      glClear(GL_COLOR_BUFFER_BIT);
      glDisable(GL_DEPTH_TEST);
     
      glReadBuffer(GL_FRONT);
      RGBQUAD rgbQuad;
      glReadPixels (0, 0, 1, 1, GL_BGRA_EXT, GL_UNSIGNED_BYTE, (GLvoid *) &rgbQuad);
      ASSERT(rgbQuad.rgbRed == 255);
     
      glBegin (GL_POINTS);
      glVertex3i (10,20,30);
      glEnd();
     
      glReadPixels (0, 0, 1, 1, GL_BGRA_EXT, GL_UNSIGNED_BYTE, (GLvoid *) &rgbQuad);
      ASSERT(rgbQuad.rgbRed == 255);

    The ASSERTs in the code just verify that the background red color is still 1. The first ASSERT passes but the second one fails. Note that between the two ASSERTs, there are only a few OpenGL function calls to draw a single pixel. In fact, not only is the pixel at x=0,y=0 cleared to RGBA color (0,0,0,0), but the entire color buffer is cleared.

    I've found two workarounds to this bug (either of these will fix the problem):

    1) If I set numMultiSamples to 1, then the problem goes away.
    2) If I set the clear color to something other than (1,1,1,1), then the problem goes away. For example, glClearColor(1,0.9999f,1,1).

    I've tried this same code on an Nvidia card and there is no problem. Can any of you please tell me if I'm doing something wrong of if this is indeed a bug in Intel's driver code?

  2. #2
    Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    253
    All the intel card I've tried dont support any kind of multisampling.

  3. #3
    Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    268
    Is there any reason you use pbuffers instead of FBOs?

  4. #4
    Junior Member Regular Contributor
    Join Date
    Mar 2009
    Posts
    153
    What he did is window-less OpenGL on Windows. Very nice.

  5. #5
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    14
    I'm using a pbuffer instead of a FBO because I'm creating an off-screen bitmap that will be saved to a file.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Mar 2009
    Posts
    153
    And you don't want to create a window, right?

  7. #7
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    14
    Correct, I don't want to create a window.

Posting Permissions

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