<div class="gmail_quote">Sorry about the first part of my last email, it shouldn&#39;t have been there..<br><br>On Fri, Apr 30, 2010 at 6:15 PM, José Fonseca <span dir="ltr">&lt;<a href="mailto:jfonseca@vmware.com">jfonseca@vmware.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I agree that deriving coarse grained caps from fine grained sounds<br>
better.<br>
<br>
Anyway, I&#39;ll apply this on until we have better caps system inplace, as<br>
it&#39;s better than nothing.<br>
<br>
One more question, having the design of these new fine caps in mind, are<br>
the gl_program_constants sufficient?<br>
<br>
  MaxNativeInstructions<br>
  MaxNativeAluInstructions<br>
  MaxNativeTexInstructions<br>
  MaxNativeTexIndirections<br>
  MaxNativeAttribs<br>
  MaxNativeTemps<br>
  MaxNativeAddressRegs<br>
  MaxNativeParameters<br></blockquote><div><br>I think so. I mean these caps are useful for detecting a certain piece of hw and it&#39;s generally a good upper bound as the shader compiler may ideally eliminate or pair up some instructions (or unwind a few in the worst case).<br>

<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
One obvious omission relative to D3D9 caps are max dynamic control flow<br>
depth. These are not mentioned in the R300ToDo wiki page. Does hardware<br>
we care about has such limitations too?<br></blockquote><div><br>r500 has two flow control modes. The first one is limited to the depth of 6, the other one seems to be unlimited but I guess it&#39;s slower.<br><br></div>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Also, it&#39;s interesting to read on the R300ToDo wiki page<br></blockquote><div><br>Thanks. ;)<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<br>
  &quot;Vertex formats GL_*INT and GL_DOUBLE are not supported. GL_*SHORT is<br>
supported only for 2- and 4-component vertex attributes, and GL_*BYTE<br>
only for 4-component attributes. All individual vertex attribute fetches<br>
must be DWORD-aligned.&quot;<br>
<br>
This clearly resembles the<br>
<a href="http://msdn.microsoft.com/en-us/library/bb172533%28VS.85%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/bb172533(VS.85).aspx</a> . It<br>
appears that modifying draw module or a new library for software vertex<br>
fetch/emit without vertex shading would be useful for a lot of hardware.<br></blockquote><div><br>This was the next big thing in my priority list. The idea is to introduce an &quot;assist&quot; driver and put all workarounds from r300g into it i.e. index buffer workarounds, the two-sided stencil reference value workaround, even the NPOT and shadow samplers emulation, various instructions emulation, and branch unrolling once the r300 compiler can do a lossless TGSI-&gt;compiler-&gt;TGSI translation (but ONLY IF there is another driver which needs these features, the effort must be worth it). Ideally the hw driver should inherit the assist driver context, which in turn would inherit pipe_context so that not all functions need to be overridden (unlike failover), and then adding the translation of incompatible vertex layouts to something a strict D3D9 hw can consume. That is the dream.<br>

<br>BTW in cases when both a vertex attrib offset and stride are not a multiple of 4, we simply align the formats e.g. R8G8 -&gt; R8G8X8X8 (xy01). However it&#39;s absolutely legal in GL to use e.g. R8G8B8A8 with non-DWORD aligned offset and even if the format alone is supported, hw cannot fetch it. The same holds for the stride, and even for the index buffer offset (ushort indices) so these must be aligned too, meaning that simple is_vertex_format_supported is not enough.<br>

<br>BTW2 I&#39;ve put some vertex submission tests for unaligned vertex buffer access here as I wanted to cover all stuff r300 cannot support:<br><a href="http://cgit.freedesktop.org/~mareko/piglit/log/">http://cgit.freedesktop.org/~mareko/piglit/log/</a><br>

</div></div><br>-Marek<br>