diff options
author | Wladimir J. van der Laan <[email protected]> | 2017-01-31 09:23:51 +0100 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2017-01-31 19:29:16 +0100 |
commit | fe3bb8cdb519a01e6315ce6f142827aece3d4a41 (patch) | |
tree | 2666b4feb62ccf8096688add846b003fe753be9b /src/gallium/drivers/etnaviv/etnaviv_screen.c | |
parent | 33e0c5d003658320f5005e26caf55bbcfbe1fbb2 (diff) |
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: <[email protected]>
Signed-off-by: Wladimir J. van der Laan <[email protected]>
Acked-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_screen.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_screen.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c index 7c1609f5b72..57634201131 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c @@ -622,6 +622,8 @@ etna_get_specs(struct etna_screen *screen) screen->model >= 0x1000 || screen->model == 0x880; screen->specs.npot_tex_any_wrap = VIV_FEATURE(screen, chipMinorFeatures1, NON_POWER_OF_TWO); + screen->specs.has_new_sin_cos = + VIV_FEATURE(screen, chipMinorFeatures3, HAS_FAST_TRANSCENDENTALS); if (instruction_count > 256) { /* unified instruction memory? */ screen->specs.vs_offset = 0xC000; |