Trying to understand vertex format for savage EXA composite

Alex Deucher alexdeucher at
Tue Nov 11 06:44:11 PST 2008

On Mon, Nov 10, 2008 at 3:26 PM, Alex Villací­s Lasso
<a_villacis at> wrote:
> Good news! My machine rose itself from the dead while salvaging its memory
> chips, so now I can continue tinkering with the savage driver.
> Since a while ago, I am trying to write an EXA composite acceleration
> implementation for savage. I have gotten to the point that I can pipe a few
> vertices through BCI, and get something displayed on the screen as a result.
> However, this something is not what I intended. For example, the themed
> mouse cursor shows as a broken arrow bitmap, horizontally sliced, and it
> shifts and wraps sideways when moving it up and down.
> I suspect I am sending incorrect vertex values. The problem is that it is
> hard to find a documentation on the vertex format for the savage. What I
> found out is that I can trim down the vertex format to (x value, y value,
> source tex x, source tex y, mask tex x, mask tex y), and that all of these
> values are supposed to be 32-bit floats (glFloat values from what I can see
> in Mesa sources). But I am not sure of the mapping of the ranges of (x,y)
> coordinates into the values that are supposed to be emitted. The Mesa
> sources say that the savage is "DirectX-oriented", but I am not sure exactly
> what does this imply regarding the values of the vertex record. What I am
> sending is:
> x value, y value: value passed as destination coordinate (integer),
> converted as if by assignment to 32-bit floating point. A value of 8 gets
> converted to the bit representation of 8.0f, regardless of the destination
> width/height.
> texture coordinates: value converted from the range between 0 and the
> texture dimensions into the range 0.0f .. 1.0f . So if the texture of 128
> pixels wide has a coordinate of 64, this gets converted to the bit
> representation of 0.5f
> Is this the correct way to convert coordinates? Or should I do something
> different? I particularly suspect the destination coordinates, but I cannot
> find any documentation regarding this on google.

Your best bet it to look at the savage mesa and drm code.  It's been a
while since I looked at savage 3D, but it used directx vertex formats
directly (like lots of cards at the time).  As such much of the vertex
handling was done via vertex template code in mesa.   Another problem
may be the textures.  IIRC, they had to be tiled and had some strange
memory layouts.   You might ask on dri-devel.


More information about the xorg mailing list