[Mesa-dev] [Mesa3d-dev] r300g: hack around issue with doom3 and 0 stride

Keith Whitwell keithw at vmware.com
Mon Apr 12 08:09:00 PDT 2010


On Mon, 2010-04-12 at 07:56 -0700, Alex Deucher wrote:
> On Mon, Apr 12, 2010 at 10:17 AM, Roland Scheidegger <sroland at vmware.com> wrote:
> > What's wrong with the stride zero concept?
> > I think most hw can handle this just fine (pretty sure all radeons
> > should, though of course driver might need some special case code if it
> > uses this to determine max index due to zero division). Apparently, you
> > could optimize it away on nv hardware, and some hardware might not like
> > it at all and hence needs to turn it into a constant, but is it really
> > necessary to do away with it at a higher level?
> > It might not be optimal to refetch the same vertex attribute over and
> > over again, but then the app looks poorly optimized to begin with if it
> > doesn't use a constant.
> >
> 
> radeon hw handles zero stride just fine.  The driver just has to deal
> with the 0 case properly.  E.g., in r600c:
> 
>     if(0 == pStreamDesc->stride)
>     {
>         nVBsize = paos->count * pStreamDesc->size *
> getTypeSize(pStreamDesc->type);
>     }
>     else
>     {
>         nVBsize = (paos->count - 1) * pStreamDesc->stride
>                   + pStreamDesc->size * getTypeSize(pStreamDesc->type);
>     }

I guess it's special cases like the above which catch out every driver
implemention which I take issue to, plus the fact that the whole concept
is self-inflicted from within Mesa -- it's not something which is
actually exposed through the API. 

Anyway, I'll take note of the general support for the idea & not propose
any changes until there is a clearer case that it's a source of real
problems...

Keith





More information about the mesa-dev mailing list