On 12 November 2013 12:13, Kenneth Graunke <[email protected]> wrote:
> It would be great to put a citation for this: > > /* From the ARB_multi_draw_indirect specification: > * "INVALID_VALUE is generated by MultiDrawArraysIndirect or > * MultiDrawElementsIndirect if <primcount> is negative." > * > * "<primcount> must be positive, otherwise an INVALID_VALUE error will > * be generated." > */ > > These beg the question of whether 0 is allowed. Usually I interpret > "negative" as < 0, "positive" as >= 0, and "strictly positive" as > 0. > So I think zero should be allowed, and I don't see a contradiction. > > The only text I can find in 4.3 and 4.4 just reiterate that it needs to > positive, and I don't see any text defining "positive." > In the absence of text defining "positive", shouldn't we go with the definition used by mathematicians? According to http://en.wikipedia.org/wiki/Sign_%28mathematics%29#Terminology_for_signs, "positive" means strictly greater than zero. If anyone is aware of a competing implementation that accepts a primcount of 0, then I'd be open to following the behaviour of the competing implementation (and filing a spec bug). But otherwise I think we should prohibit zero. (Note: I brought this up last time the patch was reviewed: http://lists.freedesktop.org/archives/mesa-dev/2013-November/047962.html) > > Our existing implementation of MultiDrawElements appears to allow 0, > simply turning it into a noop. This seems to be supported by the > pseudocode; the loop will simply execute zero times. > > > + _mesa_error(ctx, GL_INVALID_VALUE, "%s(primcount <= 0)", name); > > + return GL_FALSE; > > + } > > + > > /* From the ARB_multi_draw_indirect specification: > * "<stride> must be a multiple of four, otherwise an INVALID_VALUE > * error is generated." > */ > > > + if (stride % 4) { > > + _mesa_error(ctx, GL_INVALID_VALUE, "%s(stride %% 4)", name); > > + return GL_FALSE; > > + } > > + > > + return GL_TRUE; > > +} > > Assuming you add spec citations, and either allow primcount == 0 or > refute my claim that it should be valid, this would get a: > > Reviewed-by: Kenneth Graunke <[email protected]> > _______________________________________________ > mesa-dev mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
