Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 18

Thread: Primitive restart extended functionality

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Junior Member Regular Contributor
    Join Date
    Dec 2010
    Oakville, ON, CA
    Simply change the index type state of an IBO right inbetween the calls of glDrawIndices. I am sure all of the model primitives will share the same type of indices, and even different models will have the same index type in most cases, so the reconfiguration of IBO' index type state will not be frequent. Besides, the same mess was happening with the primitive restart index until the fixed restart index value feature was introduced recently - the PRI had to be respecified according to the index type as it was always intentional to use the maximum possible value, but it required a function call separate from drawing call.
    But yeah, the "GLint indexFirst" argument is better to be changed to something able to specify an offset which may not be aligned to the index type:
    Code :
    glDrawIndices(GLsizei indexCount, const GLvoid* indices)
    glDrawIndicesInstanced(GLsizei indexCount, const GLvoid* indices, GLsizei instanceCount)
    The respecification of the IBO states (index type, PRI, PSIes) inbetween model drawing calls is kind of senseful: different models may have a different set of primitive type used for their construction; they may come from different vendors which use different PSI-bindings conventions; as with the PSI help the whole model is drawn using the single draw call, the setup of an IBO states according to specifications of the model's data conventions seem to be logical way of drawing.
    Howether, the lack of "mode" argument assumes that the primitive type becomes somewhat like an internal state and it is undefined until the first PSI encountered. Probably, it preserves the status since the last PSI encountering, so either the IBO shall start from one of the PSI or the default primitive type state must be set using some function just before calling the glDrawIndices (f.e. model's convention is to use GL_TRIANGLES by default unless the IBO starts from the explicit PSI). The normal drawing functions set the mode explicitly, but a proposed set of glDrawIndices functions avoid the disturbance of a primitive rasterization mode state as well as index type respecification (as I am just an OpenGL user I may predict any advantage here only intuitively).

    The way I see the implementation of PSI is more like an exception handling, so respecifying it for every new primitive is not a desired way of using this feature - if two consecutive primitives have the same type, usage of the restart index between them should be preferred over the switching index. But the PSI usage, even if implemented as exception for every switching index encountered, should obviously work faster then calling a glDrawElements* function, right?
    Last edited by Yandersen; 06-17-2014 at 08:10 PM.

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