st/nine: correct rules for relative adressing and constants.

relative adressing for constants is possible only for vs float
constants.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: remove unused code for ps

Since constant indirect adressing is not allowed for ps,
we can remove our code to handle that.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Fix sm3 relative addressing for non-debug build

Relative addressing needs the constant buffer to get all
the correct constants, even those defined by the shader.

The code to copy the shader constants to the constant buffer
was enabled only for debug build. Enable it always.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Improve fallback when driver doesn't support user buffers.

For now the path updated is only used by Amd drivers, but a later
patch will make it used by all drivers. Some drivers like llvmpipe
doesn't support the uploading of constants from user buffers, so improve
the path to work for all drivers

Inspired from the gl state tracker.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Drop one path to upload constants

Drop the path to upload constants that was using a resource.
Use only the user_buffer one.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Fix constant buffer reinitialisation

The size used for the memset was incorrect.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: restrict to 256 constants for vs shaders.

This is wine behaviour and apparently the behaviour of dx9 drivers
for dx1x hw.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Drop unused code to handle more constants

We handle maximum 256 float constants, like wine and most dx9 drivers.
It is not possible to get more constants

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Change the calculation of the constant buffer size.

Count separately the number of float, int and bool constants.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Remove useless optimisations to avoid constant uploads

Previous removed path to upload constants was trying to do as
few uploads as possible.
The path kept doesn't benefit these optimisations, thus remove them.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: fix the size of the constant buffer whith some shaders

For shaders using indirect addressing on constants, we copy
the constants defined in the shader to the constant file.
That code didn't calculate the constant buffer size properly

Signed-off-by: Axel Davy <axel.davy@ens.fr>