Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: glPrimitiveRestartIndex()

  1. #11
    Advanced Member Frequent Contributor
    Join Date
    Jan 2007
    Posts
    964
    More likely the case that NV are considerably more lenient in terms of which kinds of any old rubbish they accept.

    If it worked, it worked by accident, not by design. Please - you have a fixation on using primitive restart in a context where it makes no sense. That's the problem, not your driver, and whether it works on one but not another is not relevant.

  2. #12
    Junior Member Regular Contributor
    Join Date
    Dec 2009
    Posts
    178
    Even if it makes not much sense to use primitive restart with GL_POINTS or GL_LINES, if the driver doesn't follow the OpenGL spec it is a bug IMHO.

  3. #13
    Advanced Member Frequent Contributor
    Join Date
    Jan 2007
    Posts
    964
    Got news for you - no driver fully follows the spec. NV allow things they shouldn't, AMD don't allow things they should and Intel are off on a magical mystery tour of their very own.

    Are AMD not following the spec here? I'd suggest that you grab a copy of the spec and read it. The original NV_primitive_restart specifies behaviour with lines/points/etc. The core OpenGL spec does not. So unless the OP is using NV_primitive_restart (and he's not because even the #defined GLenums are different) then nothing is guaranteed - the driver is allowed do whatever the driver writers want.

    For reference, here is the complete specification from core for primitive restart:
    When one of the Draw* commands transfers a set of generic attribute array elements to the GL, if the index within the vertex arrays corresponding to that set is equal to the primitive restart index, then the GL does not process those elements as a vertex. Instead, it is as if the drawing command ended with the immediately preceding transfer, and another drawing command is immediately started with the same parameters, but only transferring the immediately following element through the end of the originally specified elements.
    That is all that drivers are obliged to follow. "It works on NV therefore it must be an AMD bug" is not an explanation - it's undefined behaviour, it's not in the spec, and so what if it works with current NV drivers - they're perfectly allowed to change that behaviour in any hypothetical future driver and they would still be conformant (and speaking of which - in the absence of conformance tests can the spec even be considered anything other than a glorified wishlist?)
    Last edited by mhagain; 06-28-2012 at 12:28 PM.

  4. #14
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,714
    it's not in the spec
    How did you manage to quote the spec and yet not read it? The spec says that the restart settings given by the OP are the exact equivalent to:

    Code :
    glDrawElements(GL_LINES, 4 , GL_UNSIGNED_INT ,(GLvoid *)0);
    glDrawElements(GL_LINES, 4 , GL_UNSIGNED_INT ,(GLvoid *)(5 * sizeof(GLuint));

    That's how the spec translates it: the same parameters except starting from the next index and continuing to the end.

    The spec's language with regard to primitive restarting makes no exceptions for primitive types, geometry shaders, or anything at all. If the above two commands are defined behavior, then according to the spec, it should work. Therefore, if it doesn't, (and everything else is correct), it is a driver bug.

    The original NV_primitive_restart specifies behaviour with lines/points/etc.
    Really? Where? Search the entire specification, and you will find not a single reference to POINTS, LINES, or TRIANGLES. Oh, you'll find discussion in the non-normative parts. IE: the Issues and Overview section. But as previously stated, those are non-normative. They don't actually describe how OpenGL should work under the extension; they're just plain-text information. A summary. It has no impact on what the true behavior will be.

    The language for NV_primitive_restart is functionally identical to the core language. The principle difference is how they're specified. As old-school GL functionality, NV_primitive_restart is defined around the immediate mode function glPrimitiveRestartNV. This is how it defines the behavior of the function:

    Quote Originally Posted by The Spec
    this command is equivalent to a call to End, followed by a call to Begin where the mode argument is the same mode as that used by the previous Begin.
    It makes no mention of specific primitives or the behavior thereof. It doesn't need to, because the logic for glEnd and glBegin already covers it. And the array section simply says that reading the restart index functions as if glPrimitiveRestartNV were called (since array rendering is defined in terms of glArrayElement).

Posting Permissions

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