Bindless vertex array

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Bindless vertex array

elect
gouessej wrote
Try to dispose the GLWindow before stopping the animator. I know that the animators are useful but I rarely use them. I'm not sure that the messages are really problematic.
After you closed my bug I returned profiling it.

I tried to comment some parts of the code and I found out something very interesting.

Right now the rendering loop doesnt do anything else than clearing color/depth, transform matrices and minor other stuff.

I get 5k fps and this is fine.

Now I comment out the code in the Mesh.update() that takes care of VBUM, making the vertex and index buffer resident on the gpu and then I get 450 fps...

Something is definitely wrong with these calls:

        // *** INTERESTING ***
        // get the GPU pointer for the vertex buffer and make the vertex buffer
        // resident on the GPU
        gl4.glBindBuffer(GL4.GL_ARRAY_BUFFER, vertexBuffer[0]);
        gl4.glGetBufferParameterui64vNV(GL4.GL_ARRAY_BUFFER, GL4.GL_BUFFER_GPU_ADDRESS_NV,
                vertexBufferGPUPtr, 0);
        gl4.glGetBufferParameteriv(GL4.GL_ARRAY_BUFFER, GL4.GL_BUFFER_SIZE,
                vertexBufferSize, 0);
        gl4.glMakeBufferResidentNV(GL4.GL_ARRAY_BUFFER, GL4.GL_READ_ONLY);
        gl4.glBindBuffer(GL4.GL_ARRAY_BUFFER, 0);

        // *** INTERESTING ***
        // get the GPU pointer for the index buffer and make the index buffer
        // resident on the GPU
        gl4.glBindBuffer(GL4.GL_ELEMENT_ARRAY_BUFFER, indexBuffer[0]);
        gl4.glGetBufferParameterui64vNV(GL4.GL_ELEMENT_ARRAY_BUFFER,
                GL4.GL_BUFFER_GPU_ADDRESS_NV, indexBufferGPUPtr, 0);
        gl4.glGetBufferParameteriv(GL4.GL_ELEMENT_ARRAY_BUFFER, GL4.GL_BUFFER_SIZE,
                indexBufferSize, 0);
        gl4.glMakeBufferResidentNV(GL4.GL_ELEMENT_ARRAY_BUFFER, GL4.GL_READ_ONLY);
        gl4.glBindBuffer(GL4.GL_ELEMENT_ARRAY_BUFFER, 0);
Reply | Threaded
Open this post in threaded view
|

Re: Bindless vertex array

gouessej
Administrator
Do you mean that it gets slower when you make those buffers resident on the GPU?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Bindless vertex array

elect
gouessej wrote
Do you mean that it gets slower when you make those buffers resident on the GPU?
Yes, just declaring them as resident makes the rendering slow
Reply | Threaded
Open this post in threaded view
|

Re: Bindless vertex array

gouessej
Administrator
I assume that you don't get the same behavior when you use OpenGL in plain C, do you? I don't get what could possibly cause that in JOGL.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Bindless vertex array

elect
gouessej wrote
I assume that you don't get the same behavior when you use OpenGL in plain C, do you? I don't get what could possibly cause that in JOGL.
Exactly
12