OSDN Git Service

i965: Correctly emit the RNDZ instruction.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Oct 2010 18:40:19 +0000 (11:40 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 14 Oct 2010 19:40:16 +0000 (12:40 -0700)
commit897f6d3c7d06316b0535971cc2de318157c23692
treeedd5d5dc7e7192667e4386ef035e8b8b96b22fdb
parentf541b685aaf404fa7c8142f51d91c2720d82f264
i965: Correctly emit the RNDZ instruction.

Simply using RNDU, RNDZ, or RNDE does not produce the desired result.
Rather, the RND* instructions place a value in the destination register
that may be 1 less than the correct answer.  They can also set per-channel
"increment bits" in a flag register, which, if set, mean dest needs to
be incremented by 1.  A second instruction - a predicated add -
completes the job.

Notably, RNDD always produces the correct answer in a single
instruction.

Fixes piglit test glsl-fs-trunc.
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c