Trying to understand vertex format for savage EXA composite

Alex Villací­s Lasso a_villacis at palosanto.com
Mon Nov 10 12:26:40 PST 2008


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.

-- 
perl -e '$x=2.4;print sprintf("%.0f + %.0f = %.0f\n",$x,$x,$x+$x);'




More information about the xorg mailing list