OSDN Git Service

etnaviv: Generate new sin/cos instructions on GC3000
authorWladimir J. van der Laan <laanwj@gmail.com>
Tue, 31 Jan 2017 08:23:51 +0000 (09:23 +0100)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Tue, 31 Jan 2017 18:29:16 +0000 (19:29 +0100)
commitfe3bb8cdb519a01e6315ce6f142827aece3d4a41
tree2666b4feb62ccf8096688add846b003fe753be9b
parent33e0c5d003658320f5005e26caf55bbcfbe1fbb2
etnaviv: Generate new sin/cos instructions on GC3000

Shaders using sin/cos instructions were not working on GC3000.

The reason for this turns out to be that these chips implement sin/cos
in a different way (but using the same opcodes):

- Need their input scaled by 1/pi instead of 2/pi.

- Output an x and y component, which need to be multiplied to
  get the result.

- tex_amode needs to be set to 1.

Add a new bit to the compiler specs and generate these instructions
as necessary.

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Acked-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_compiler.c
src/gallium/drivers/etnaviv/etnaviv_internal.h
src/gallium/drivers/etnaviv/etnaviv_screen.c