NV2A Draw methods - JayFoxRox/xqemu-jfr GitHub Wiki

All of these are between NV097_SET_BEGIN_END with BEGIN(primitive type) and END

Inline Buffer / SetVertexData [GL style BEGIN / END xbox rendering]

Examples: Present() [?] in D3D (Not sure which version) = used for final blit

  • Format set by setter functions? What if the format changes halfway through?
  • Set data using either NV097_SET_VERTEX4F, NV097_SET_NORMAL3F, ... or NV097_SET_VERTEX_DATA*
  • Next vertex selected using NV097_SET_VERTEX4F and probably [but not confirmed] NV097_SET_VERTEX* in general
  • This has states, so setting diffuse one will mean it will stick for the next vertices until it's set again. This means we either must copy from the previous state OR keep track of the current state

Inline Array / DrawPrimitiveUP / DrawIndexedPrimitiveUP

Examples: Present() [?] in D3D (Not sure which version) = used for final blit

  • Not indexed, duplicate vertices will be reuploaded
  • Data uploaded using NV097_INLINE_ARRAY
  • Uses attribute format from NV097_SET_VERTEX_DATA_ARRAY_FORMAT
  • Stride and attribute offset is generated by stride = offset(i) += attribute->size(i-1) * attribute->count(i-1)
  • It is unknown wether an attribute->stride != 0 is respected.

Inline Elements / DrawIndexedPrimitive

  • Uses attribute format from NV097_SET_VERTEX_DATA_ARRAY_FORMAT
  • Indexed, index uploads using NV097_ARRAY_ELEMENT16, NV097_ARRAY_ELEMENT32

Draw Arrays / DrawPrimitive

  • Uses vertex buffer from NV097_SET_VERTEX_DATA_ARRAY_OFFSET
  • Uses attribute format from NV097_SET_VERTEX_DATA_ARRAY_FORMAT
  • Maximum of 256 vertices per draw call
  • Maximum number of addressable vertices 0xffff (index_of_first_vertex <= 0xffff; (index_of_first_vertex + vertex_count) <= 0xffff)
  • 2 Arguments: Number of vertices, Index of first Vertex