i965/fs: Add missing const qualifier.
freedreno/ir3: hack for standalone compiler

Standalone compiler doesn't have screen or context.  We need to come up
with a better way to control the target arch (ie. something that we can
control from cmdline w/ standalone compiler) but for now this hack keeps
it from segfault'ing.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/ir3: trans_kill cleanup

trans_kill() only handles the single opcode.  Drop the remnant of a time
when both KILL and KILL_IF were handled by the same fxn.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: update generated headers
freedreno/a4xx: alpha-test

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a4xx: blend-color

Signed-off-by: Rob Clark <robclark@freedesktop.org>
st/nine: fix DBG typo (trivial)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
r300g: implement ARR opcode

Same as ARL, just has extra rounding.
Useful for st/nine.

Tested-by: Pavel Ondračka <pavel.ondracka@email.cz>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
st/nine: Fix bad logic in nine_state

The clip state was reset everytime, incurring an overhead.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: additional defines to d3dtypes.h

Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
st/nine: add missing c++ declaration for IDirect3DVolumeTexture9

Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
st/nine: Add new texture format strings

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: fix D3DRS_POINTSPRITE support

It's done by testing the existence of the point sprite output register *after* parsing the vertex shader.

Acked-by: David Heidelberg <david@ixit.cz>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
st/nine: NineBaseTexture9: fix setting of last_layer

last_layer should be only non-null for cubetexture for Nine.
There was probably a confusion for 3D textures, but those
need last_layer=0 as well.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: CubeTexture: fix GetLevelDesc

This->surfaces contains the surfaces associated to the levels
and faces. This->surfaces[6*Level] is what we want here,
since it gives us a face descriptor for the level 'Level'.

Tested-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>
st/nine: fix crash when deleting non-implicit swapchain

The implicit swapchains are destroyed when the device instance is
destroyed. However for non-implicit swapchains, it is not the case,
and the application can have kept an reference on the swapchain
buffers to reuse them.

Fixes problems with battle.net launcher.

Tested-by: Nick Sarnie <commendsarnex@gmail.com>
Tested-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: return D3DERR_INVALIDCALL when trying to create a texture of bad format

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: NineBaseTexture9: update sampler view creation

While previous code was having the correct behaviour in general,
this new code is more readable (without checking all gallium formats
manually) and has a more defined behaviour for depth stencil resources.

Reviewed-by: David Heidelberg <david@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Check if srgb format is supported before trying to use it.

According to msdn, we must act as if user didn't ask srgb if we don't
support it.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
st/nine: Add ATI1 and ATI2 support

Adds ATI1 and ATI2 support to nine.

They map to PIPE_FORMAT_RGTC1_UNORM and PIPE_FORMAT_RGTC2_UNORM,
but need special handling.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Xavier Bouchoux <xavierb@gmail.com>