[Mesa-dev] [PATCH] gallium/docs: fix NRM, NRM4 docs

Jose Fonseca jfonseca at vmware.com
Fri Oct 31 15:52:12 PDT 2014


Looks good.

AFAICT these opcodes are never generated, and no driver except llvmpipe/softpipe/svga supports them.  The performance is dominated by the square root reciprocate which has its own opcode, RSQ, so personally I'm for removing these opcodes. 

Jose

________________________________________
From: mesa-dev <mesa-dev-bounces at lists.freedesktop.org> on behalf of Brian Paul <brianp at vmware.com>
Sent: 31 October 2014 22:09
To: mesa-dev at lists.freedesktop.org
Subject: [Mesa-dev] [PATCH] gallium/docs: fix NRM, NRM4 docs

Need to do a sqrt().

FWIW, the html that Sphinx 1.1.3 generates for the math expressions
looks completely broken.
---
 src/gallium/docs/source/tgsi.rst |   36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 7d5918f..2e01971 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -837,16 +837,37 @@ This instruction replicates its result.
 .. opcode:: NRM - 3-component Vector Normalise

 .. math::
+
+  u = src.x \times src.x + src.y \times src.y + src.z \times src.z

-  dst.x = src.x / (src.x \times src.x + src.y \times src.y + src.z \times src.z)
+  v = \frac{1}{\sqrt{u}}

-  dst.y = src.y / (src.x \times src.x + src.y \times src.y + src.z \times src.z)
+  dst.x = src.x \times v

-  dst.z = src.z / (src.x \times src.x + src.y \times src.y + src.z \times src.z)
+  dst.y = src.y \times v
+
+  dst.z = src.z \times v

   dst.w = 1


+.. opcode:: NRM4 - 4-component Vector Normalise
+
+.. math::
+
+  u = src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w
+
+  v = \frac{1}{\sqrt{u}}
+
+  dst.x = src.x \times v
+
+  dst.y = src.y \times v
+
+  dst.z = src.z \times v
+
+  dst.w = src.w \times v
+
+
 .. opcode:: DIV - Divide

 .. math::
@@ -1888,15 +1909,6 @@ Some require glsl version 1.30 (UIF/BREAKC/SWITCH/CASE/DEFAULT/ENDSWITCH).
    Ends a switch expression.


-.. opcode:: NRM4 - 4-component Vector Normalise
-
-This instruction replicates its result.
-
-.. math::
-
-  dst = \frac{src.x}{src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w}
-
-
 Interpolation ISA
 ^^^^^^^^^^^^^^^^^

--
1.7.10.4

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=AAIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=4bKmHe23DiKlVH-W1j4m5o9Kwlm6FmphS3eXx8l5n7k&s=iojTyR1LMxNqFh4RYaXXwoyhdW2gOACG45gQi8D05yc&e=


More information about the mesa-dev mailing list