From: bugzilla-daemon@freedesktop.org Subject: [Bug 27901] GLSL cos/sin functions broken on Mesa R600 driver Date: Mon, 17 May 2010 15:10:31 -0700 (PDT) Message-ID: <20100517221031.887CA13000D@annarchy.freedesktop.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from annarchy.freedesktop.org (annarchy.freedesktop.org [131.252.210.176]) by gabe.freedesktop.org (Postfix) with ESMTP id A4AED9E95B for ; Mon, 17 May 2010 15:10:31 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org https://bugs.freedesktop.org/show_bug.cgi?id=27901 --- Comment #1 from Conn Clark 2010-05-17 15:10:30 PDT --- A proper fix would be to fix the r700_assembler.c code so that it generates code to translate the radians input to a corresponding value between PI and -PI before passing it to the SIN or COS instructions. I *think* that this could be achieved through the following r600 instructions inst count unit opcode DEST SRC0, SRC1, SRC3 0 x: MUL tmp.x, ang, 1/(2.0 * pi) 1 x: FRACT tmp.x, tmp.x 2 x: ADD tmp.x, tmp.x, -0.5F y: MULADD tmp.y, tmp.x, (2.0 * pi), -(2.0 * pi) z: MUL tmp.z, tmp.x, (2.0 * pi) 3 x: CMOVEGT tmp.x, tmp.x, tmp.y, tmp.z 4 t: SIN or COS dest, tmp.x Unfortunately I can't quite figure out how to do it in the code yet to try and see. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.