XNA Creators Club Online
community forums
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Page faults

Last post 5/14/2007 12:00 PM by Clootie RU. 2 replies.
  • 5/14/2007 6:12 AM

    Page faults

    Hi!

    I get hundreds of valid page faults each time I do a lock on a index buffer. Example:

    m_pIndexBuffer->Lock( 0, 10, (void**)&pIndexArray, NULL );

    The really strange thing is that it doesn´t matter if i lock 0 bytes, it still produces Page faults. I´m using Windows XP SP2 with Directx 9.0c (4.09.0000.0904) and a ASUS EN7950GT that runs on NVIDIA driver version 93.71. I have tried several other computers with other graphic cards and I get the same result.

    If I do a lock on a vertex buffer there are no Page faults.

    Robert

  • 5/14/2007 8:09 AM In reply to

    Re: Page faults

    I have to do a CreateIndexBuffer each frame for the page faults to occurre. Ex:

    void DrawSomethingWithPageFaults()

    {

       m_pD3DDevice->CreateIndexBuffer( 100, D3DUSAGE_WRITEONLY, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &m_pIndexBuffer, NULL );

       m_pIndexBuffer->Lock( 0, 10,  (void**)&pIndexArray, NULL );

       m_pIndexBuffer->Unlock()

    }

     

    This example do not produce any page faults:

    void DrawSomething()

    {

       m_pD3DDevice->CreateVertexBuffer( 100 * sizeof(COLOR_TEXTURED_VERTEX), 0, RENDER_COLOR_TEXTURED_VERTEX, D3DPOOL_DEFAULT, &m_pVertexBuffer, NULL ) ;

       m_pVertexBuffer->Lock( 0, 10 * sizeof(COLOR_TEXTURED_VERTEX), (void**)&pVertices, NULL );

       m_pVertexBuffer->Unlock();

    }

  • 5/14/2007 12:00 PM In reply to

    Re: Page faults

    Are you sure this is influencing your system overall perfromance?

    Btw,

    1. It's recommended not to create buffers on the fly (except if you definitely need to do so). Better to allocate all your buffers at start of application (level load, etc).
    2. On pre-DX10 cards vertex and index buffers can be handled very differently in drivers. For example, some videocard do not have support for index buffers stored in videomemory.

     

Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG