From c686e17e52eb9964137fd1a46fbbc96e368b6286 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 20 Dec 2009 15:00:40 -0800 Subject: Add Gallium docs. In Sphinx/ReST format. --- src/gallium/docs/source/tgsi.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/gallium/docs/source/tgsi.rst (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst new file mode 100644 index 0000000000..2474925b46 --- /dev/null +++ b/src/gallium/docs/source/tgsi.rst @@ -0,0 +1,7 @@ +TGSI +==== + +TGSI, Tungsten Graphics Shader Instructions, is an intermediate language +for describing shaders. Since Gallium is inherently shaderful, shaders are +an important part of the API. TGSI is the only intermediate representation +used by all drivers. -- cgit v1.2.3 From a62aaa739924208f9469a75c43a407c0d72a427e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 21 Dec 2009 23:25:15 +0000 Subject: docs: pull in tgsi-instruction-set.txt verbatim --- src/gallium/docs/source/tgsi.rst | 1164 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 1164 insertions(+) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 2474925b46..30717bdf7b 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -5,3 +5,1167 @@ TGSI, Tungsten Graphics Shader Instructions, is an intermediate language for describing shaders. Since Gallium is inherently shaderful, shaders are an important part of the API. TGSI is the only intermediate representation used by all drivers. + + +TGSI Instruction Specification +============================== + + +1 Instruction Set Operations +============================= + + +1.1 GL_NV_vertex_program +------------------------- + + +1.1.1 ARL - Address Register Load + + dst.x = floor(src.x) + dst.y = floor(src.y) + dst.z = floor(src.z) + dst.w = floor(src.w) + + +1.1.2 MOV - Move + + dst.x = src.x + dst.y = src.y + dst.z = src.z + dst.w = src.w + + +1.1.3 LIT - Light Coefficients + + dst.x = 1.0 + dst.y = max(src.x, 0.0) + dst.z = (src.x > 0.0) ? pow(max(src.y, 0.0), clamp(src.w, -128.0, 128.0)) : 0.0 + dst.w = 1.0 + + +1.1.4 RCP - Reciprocal + + dst.x = 1.0 / src.x + dst.y = 1.0 / src.x + dst.z = 1.0 / src.x + dst.w = 1.0 / src.x + + +1.1.5 RSQ - Reciprocal Square Root + + dst.x = 1.0 / sqrt(abs(src.x)) + dst.y = 1.0 / sqrt(abs(src.x)) + dst.z = 1.0 / sqrt(abs(src.x)) + dst.w = 1.0 / sqrt(abs(src.x)) + + +1.1.6 EXP - Approximate Exponential Base 2 + + dst.x = pow(2.0, floor(src.x)) + dst.y = src.x - floor(src.x) + dst.z = pow(2.0, src.x) + dst.w = 1.0 + + +1.1.7 LOG - Approximate Logarithm Base 2 + + dst.x = floor(lg2(abs(src.x))) + dst.y = abs(src.x) / pow(2.0, floor(lg2(abs(src.x)))) + dst.z = lg2(abs(src.x)) + dst.w = 1.0 + + +1.1.8 MUL - Multiply + + dst.x = src0.x * src1.x + dst.y = src0.y * src1.y + dst.z = src0.z * src1.z + dst.w = src0.w * src1.w + + +1.1.9 ADD - Add + + dst.x = src0.x + src1.x + dst.y = src0.y + src1.y + dst.z = src0.z + src1.z + dst.w = src0.w + src1.w + + +1.1.10 DP3 - 3-component Dot Product + + dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + + +1.1.11 DP4 - 4-component Dot Product + + dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + + +1.1.12 DST - Distance Vector + + dst.x = 1.0 + dst.y = src0.y * src1.y + dst.z = src0.z + dst.w = src1.w + + +1.1.13 MIN - Minimum + + dst.x = min(src0.x, src1.x) + dst.y = min(src0.y, src1.y) + dst.z = min(src0.z, src1.z) + dst.w = min(src0.w, src1.w) + + +1.1.14 MAX - Maximum + + dst.x = max(src0.x, src1.x) + dst.y = max(src0.y, src1.y) + dst.z = max(src0.z, src1.z) + dst.w = max(src0.w, src1.w) + + +1.1.15 SLT - Set On Less Than + + dst.x = (src0.x < src1.x) ? 1.0 : 0.0 + dst.y = (src0.y < src1.y) ? 1.0 : 0.0 + dst.z = (src0.z < src1.z) ? 1.0 : 0.0 + dst.w = (src0.w < src1.w) ? 1.0 : 0.0 + + +1.1.16 SGE - Set On Greater Equal Than + + dst.x = (src0.x >= src1.x) ? 1.0 : 0.0 + dst.y = (src0.y >= src1.y) ? 1.0 : 0.0 + dst.z = (src0.z >= src1.z) ? 1.0 : 0.0 + dst.w = (src0.w >= src1.w) ? 1.0 : 0.0 + + +1.1.17 MAD - Multiply And Add + + dst.x = src0.x * src1.x + src2.x + dst.y = src0.y * src1.y + src2.y + dst.z = src0.z * src1.z + src2.z + dst.w = src0.w * src1.w + src2.w + + +1.2 GL_ATI_fragment_shader +--------------------------- + + +1.2.1 SUB - Subtract + + dst.x = src0.x - src1.x + dst.y = src0.y - src1.y + dst.z = src0.z - src1.z + dst.w = src0.w - src1.w + + +1.2.2 DOT3 - 3-component Dot Product + + Alias for DP3. + + +1.2.3 DOT4 - 4-component Dot Product + + Alias for DP4. + + +1.2.4 LERP - Linear Interpolate + + dst.x = src0.x * (src1.x - src2.x) + src2.x + dst.y = src0.y * (src1.y - src2.y) + src2.y + dst.z = src0.z * (src1.z - src2.z) + src2.z + dst.w = src0.w * (src1.w - src2.w) + src2.w + + +1.2.5 CND - Condition + + dst.x = (src2.x > 0.5) ? src0.x : src1.x + dst.y = (src2.y > 0.5) ? src0.y : src1.y + dst.z = (src2.z > 0.5) ? src0.z : src1.z + dst.w = (src2.w > 0.5) ? src0.w : src1.w + + +1.2.6 CND0 - Condition Zero + + Removed. Use (CMP src2, src1, src0) instead. + +1.2.7 DOT2ADD - 2-component Dot Product And Add + + dst.x = src0.x * src1.x + src0.y * src1.y + src2.x + dst.y = src0.x * src1.x + src0.y * src1.y + src2.x + dst.z = src0.x * src1.x + src0.y * src1.y + src2.x + dst.w = src0.x * src1.x + src0.y * src1.y + src2.x + + +1.3 GL_EXT_vertex_shader +------------------------- + + +1.3.1 INDEX - Array Lookup + + Considered for removal from language. + + +1.3.2 NEGATE - Negate + + Considered for removal from language. + + +1.3.3 MADD - Multiply And Add + + Alias for MAD. + + +1.3.4 FRAC - Fraction + + dst.x = src.x - floor(src.x) + dst.y = src.y - floor(src.y) + dst.z = src.z - floor(src.z) + dst.w = src.w - floor(src.w) + + +1.3.5 SETGE - Set On Greater Equal + + Alias for SGE. + + +1.3.6 SETLT - Set On Less Than + + Alias for SLT. + + +1.3.7 CLAMP - Clamp + + dst.x = clamp(src0.x, src1.x, src2.x) + dst.y = clamp(src0.y, src1.y, src2.y) + dst.z = clamp(src0.z, src1.z, src2.z) + dst.w = clamp(src0.w, src1.w, src2.w) + + +1.3.8 FLOOR - Floor + + dst.x = floor(src.x) + dst.y = floor(src.y) + dst.z = floor(src.z) + dst.w = floor(src.w) + + +1.3.9 ROUND - Round + + dst.x = round(src.x) + dst.y = round(src.y) + dst.z = round(src.z) + dst.w = round(src.w) + + +1.3.10 EXPBASE2 - Exponential Base 2 + + dst.x = pow(2.0, src.x) + dst.y = pow(2.0, src.x) + dst.z = pow(2.0, src.x) + dst.w = pow(2.0, src.x) + + +1.3.11 LOGBASE2 - Logarithm Base 2 + + dst.x = lg2(src.x) + dst.y = lg2(src.x) + dst.z = lg2(src.x) + dst.w = lg2(src.x) + + +1.3.12 POWER - Power + + dst.x = pow(src0.x, src1.x) + dst.y = pow(src0.x, src1.x) + dst.z = pow(src0.x, src1.x) + dst.w = pow(src0.x, src1.x) + + +1.3.13 RECIP - Reciprocal + + Alias for RCP. + + +1.3.14 RECIPSQRT - Reciprocal Square Root + + Alias for RSQ. + + +1.3.15 CROSSPRODUCT - Cross Product + + dst.x = src0.y * src1.z - src1.y * src0.z + dst.y = src0.z * src1.x - src1.z * src0.x + dst.z = src0.x * src1.y - src1.x * src0.y + dst.w = 1.0 + + +1.3.16 MULTIPLYMATRIX - Multiply Matrix + + Considered for removal from language. + + +1.4 GL_NV_vertex_program1_1 +---------------------------- + + +1.4.1 ABS - Absolute + + dst.x = abs(src.x) + dst.y = abs(src.y) + dst.z = abs(src.z) + dst.w = abs(src.w) + + +1.4.2 RCC - Reciprocal Clamped + + dst.x = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) + dst.y = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) + dst.z = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) + dst.w = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) + + +1.4.3 DPH - Homogeneous Dot Product + + dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w + dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w + dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w + dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w + + +1.5 GL_NV_fragment_program +--------------------------- + + +1.5.1 COS - Cosine + + dst.x = cos(src.x) + dst.y = cos(src.x) + dst.z = cos(src.x) + dst.w = cos(src.w) + + +1.5.2 DDX - Derivative Relative To X + + dst.x = partialx(src.x) + dst.y = partialx(src.y) + dst.z = partialx(src.z) + dst.w = partialx(src.w) + + +1.5.3 DDY - Derivative Relative To Y + + dst.x = partialy(src.x) + dst.y = partialy(src.y) + dst.z = partialy(src.z) + dst.w = partialy(src.w) + + +1.5.4 EX2 - Exponential Base 2 + + Alias for EXPBASE2. + + +1.5.5 FLR - Floor + + Alias for FLOOR. + + +1.5.6 FRC - Fraction + + Alias for FRAC. + + +1.5.7 KILP - Predicated Discard + + discard + + +1.5.8 LG2 - Logarithm Base 2 + + Alias for LOGBASE2. + + +1.5.9 LRP - Linear Interpolate + + Alias for LERP. + + +1.5.10 PK2H - Pack Two 16-bit Floats + + TBD + + +1.5.11 PK2US - Pack Two Unsigned 16-bit Scalars + + TBD + + +1.5.12 PK4B - Pack Four Signed 8-bit Scalars + + TBD + + +1.5.13 PK4UB - Pack Four Unsigned 8-bit Scalars + + TBD + + +1.5.14 POW - Power + + Alias for POWER. + + +1.5.15 RFL - Reflection Vector + + dst.x = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.x - src1.x + dst.y = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.y - src1.y + dst.z = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.z - src1.z + dst.w = 1.0 + + +1.5.16 SEQ - Set On Equal + + dst.x = (src0.x == src1.x) ? 1.0 : 0.0 + dst.y = (src0.y == src1.y) ? 1.0 : 0.0 + dst.z = (src0.z == src1.z) ? 1.0 : 0.0 + dst.w = (src0.w == src1.w) ? 1.0 : 0.0 + + +1.5.17 SFL - Set On False + + dst.x = 0.0 + dst.y = 0.0 + dst.z = 0.0 + dst.w = 0.0 + + +1.5.18 SGT - Set On Greater Than + + dst.x = (src0.x > src1.x) ? 1.0 : 0.0 + dst.y = (src0.y > src1.y) ? 1.0 : 0.0 + dst.z = (src0.z > src1.z) ? 1.0 : 0.0 + dst.w = (src0.w > src1.w) ? 1.0 : 0.0 + + +1.5.19 SIN - Sine + + dst.x = sin(src.x) + dst.y = sin(src.x) + dst.z = sin(src.x) + dst.w = sin(src.w) + + +1.5.20 SLE - Set On Less Equal Than + + dst.x = (src0.x <= src1.x) ? 1.0 : 0.0 + dst.y = (src0.y <= src1.y) ? 1.0 : 0.0 + dst.z = (src0.z <= src1.z) ? 1.0 : 0.0 + dst.w = (src0.w <= src1.w) ? 1.0 : 0.0 + + +1.5.21 SNE - Set On Not Equal + + dst.x = (src0.x != src1.x) ? 1.0 : 0.0 + dst.y = (src0.y != src1.y) ? 1.0 : 0.0 + dst.z = (src0.z != src1.z) ? 1.0 : 0.0 + dst.w = (src0.w != src1.w) ? 1.0 : 0.0 + + +1.5.22 STR - Set On True + + dst.x = 1.0 + dst.y = 1.0 + dst.z = 1.0 + dst.w = 1.0 + + +1.5.23 TEX - Texture Lookup + + TBD + + +1.5.24 TXD - Texture Lookup with Derivatives + + TBD + + +1.5.25 TXP - Projective Texture Lookup + + TBD + + +1.5.26 UP2H - Unpack Two 16-Bit Floats + + TBD + + +1.5.27 UP2US - Unpack Two Unsigned 16-Bit Scalars + + TBD + + +1.5.28 UP4B - Unpack Four Signed 8-Bit Values + + TBD + + +1.5.29 UP4UB - Unpack Four Unsigned 8-Bit Scalars + + TBD + + +1.5.30 X2D - 2D Coordinate Transformation + + dst.x = src0.x + src1.x * src2.x + src1.y * src2.y + dst.y = src0.y + src1.x * src2.z + src1.y * src2.w + dst.z = src0.x + src1.x * src2.x + src1.y * src2.y + dst.w = src0.y + src1.x * src2.z + src1.y * src2.w + + +1.6 GL_NV_vertex_program2 +-------------------------- + + +1.6.1 ARA - Address Register Add + + TBD + + +1.6.2 ARR - Address Register Load With Round + + dst.x = round(src.x) + dst.y = round(src.y) + dst.z = round(src.z) + dst.w = round(src.w) + + +1.6.3 BRA - Branch + + pc = target + + +1.6.4 CAL - Subroutine Call + + push(pc) + pc = target + + +1.6.5 RET - Subroutine Call Return + + pc = pop() + + +1.6.6 SSG - Set Sign + + dst.x = (src.x > 0.0) ? 1.0 : (src.x < 0.0) ? -1.0 : 0.0 + dst.y = (src.y > 0.0) ? 1.0 : (src.y < 0.0) ? -1.0 : 0.0 + dst.z = (src.z > 0.0) ? 1.0 : (src.z < 0.0) ? -1.0 : 0.0 + dst.w = (src.w > 0.0) ? 1.0 : (src.w < 0.0) ? -1.0 : 0.0 + + +1.7 GL_ARB_vertex_program +-------------------------- + + +1.7.1 SWZ - Extended Swizzle + + dst.x = src.x + dst.y = src.y + dst.z = src.z + dst.w = src.w + + +1.7.2 XPD - Cross Product + + Alias for CROSSPRODUCT. + + +1.8 GL_ARB_fragment_program +---------------------------- + + +1.8.1 CMP - Compare + + dst.x = (src0.x < 0.0) ? src1.x : src2.x + dst.y = (src0.y < 0.0) ? src1.y : src2.y + dst.z = (src0.z < 0.0) ? src1.z : src2.z + dst.w = (src0.w < 0.0) ? src1.w : src2.w + + +1.8.2 KIL - Conditional Discard + + if (src.x < 0.0 || src.y < 0.0 || src.z < 0.0 || src.w < 0.0) + discard + endif + + +1.8.3 SCS - Sine Cosine + + dst.x = cos(src.x) + dst.y = sin(src.x) + dst.z = 0.0 + dst.y = 1.0 + + +1.8.4 TXB - Texture Lookup With Bias + + TBD + + +1.9 GL_NV_fragment_program2 +---------------------------- + + +1.9.1 NRM - 3-component Vector Normalise + + dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z) + dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z) + dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z) + dst.w = 1.0 + + +1.9.2 DIV - Divide + + dst.x = src0.x / src1.x + dst.y = src0.y / src1.y + dst.z = src0.z / src1.z + dst.w = src0.w / src1.w + + +1.9.3 DP2 - 2-component Dot Product + + dst.x = src0.x * src1.x + src0.y * src1.y + dst.y = src0.x * src1.x + src0.y * src1.y + dst.z = src0.x * src1.x + src0.y * src1.y + dst.w = src0.x * src1.x + src0.y * src1.y + + +1.9.4 DP2A - 2-component Dot Product And Add + + Alias for DOT2ADD. + + +1.9.5 TXL - Texture Lookup With LOD + + TBD + + +1.9.6 BRK - Break + + TBD + + +1.9.7 IF - If + + TBD + + +1.9.8 BGNFOR - Begin a For-Loop + + dst.x = floor(src.x) + dst.y = floor(src.y) + dst.z = floor(src.z) + + if (dst.y <= 0) + pc = [matching ENDFOR] + 1 + endif + + Note: The destination must be a loop register. + The source must be a constant register. + + +1.9.9 REP - Repeat + + TBD + + +1.9.10 ELSE - Else + + TBD + + +1.9.11 ENDIF - End If + + TBD + + +1.9.12 ENDFOR - End a For-Loop + + dst.x = dst.x + dst.z + dst.y = dst.y - 1.0 + + if (dst.y > 0) + pc = [matching BGNFOR instruction] + 1 + endif + + Note: The destination must be a loop register. + + +1.9.13 ENDREP - End Repeat + + TBD + + +1.10 GL_NV_vertex_program3 +--------------------------- + + +1.10.1 PUSHA - Push Address Register On Stack + + push(src.x) + push(src.y) + push(src.z) + push(src.w) + + +1.10.2 POPA - Pop Address Register From Stack + + dst.w = pop() + dst.z = pop() + dst.y = pop() + dst.x = pop() + + +1.11 GL_NV_gpu_program4 +------------------------ + + +1.11.1 CEIL - Ceiling + + dst.x = ceil(src.x) + dst.y = ceil(src.y) + dst.z = ceil(src.z) + dst.w = ceil(src.w) + + +1.11.2 I2F - Integer To Float + + dst.x = (float) src.x + dst.y = (float) src.y + dst.z = (float) src.z + dst.w = (float) src.w + + +1.11.3 NOT - Bitwise Not + + dst.x = ~src.x + dst.y = ~src.y + dst.z = ~src.z + dst.w = ~src.w + + +1.11.4 TRUNC - Truncate + + dst.x = trunc(src.x) + dst.y = trunc(src.y) + dst.z = trunc(src.z) + dst.w = trunc(src.w) + + +1.11.5 SHL - Shift Left + + dst.x = src0.x << src1.x + dst.y = src0.y << src1.x + dst.z = src0.z << src1.x + dst.w = src0.w << src1.x + + +1.11.6 SHR - Shift Right + + dst.x = src0.x >> src1.x + dst.y = src0.y >> src1.x + dst.z = src0.z >> src1.x + dst.w = src0.w >> src1.x + + +1.11.7 AND - Bitwise And + + dst.x = src0.x & src1.x + dst.y = src0.y & src1.y + dst.z = src0.z & src1.z + dst.w = src0.w & src1.w + + +1.11.8 OR - Bitwise Or + + dst.x = src0.x | src1.x + dst.y = src0.y | src1.y + dst.z = src0.z | src1.z + dst.w = src0.w | src1.w + + +1.11.9 MOD - Modulus + + dst.x = src0.x % src1.x + dst.y = src0.y % src1.y + dst.z = src0.z % src1.z + dst.w = src0.w % src1.w + + +1.11.10 XOR - Bitwise Xor + + dst.x = src0.x ^ src1.x + dst.y = src0.y ^ src1.y + dst.z = src0.z ^ src1.z + dst.w = src0.w ^ src1.w + + +1.11.11 SAD - Sum Of Absolute Differences + + dst.x = abs(src0.x - src1.x) + src2.x + dst.y = abs(src0.y - src1.y) + src2.y + dst.z = abs(src0.z - src1.z) + src2.z + dst.w = abs(src0.w - src1.w) + src2.w + + +1.11.12 TXF - Texel Fetch + + TBD + + +1.11.13 TXQ - Texture Size Query + + TBD + + +1.11.14 CONT - Continue + + TBD + + +1.12 GL_NV_geometry_program4 +----------------------------- + + +1.12.1 EMIT - Emit + + TBD + + +1.12.2 ENDPRIM - End Primitive + + TBD + + +1.13 GLSL +---------- + + +1.13.1 BGNLOOP - Begin a Loop + + TBD + + +1.13.2 BGNSUB - Begin Subroutine + + TBD + + +1.13.3 ENDLOOP - End a Loop + + TBD + + +1.13.4 ENDSUB - End Subroutine + + TBD + + +1.13.5 INT - Truncate + + Alias for TRUNC. + + +1.13.6 NOISE1 - 1D Noise + + TBD + + +1.13.7 NOISE2 - 2D Noise + + TBD + + +1.13.8 NOISE3 - 3D Noise + + TBD + + +1.13.9 NOISE4 - 4D Noise + + TBD + + +1.13.10 NOP - No Operation + + Do nothing. + + +1.14 ps_1_1 +------------ + + +1.14.1 TEXKILL - Conditional Discard + + Alias for KIL. + + +1.15 ps_1_4 +------------ + + +1.15.1 TEXLD - Texture Lookup + + Alias for TEX. + + +1.16 ps_2_0 +------------ + + +1.16.1 M4X4 - Multiply Matrix + + Alias for MULTIPLYMATRIX. + + +1.16.2 M4X3 - Multiply Matrix + + Considered for removal from language. + + +1.16.3 M3X4 - Multiply Matrix + + Considered for removal from language. + + +1.16.4 M3X3 - Multiply Matrix + + Considered for removal from language. + + +1.16.5 M3X2 - Multiply Matrix + + Considered for removal from language. + + +1.16.6 CRS - Cross Product + + Alias for XPD. + + +1.16.7 NRM4 - 4-component Vector Normalise + + dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) + dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) + dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) + dst.w = src.w / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) + + +1.16.8 SINCOS - Sine Cosine + + Alias for SCS. + + +1.16.9 TEXLDB - Texture Lookup With Bias + + Alias for TXB. + + +1.16.10 DP2ADD - 2-component Dot Product And Add + + Alias for DP2A. + + +1.17 ps_2_x +------------ + + +1.17.1 CALL - Subroutine Call + + Alias for CAL. + + +1.17.2 CALLNZ - Subroutine Call If Not Zero + + TBD + + +1.17.3 IFC - If + + TBD + + +1.17.4 BREAK - Break + + Alias for BRK. + + +1.17.5 BREAKC - Break Conditional + + TBD + + +1.17.6 DSX - Derivative Relative To X + + Alias for DDX. + + +1.17.7 DSY - Derivative Relative To Y + + Alias for DDY. + + +1.17.8 TEXLDD - Texture Lookup with Derivatives + + Alias for TXD. + + +1.18 vs_1_1 +------------ + + +1.18.1 EXPP - Approximate Exponential Base 2 + + Use EXP. See also 1.19.3. + + +1.18.2 LOGP - Logarithm Base 2 + + Use LOG. See also 1.19.4. + + +1.19 vs_2_0 +------------ + + +1.19.1 SGN - Set Sign + + Alias for SSG. + + +1.19.2 MOVA - Move Address Register + + Alias for ARR. + + +1.19.3 EXPP - Approximate Exponential Base 2 + + Use EX2. + + +1.19.4 LOGP - Logarithm Base 2 + + Use LG2. + + +2 Explanation of symbols used +============================== + + +2.1 Functions +-------------- + + + abs(x) Absolute value of x. + '|x|' + (x < 0.0) ? -x : x + + ceil(x) Ceiling of x. + + clamp(x,y,z) Clamp x between y and z. + (x < y) ? y : (x > z) ? z : x + + cos(x) Cosine of x. + + floor(x) Floor of x. + + lg2(x) Logarithm base 2 of x. + + max(x,y) Maximum of x and y. + (x > y) ? x : y + + min(x,y) Minimum of x and y. + (x < y) ? x : y + + partialx(x) Derivative of x relative to fragment's X. + + partialy(x) Derivative of x relative to fragment's Y. + + pop() Pop from stack. + + pow(x,y) Raise x to power of y. + + push(x) Push x on stack. + + round(x) Round x. + + sin(x) Sine of x. + + sqrt(x) Square root of x. + + trunc(x) Truncate x. + + +2.2 Keywords +------------- + + + discard Discard fragment. + + dst First destination register. + + dst0 First destination register. + + pc Program counter. + + src First source register. + + src0 First source register. + + src1 Second source register. + + src2 Third source register. + + target Label of target instruction. + + +3 Other tokens +=============== + + +3.1 Declaration Semantic +------------------------- + + + Follows Declaration token if Semantic bit is set. + + Since its purpose is to link a shader with other stages of the pipeline, + it is valid to follow only those Declaration tokens that declare a register + either in INPUT or OUTPUT file. + + SemanticName field contains the semantic name of the register being declared. + There is no default value. + + SemanticIndex is an optional subscript that can be used to distinguish + different register declarations with the same semantic name. The default value + is 0. + + The meanings of the individual semantic names are explained in the following + sections. + + +3.1.1 FACE + + Valid only in a fragment shader INPUT declaration. + + FACE.x is negative when the primitive is back facing. FACE.x is positive + when the primitive is front facing. -- cgit v1.2.3 From 14eacb041b174fee75de7c14a81bd333a3fd2797 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 21 Dec 2009 23:38:29 +0000 Subject: docs: remove some old opcodes and other cruft from tgsi doc --- src/gallium/docs/source/tgsi.rst | 322 ++++----------------------------------- 1 file changed, 27 insertions(+), 295 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 30717bdf7b..a30729073b 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -155,10 +155,6 @@ TGSI Instruction Specification dst.w = src0.w * src1.w + src2.w -1.2 GL_ATI_fragment_shader ---------------------------- - - 1.2.1 SUB - Subtract dst.x = src0.x - src1.x @@ -167,17 +163,7 @@ TGSI Instruction Specification dst.w = src0.w - src1.w -1.2.2 DOT3 - 3-component Dot Product - - Alias for DP3. - - -1.2.3 DOT4 - 4-component Dot Product - - Alias for DP4. - - -1.2.4 LERP - Linear Interpolate +1.2.4 LRP - Linear Interpolate dst.x = src0.x * (src1.x - src2.x) + src2.x dst.y = src0.y * (src1.y - src2.y) + src2.y @@ -193,11 +179,7 @@ TGSI Instruction Specification dst.w = (src2.w > 0.5) ? src0.w : src1.w -1.2.6 CND0 - Condition Zero - - Removed. Use (CMP src2, src1, src0) instead. - -1.2.7 DOT2ADD - 2-component Dot Product And Add +1.2.7 DP2A - 2-component Dot Product And Add dst.x = src0.x * src1.x + src0.y * src1.y + src2.x dst.y = src0.x * src1.x + src0.y * src1.y + src2.x @@ -205,25 +187,6 @@ TGSI Instruction Specification dst.w = src0.x * src1.x + src0.y * src1.y + src2.x -1.3 GL_EXT_vertex_shader -------------------------- - - -1.3.1 INDEX - Array Lookup - - Considered for removal from language. - - -1.3.2 NEGATE - Negate - - Considered for removal from language. - - -1.3.3 MADD - Multiply And Add - - Alias for MAD. - - 1.3.4 FRAC - Fraction dst.x = src.x - floor(src.x) @@ -232,16 +195,6 @@ TGSI Instruction Specification dst.w = src.w - floor(src.w) -1.3.5 SETGE - Set On Greater Equal - - Alias for SGE. - - -1.3.6 SETLT - Set On Less Than - - Alias for SLT. - - 1.3.7 CLAMP - Clamp dst.x = clamp(src0.x, src1.x, src2.x) @@ -250,7 +203,7 @@ TGSI Instruction Specification dst.w = clamp(src0.w, src1.w, src2.w) -1.3.8 FLOOR - Floor +1.3.8 FLR - Floor dst.x = floor(src.x) dst.y = floor(src.y) @@ -266,7 +219,7 @@ TGSI Instruction Specification dst.w = round(src.w) -1.3.10 EXPBASE2 - Exponential Base 2 +1.3.10 EX2 - Exponential Base 2 dst.x = pow(2.0, src.x) dst.y = pow(2.0, src.x) @@ -274,7 +227,7 @@ TGSI Instruction Specification dst.w = pow(2.0, src.x) -1.3.11 LOGBASE2 - Logarithm Base 2 +1.3.11 LG2 - Logarithm Base 2 dst.x = lg2(src.x) dst.y = lg2(src.x) @@ -282,25 +235,14 @@ TGSI Instruction Specification dst.w = lg2(src.x) -1.3.12 POWER - Power +1.3.12 POW - Power dst.x = pow(src0.x, src1.x) dst.y = pow(src0.x, src1.x) dst.z = pow(src0.x, src1.x) dst.w = pow(src0.x, src1.x) - -1.3.13 RECIP - Reciprocal - - Alias for RCP. - - -1.3.14 RECIPSQRT - Reciprocal Square Root - - Alias for RSQ. - - -1.3.15 CROSSPRODUCT - Cross Product +1.3.15 XPD - Cross Product dst.x = src0.y * src1.z - src1.y * src0.z dst.y = src0.z * src1.x - src1.z * src0.x @@ -308,15 +250,6 @@ TGSI Instruction Specification dst.w = 1.0 -1.3.16 MULTIPLYMATRIX - Multiply Matrix - - Considered for removal from language. - - -1.4 GL_NV_vertex_program1_1 ----------------------------- - - 1.4.1 ABS - Absolute dst.x = abs(src.x) @@ -341,10 +274,6 @@ TGSI Instruction Specification dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w -1.5 GL_NV_fragment_program ---------------------------- - - 1.5.1 COS - Cosine dst.x = cos(src.x) @@ -369,36 +298,11 @@ TGSI Instruction Specification dst.w = partialy(src.w) -1.5.4 EX2 - Exponential Base 2 - - Alias for EXPBASE2. - - -1.5.5 FLR - Floor - - Alias for FLOOR. - - -1.5.6 FRC - Fraction - - Alias for FRAC. - - 1.5.7 KILP - Predicated Discard discard -1.5.8 LG2 - Logarithm Base 2 - - Alias for LOGBASE2. - - -1.5.9 LRP - Linear Interpolate - - Alias for LERP. - - 1.5.10 PK2H - Pack Two 16-bit Floats TBD @@ -419,11 +323,6 @@ TGSI Instruction Specification TBD -1.5.14 POW - Power - - Alias for POWER. - - 1.5.15 RFL - Reflection Vector dst.x = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.x - src1.x @@ -431,6 +330,8 @@ TGSI Instruction Specification dst.z = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.z - src1.z dst.w = 1.0 + Considered for removal. + 1.5.16 SEQ - Set On Equal @@ -447,6 +348,7 @@ TGSI Instruction Specification dst.z = 0.0 dst.w = 0.0 + Considered for removal. 1.5.18 SGT - Set On Greater Than @@ -507,21 +409,25 @@ TGSI Instruction Specification TBD + Considered for removal. 1.5.27 UP2US - Unpack Two Unsigned 16-Bit Scalars TBD + Considered for removal. 1.5.28 UP4B - Unpack Four Signed 8-Bit Values TBD + Considered for removal. 1.5.29 UP4UB - Unpack Four Unsigned 8-Bit Scalars TBD + Considered for removal. 1.5.30 X2D - 2D Coordinate Transformation @@ -530,6 +436,8 @@ TGSI Instruction Specification dst.z = src0.x + src1.x * src2.x + src1.y * src2.y dst.w = src0.y + src1.x * src2.z + src1.y * src2.w + Considered for removal. + 1.6 GL_NV_vertex_program2 -------------------------- @@ -539,6 +447,7 @@ TGSI Instruction Specification TBD + Considered for removal. 1.6.2 ARR - Address Register Load With Round @@ -552,6 +461,7 @@ TGSI Instruction Specification pc = target + Considered for removal. 1.6.4 CAL - Subroutine Call @@ -563,6 +473,8 @@ TGSI Instruction Specification pc = pop() + Potential restrictions: + * Only occurs at end of function. 1.6.6 SSG - Set Sign @@ -572,27 +484,6 @@ TGSI Instruction Specification dst.w = (src.w > 0.0) ? 1.0 : (src.w < 0.0) ? -1.0 : 0.0 -1.7 GL_ARB_vertex_program --------------------------- - - -1.7.1 SWZ - Extended Swizzle - - dst.x = src.x - dst.y = src.y - dst.z = src.z - dst.w = src.w - - -1.7.2 XPD - Cross Product - - Alias for CROSSPRODUCT. - - -1.8 GL_ARB_fragment_program ----------------------------- - - 1.8.1 CMP - Compare dst.x = (src0.x < 0.0) ? src1.x : src2.x @@ -621,10 +512,6 @@ TGSI Instruction Specification TBD -1.9 GL_NV_fragment_program2 ----------------------------- - - 1.9.1 NRM - 3-component Vector Normalise dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z) @@ -649,11 +536,6 @@ TGSI Instruction Specification dst.w = src0.x * src1.x + src0.y * src1.y -1.9.4 DP2A - 2-component Dot Product And Add - - Alias for DOT2ADD. - - 1.9.5 TXL - Texture Lookup With LOD TBD @@ -682,6 +564,8 @@ TGSI Instruction Specification Note: The destination must be a loop register. The source must be a constant register. + Considered for cleanup / removal. + 1.9.9 REP - Repeat @@ -709,16 +593,13 @@ TGSI Instruction Specification Note: The destination must be a loop register. + Considered for cleanup / removal. 1.9.13 ENDREP - End Repeat TBD -1.10 GL_NV_vertex_program3 ---------------------------- - - 1.10.1 PUSHA - Push Address Register On Stack push(src.x) @@ -726,6 +607,7 @@ TGSI Instruction Specification push(src.z) push(src.w) + Considered for cleanup / removal. 1.10.2 POPA - Pop Address Register From Stack @@ -734,10 +616,13 @@ TGSI Instruction Specification dst.y = pop() dst.x = pop() + Considered for cleanup / removal. + 1.11 GL_NV_gpu_program4 ------------------------ +Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.1 CEIL - Ceiling @@ -880,87 +765,12 @@ TGSI Instruction Specification TBD -1.13.5 INT - Truncate - - Alias for TRUNC. - - -1.13.6 NOISE1 - 1D Noise - - TBD - - -1.13.7 NOISE2 - 2D Noise - - TBD - - -1.13.8 NOISE3 - 3D Noise - - TBD - - -1.13.9 NOISE4 - 4D Noise - - TBD - 1.13.10 NOP - No Operation Do nothing. -1.14 ps_1_1 ------------- - - -1.14.1 TEXKILL - Conditional Discard - - Alias for KIL. - - -1.15 ps_1_4 ------------- - - -1.15.1 TEXLD - Texture Lookup - - Alias for TEX. - - -1.16 ps_2_0 ------------- - - -1.16.1 M4X4 - Multiply Matrix - - Alias for MULTIPLYMATRIX. - - -1.16.2 M4X3 - Multiply Matrix - - Considered for removal from language. - - -1.16.3 M3X4 - Multiply Matrix - - Considered for removal from language. - - -1.16.4 M3X3 - Multiply Matrix - - Considered for removal from language. - - -1.16.5 M3X2 - Multiply Matrix - - Considered for removal from language. - - -1.16.6 CRS - Cross Product - - Alias for XPD. - 1.16.7 NRM4 - 4-component Vector Normalise @@ -970,30 +780,10 @@ TGSI Instruction Specification dst.w = src.w / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) -1.16.8 SINCOS - Sine Cosine - - Alias for SCS. - - -1.16.9 TEXLDB - Texture Lookup With Bias - - Alias for TXB. - - -1.16.10 DP2ADD - 2-component Dot Product And Add - - Alias for DP2A. - - 1.17 ps_2_x ------------ -1.17.1 CALL - Subroutine Call - - Alias for CAL. - - 1.17.2 CALLNZ - Subroutine Call If Not Zero TBD @@ -1004,69 +794,11 @@ TGSI Instruction Specification TBD -1.17.4 BREAK - Break - - Alias for BRK. - - 1.17.5 BREAKC - Break Conditional TBD -1.17.6 DSX - Derivative Relative To X - - Alias for DDX. - - -1.17.7 DSY - Derivative Relative To Y - - Alias for DDY. - - -1.17.8 TEXLDD - Texture Lookup with Derivatives - - Alias for TXD. - - -1.18 vs_1_1 ------------- - - -1.18.1 EXPP - Approximate Exponential Base 2 - - Use EXP. See also 1.19.3. - - -1.18.2 LOGP - Logarithm Base 2 - - Use LOG. See also 1.19.4. - - -1.19 vs_2_0 ------------- - - -1.19.1 SGN - Set Sign - - Alias for SSG. - - -1.19.2 MOVA - Move Address Register - - Alias for ARR. - - -1.19.3 EXPP - Approximate Exponential Base 2 - - Use EX2. - - -1.19.4 LOGP - Logarithm Base 2 - - Use LG2. - - 2 Explanation of symbols used ============================== -- cgit v1.2.3 From e8ed3b9607952bb3a8e2756f6f78ae6ccc6e7e05 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 21 Dec 2009 19:12:55 -0800 Subject: docs: Start mathifying TGSI insts. --- src/gallium/docs/source/conf.py | 2 +- src/gallium/docs/source/tgsi.rst | 260 +++++++++++++++++++++++++++++++++------ 2 files changed, 224 insertions(+), 38 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/conf.py b/src/gallium/docs/source/conf.py index 2b974b727c..9b0c86babd 100644 --- a/src/gallium/docs/source/conf.py +++ b/src/gallium/docs/source/conf.py @@ -22,7 +22,7 @@ import sys, os # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [] +extensions = ['sphinx.ext.pngmath'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index a30729073b..1df0e98a41 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -6,196 +6,299 @@ for describing shaders. Since Gallium is inherently shaderful, shaders are an important part of the API. TGSI is the only intermediate representation used by all drivers. - -TGSI Instruction Specification -============================== - - -1 Instruction Set Operations -============================= - - -1.1 GL_NV_vertex_program +From GL_NV_vertex_program ------------------------- -1.1.1 ARL - Address Register Load +ARL - Address Register Load + +.. math:: dst.x = floor(src.x) + dst.y = floor(src.y) + dst.z = floor(src.z) + dst.w = floor(src.w) -1.1.2 MOV - Move +MOV - Move + +.. math:: dst.x = src.x + dst.y = src.y + dst.z = src.z + dst.w = src.w -1.1.3 LIT - Light Coefficients +LIT - Light Coefficients + +.. math:: dst.x = 1.0 + dst.y = max(src.x, 0.0) + dst.z = (src.x > 0.0) ? pow(max(src.y, 0.0), clamp(src.w, -128.0, 128.0)) : 0.0 + dst.w = 1.0 -1.1.4 RCP - Reciprocal +RCP - Reciprocal + +.. math:: dst.x = 1.0 / src.x + dst.y = 1.0 / src.x + dst.z = 1.0 / src.x + dst.w = 1.0 / src.x -1.1.5 RSQ - Reciprocal Square Root +RSQ - Reciprocal Square Root + +.. math:: dst.x = 1.0 / sqrt(abs(src.x)) + dst.y = 1.0 / sqrt(abs(src.x)) + dst.z = 1.0 / sqrt(abs(src.x)) + dst.w = 1.0 / sqrt(abs(src.x)) -1.1.6 EXP - Approximate Exponential Base 2 +EXP - Approximate Exponential Base 2 + +.. math:: dst.x = pow(2.0, floor(src.x)) + dst.y = src.x - floor(src.x) + dst.z = pow(2.0, src.x) + dst.w = 1.0 -1.1.7 LOG - Approximate Logarithm Base 2 +LOG - Approximate Logarithm Base 2 + +.. math:: dst.x = floor(lg2(abs(src.x))) + dst.y = abs(src.x) / pow(2.0, floor(lg2(abs(src.x)))) + dst.z = lg2(abs(src.x)) + dst.w = 1.0 -1.1.8 MUL - Multiply +MUL - Multiply + +.. math:: dst.x = src0.x * src1.x + dst.y = src0.y * src1.y + dst.z = src0.z * src1.z + dst.w = src0.w * src1.w -1.1.9 ADD - Add +ADD - Add + +.. math:: dst.x = src0.x + src1.x + dst.y = src0.y + src1.y + dst.z = src0.z + src1.z + dst.w = src0.w + src1.w -1.1.10 DP3 - 3-component Dot Product +DP3 - 3-component Dot Product + +.. math:: dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z -1.1.11 DP4 - 4-component Dot Product +DP4 - 4-component Dot Product + +.. math:: dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w -1.1.12 DST - Distance Vector +DST - Distance Vector + +.. math:: dst.x = 1.0 + dst.y = src0.y * src1.y + dst.z = src0.z + dst.w = src1.w -1.1.13 MIN - Minimum +MIN - Minimum + +.. math:: dst.x = min(src0.x, src1.x) + dst.y = min(src0.y, src1.y) + dst.z = min(src0.z, src1.z) + dst.w = min(src0.w, src1.w) -1.1.14 MAX - Maximum +MAX - Maximum + +.. math:: dst.x = max(src0.x, src1.x) + dst.y = max(src0.y, src1.y) + dst.z = max(src0.z, src1.z) + dst.w = max(src0.w, src1.w) -1.1.15 SLT - Set On Less Than +SLT - Set On Less Than + +.. math:: dst.x = (src0.x < src1.x) ? 1.0 : 0.0 + dst.y = (src0.y < src1.y) ? 1.0 : 0.0 + dst.z = (src0.z < src1.z) ? 1.0 : 0.0 + dst.w = (src0.w < src1.w) ? 1.0 : 0.0 -1.1.16 SGE - Set On Greater Equal Than +SGE - Set On Greater Equal Than + +.. math:: dst.x = (src0.x >= src1.x) ? 1.0 : 0.0 + dst.y = (src0.y >= src1.y) ? 1.0 : 0.0 + dst.z = (src0.z >= src1.z) ? 1.0 : 0.0 + dst.w = (src0.w >= src1.w) ? 1.0 : 0.0 -1.1.17 MAD - Multiply And Add +MAD - Multiply And Add + +.. math:: dst.x = src0.x * src1.x + src2.x + dst.y = src0.y * src1.y + src2.y + dst.z = src0.z * src1.z + src2.z + dst.w = src0.w * src1.w + src2.w -1.2.1 SUB - Subtract +SUB - Subtract + +.. math:: dst.x = src0.x - src1.x + dst.y = src0.y - src1.y + dst.z = src0.z - src1.z + dst.w = src0.w - src1.w -1.2.4 LRP - Linear Interpolate +LRP - Linear Interpolate + +.. math:: dst.x = src0.x * (src1.x - src2.x) + src2.x + dst.y = src0.y * (src1.y - src2.y) + src2.y + dst.z = src0.z * (src1.z - src2.z) + src2.z + dst.w = src0.w * (src1.w - src2.w) + src2.w -1.2.5 CND - Condition +CND - Condition + +.. math:: dst.x = (src2.x > 0.5) ? src0.x : src1.x + dst.y = (src2.y > 0.5) ? src0.y : src1.y + dst.z = (src2.z > 0.5) ? src0.z : src1.z + dst.w = (src2.w > 0.5) ? src0.w : src1.w -1.2.7 DP2A - 2-component Dot Product And Add +DP2A - 2-component Dot Product And Add + +.. math:: dst.x = src0.x * src1.x + src0.y * src1.y + src2.x + dst.y = src0.x * src1.x + src0.y * src1.y + src2.x + dst.z = src0.x * src1.x + src0.y * src1.y + src2.x + dst.w = src0.x * src1.x + src0.y * src1.y + src2.x -1.3.4 FRAC - Fraction +FRAC - Fraction + +.. math:: dst.x = src.x - floor(src.x) + dst.y = src.y - floor(src.y) + dst.z = src.z - floor(src.z) + dst.w = src.w - floor(src.w) -1.3.7 CLAMP - Clamp +CLAMP - Clamp + +.. math:: dst.x = clamp(src0.x, src1.x, src2.x) dst.y = clamp(src0.y, src1.y, src2.y) @@ -205,6 +308,8 @@ TGSI Instruction Specification 1.3.8 FLR - Floor +.. math:: + dst.x = floor(src.x) dst.y = floor(src.y) dst.z = floor(src.z) @@ -213,6 +318,8 @@ TGSI Instruction Specification 1.3.9 ROUND - Round +.. math:: + dst.x = round(src.x) dst.y = round(src.y) dst.z = round(src.z) @@ -221,6 +328,8 @@ TGSI Instruction Specification 1.3.10 EX2 - Exponential Base 2 +.. math:: + dst.x = pow(2.0, src.x) dst.y = pow(2.0, src.x) dst.z = pow(2.0, src.x) @@ -229,6 +338,8 @@ TGSI Instruction Specification 1.3.11 LG2 - Logarithm Base 2 +.. math:: + dst.x = lg2(src.x) dst.y = lg2(src.x) dst.z = lg2(src.x) @@ -237,6 +348,8 @@ TGSI Instruction Specification 1.3.12 POW - Power +.. math:: + dst.x = pow(src0.x, src1.x) dst.y = pow(src0.x, src1.x) dst.z = pow(src0.x, src1.x) @@ -244,6 +357,8 @@ TGSI Instruction Specification 1.3.15 XPD - Cross Product +.. math:: + dst.x = src0.y * src1.z - src1.y * src0.z dst.y = src0.z * src1.x - src1.z * src0.x dst.z = src0.x * src1.y - src1.x * src0.y @@ -252,6 +367,8 @@ TGSI Instruction Specification 1.4.1 ABS - Absolute +.. math:: + dst.x = abs(src.x) dst.y = abs(src.y) dst.z = abs(src.z) @@ -260,6 +377,8 @@ TGSI Instruction Specification 1.4.2 RCC - Reciprocal Clamped +.. math:: + dst.x = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) dst.y = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) dst.z = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) @@ -268,6 +387,8 @@ TGSI Instruction Specification 1.4.3 DPH - Homogeneous Dot Product +.. math:: + dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w @@ -276,6 +397,8 @@ TGSI Instruction Specification 1.5.1 COS - Cosine +.. math:: + dst.x = cos(src.x) dst.y = cos(src.x) dst.z = cos(src.x) @@ -284,6 +407,8 @@ TGSI Instruction Specification 1.5.2 DDX - Derivative Relative To X +.. math:: + dst.x = partialx(src.x) dst.y = partialx(src.y) dst.z = partialx(src.z) @@ -292,6 +417,8 @@ TGSI Instruction Specification 1.5.3 DDY - Derivative Relative To Y +.. math:: + dst.x = partialy(src.x) dst.y = partialy(src.y) dst.z = partialy(src.z) @@ -300,6 +427,8 @@ TGSI Instruction Specification 1.5.7 KILP - Predicated Discard +.. math:: + discard @@ -325,16 +454,20 @@ TGSI Instruction Specification 1.5.15 RFL - Reflection Vector +.. math:: + dst.x = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.x - src1.x dst.y = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.y - src1.y dst.z = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.z - src1.z dst.w = 1.0 - Considered for removal. +Considered for removal. 1.5.16 SEQ - Set On Equal +.. math:: + dst.x = (src0.x == src1.x) ? 1.0 : 0.0 dst.y = (src0.y == src1.y) ? 1.0 : 0.0 dst.z = (src0.z == src1.z) ? 1.0 : 0.0 @@ -343,15 +476,19 @@ TGSI Instruction Specification 1.5.17 SFL - Set On False +.. math:: + dst.x = 0.0 dst.y = 0.0 dst.z = 0.0 dst.w = 0.0 - Considered for removal. +Considered for removal. 1.5.18 SGT - Set On Greater Than +.. math:: + dst.x = (src0.x > src1.x) ? 1.0 : 0.0 dst.y = (src0.y > src1.y) ? 1.0 : 0.0 dst.z = (src0.z > src1.z) ? 1.0 : 0.0 @@ -360,6 +497,8 @@ TGSI Instruction Specification 1.5.19 SIN - Sine +.. math:: + dst.x = sin(src.x) dst.y = sin(src.x) dst.z = sin(src.x) @@ -368,6 +507,8 @@ TGSI Instruction Specification 1.5.20 SLE - Set On Less Equal Than +.. math:: + dst.x = (src0.x <= src1.x) ? 1.0 : 0.0 dst.y = (src0.y <= src1.y) ? 1.0 : 0.0 dst.z = (src0.z <= src1.z) ? 1.0 : 0.0 @@ -376,6 +517,8 @@ TGSI Instruction Specification 1.5.21 SNE - Set On Not Equal +.. math:: + dst.x = (src0.x != src1.x) ? 1.0 : 0.0 dst.y = (src0.y != src1.y) ? 1.0 : 0.0 dst.z = (src0.z != src1.z) ? 1.0 : 0.0 @@ -384,6 +527,8 @@ TGSI Instruction Specification 1.5.22 STR - Set On True +.. math:: + dst.x = 1.0 dst.y = 1.0 dst.z = 1.0 @@ -431,12 +576,14 @@ TGSI Instruction Specification 1.5.30 X2D - 2D Coordinate Transformation +.. math:: + dst.x = src0.x + src1.x * src2.x + src1.y * src2.y dst.y = src0.y + src1.x * src2.z + src1.y * src2.w dst.z = src0.x + src1.x * src2.x + src1.y * src2.y dst.w = src0.y + src1.x * src2.z + src1.y * src2.w - Considered for removal. +Considered for removal. 1.6 GL_NV_vertex_program2 @@ -451,6 +598,8 @@ TGSI Instruction Specification 1.6.2 ARR - Address Register Load With Round +.. math:: + dst.x = round(src.x) dst.y = round(src.y) dst.z = round(src.z) @@ -478,6 +627,8 @@ TGSI Instruction Specification 1.6.6 SSG - Set Sign +.. math:: + dst.x = (src.x > 0.0) ? 1.0 : (src.x < 0.0) ? -1.0 : 0.0 dst.y = (src.y > 0.0) ? 1.0 : (src.y < 0.0) ? -1.0 : 0.0 dst.z = (src.z > 0.0) ? 1.0 : (src.z < 0.0) ? -1.0 : 0.0 @@ -486,6 +637,8 @@ TGSI Instruction Specification 1.8.1 CMP - Compare +.. math:: + dst.x = (src0.x < 0.0) ? src1.x : src2.x dst.y = (src0.y < 0.0) ? src1.y : src2.y dst.z = (src0.z < 0.0) ? src1.z : src2.z @@ -494,6 +647,8 @@ TGSI Instruction Specification 1.8.2 KIL - Conditional Discard +.. math:: + if (src.x < 0.0 || src.y < 0.0 || src.z < 0.0 || src.w < 0.0) discard endif @@ -501,6 +656,8 @@ TGSI Instruction Specification 1.8.3 SCS - Sine Cosine +.. math:: + dst.x = cos(src.x) dst.y = sin(src.x) dst.z = 0.0 @@ -514,6 +671,8 @@ TGSI Instruction Specification 1.9.1 NRM - 3-component Vector Normalise +.. math:: + dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z) dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z) dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z) @@ -522,6 +681,8 @@ TGSI Instruction Specification 1.9.2 DIV - Divide +.. math:: + dst.x = src0.x / src1.x dst.y = src0.y / src1.y dst.z = src0.z / src1.z @@ -530,6 +691,8 @@ TGSI Instruction Specification 1.9.3 DP2 - 2-component Dot Product +.. math:: + dst.x = src0.x * src1.x + src0.y * src1.y dst.y = src0.x * src1.x + src0.y * src1.y dst.z = src0.x * src1.x + src0.y * src1.y @@ -626,6 +789,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.1 CEIL - Ceiling +.. math:: + dst.x = ceil(src.x) dst.y = ceil(src.y) dst.z = ceil(src.z) @@ -634,6 +799,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.2 I2F - Integer To Float +.. math:: + dst.x = (float) src.x dst.y = (float) src.y dst.z = (float) src.z @@ -642,6 +809,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.3 NOT - Bitwise Not +.. math:: + dst.x = ~src.x dst.y = ~src.y dst.z = ~src.z @@ -650,6 +819,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.4 TRUNC - Truncate +.. math:: + dst.x = trunc(src.x) dst.y = trunc(src.y) dst.z = trunc(src.z) @@ -658,6 +829,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.5 SHL - Shift Left +.. math:: + dst.x = src0.x << src1.x dst.y = src0.y << src1.x dst.z = src0.z << src1.x @@ -666,6 +839,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.6 SHR - Shift Right +.. math:: + dst.x = src0.x >> src1.x dst.y = src0.y >> src1.x dst.z = src0.z >> src1.x @@ -674,6 +849,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.7 AND - Bitwise And +.. math:: + dst.x = src0.x & src1.x dst.y = src0.y & src1.y dst.z = src0.z & src1.z @@ -682,6 +859,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.8 OR - Bitwise Or +.. math:: + dst.x = src0.x | src1.x dst.y = src0.y | src1.y dst.z = src0.z | src1.z @@ -690,6 +869,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.9 MOD - Modulus +.. math:: + dst.x = src0.x % src1.x dst.y = src0.y % src1.y dst.z = src0.z % src1.z @@ -698,6 +879,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.10 XOR - Bitwise Xor +.. math:: + dst.x = src0.x ^ src1.x dst.y = src0.y ^ src1.y dst.z = src0.z ^ src1.z @@ -706,6 +889,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.11.11 SAD - Sum Of Absolute Differences +.. math:: + dst.x = abs(src0.x - src1.x) + src2.x dst.y = abs(src0.y - src1.y) + src2.y dst.z = abs(src0.z - src1.z) + src2.z @@ -774,6 +959,8 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). 1.16.7 NRM4 - 4-component Vector Normalise +.. math:: + dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) @@ -808,7 +995,6 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). abs(x) Absolute value of x. - '|x|' (x < 0.0) ? -x : x ceil(x) Ceiling of x. -- cgit v1.2.3 From d92a685bc34b22c3514867c39b64e0c724dbeced Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 21 Dec 2009 19:30:29 -0800 Subject: docs: Clean floor, sine, cosine. --- src/gallium/docs/source/tgsi.rst | 80 ++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 35 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 1df0e98a41..4fd9247c49 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -14,13 +14,13 @@ ARL - Address Register Load .. math:: - dst.x = floor(src.x) + dst.x = \lfloor src.x\rfloor - dst.y = floor(src.y) + dst.y = \lfloor src.y\rfloor - dst.z = floor(src.z) + dst.z = \lfloor src.z\rfloor - dst.w = floor(src.w) + dst.w = \lfloor src.w\rfloor MOV - Move @@ -79,9 +79,9 @@ EXP - Approximate Exponential Base 2 .. math:: - dst.x = pow(2.0, floor(src.x)) + dst.x = pow(2.0, \lfloor src.x\rfloor) - dst.y = src.x - floor(src.x) + dst.y = src.x - \lfloor src.x\rfloor dst.z = pow(2.0, src.x) @@ -92,9 +92,9 @@ LOG - Approximate Logarithm Base 2 .. math:: - dst.x = floor(lg2(abs(src.x))) + dst.x = \lfloor lg2(abs(src.x)))\rfloor - dst.y = abs(src.x) / pow(2.0, floor(lg2(abs(src.x)))) + dst.y = abs(src.x) / pow(2.0, \lfloor lg2(abs(src.x))\rfloor ) dst.z = lg2(abs(src.x)) @@ -287,13 +287,13 @@ FRAC - Fraction .. math:: - dst.x = src.x - floor(src.x) + dst.x = src.x - \lfloor src.x\rfloor - dst.y = src.y - floor(src.y) + dst.y = src.y - \lfloor src.y\rfloor - dst.z = src.z - floor(src.z) + dst.z = src.z - \lfloor src.z\rfloor - dst.w = src.w - floor(src.w) + dst.w = src.w - \lfloor src.w\rfloor CLAMP - Clamp @@ -306,14 +306,19 @@ CLAMP - Clamp dst.w = clamp(src0.w, src1.w, src2.w) -1.3.8 FLR - Floor +FLR - Floor + +This is identical to ARL. .. math:: - dst.x = floor(src.x) - dst.y = floor(src.y) - dst.z = floor(src.z) - dst.w = floor(src.w) + dst.x = \lfloor src.x\rfloor + + dst.y = \lfloor src.y\rfloor + + dst.z = \lfloor src.z\rfloor + + dst.w = \lfloor src.w\rfloor 1.3.9 ROUND - Round @@ -395,14 +400,17 @@ CLAMP - Clamp dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w -1.5.1 COS - Cosine +COS - Cosine .. math:: - dst.x = cos(src.x) - dst.y = cos(src.x) - dst.z = cos(src.x) - dst.w = cos(src.w) + dst.x = \cos{src.x} + + dst.y = \cos{src.x} + + dst.z = \cos{src.x} + + dst.w = \cos{src.w} 1.5.2 DDX - Derivative Relative To X @@ -495,14 +503,17 @@ Considered for removal. dst.w = (src0.w > src1.w) ? 1.0 : 0.0 -1.5.19 SIN - Sine +SIN - Sine .. math:: - dst.x = sin(src.x) - dst.y = sin(src.x) - dst.z = sin(src.x) - dst.w = sin(src.w) + dst.x = \sin{src.x} + + dst.y = \sin{src.x} + + dst.z = \sin{src.x} + + dst.w = \sin{src.w} 1.5.20 SLE - Set On Less Equal Than @@ -654,13 +665,16 @@ Considered for removal. endif -1.8.3 SCS - Sine Cosine +SCS - Sine Cosine .. math:: - dst.x = cos(src.x) - dst.y = sin(src.x) + dst.x = \cos{src.x} + + dst.y = \sin{src.x} + dst.z = 0.0 + dst.y = 1.0 @@ -1002,9 +1016,7 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). clamp(x,y,z) Clamp x between y and z. (x < y) ? y : (x > z) ? z : x - cos(x) Cosine of x. - - floor(x) Floor of x. + :math:`\lfloor x\rfloor` Floor of x. lg2(x) Logarithm base 2 of x. @@ -1026,8 +1038,6 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). round(x) Round x. - sin(x) Sine of x. - sqrt(x) Square root of x. trunc(x) Truncate x. -- cgit v1.2.3 From dd801e5c027a832d275e4da665381ce53016ed03 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 21 Dec 2009 19:41:09 -0800 Subject: docs: Pow, sqrt. --- src/gallium/docs/source/tgsi.rst | 48 ++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 4fd9247c49..c62ad6541b 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -44,7 +44,7 @@ LIT - Light Coefficients dst.y = max(src.x, 0.0) - dst.z = (src.x > 0.0) ? pow(max(src.y, 0.0), clamp(src.w, -128.0, 128.0)) : 0.0 + dst.z = (src.x > 0.0) ? max(src.y, 0.0)^{clamp(src.w, -128.0, 128.0))} : 0.0 dst.w = 1.0 @@ -66,24 +66,24 @@ RSQ - Reciprocal Square Root .. math:: - dst.x = 1.0 / sqrt(abs(src.x)) + dst.x = 1.0 / \sqrt{abs(src.x)} - dst.y = 1.0 / sqrt(abs(src.x)) + dst.y = 1.0 / \sqrt{abs(src.x)} - dst.z = 1.0 / sqrt(abs(src.x)) + dst.z = 1.0 / \sqrt{abs(src.x)} - dst.w = 1.0 / sqrt(abs(src.x)) + dst.w = 1.0 / \sqrt{abs(src.x)} EXP - Approximate Exponential Base 2 .. math:: - dst.x = pow(2.0, \lfloor src.x\rfloor) + dst.x = 2^{\lfloor src.x\rfloor} dst.y = src.x - \lfloor src.x\rfloor - dst.z = pow(2.0, src.x) + dst.z = 2^{src.x} dst.w = 1.0 @@ -94,7 +94,7 @@ LOG - Approximate Logarithm Base 2 dst.x = \lfloor lg2(abs(src.x)))\rfloor - dst.y = abs(src.x) / pow(2.0, \lfloor lg2(abs(src.x))\rfloor ) + dst.y = abs(src.x) / 2^{\lfloor lg2(abs(src.x))\rfloor} dst.z = lg2(abs(src.x)) @@ -331,14 +331,17 @@ This is identical to ARL. dst.w = round(src.w) -1.3.10 EX2 - Exponential Base 2 +EX2 - Exponential Base 2 .. math:: - dst.x = pow(2.0, src.x) - dst.y = pow(2.0, src.x) - dst.z = pow(2.0, src.x) - dst.w = pow(2.0, src.x) + dst.x = 2^{src.x} + + dst.y = 2^{src.x} + + dst.z = 2^{src.x} + + dst.w = 2^{src.x} 1.3.11 LG2 - Logarithm Base 2 @@ -351,14 +354,17 @@ This is identical to ARL. dst.w = lg2(src.x) -1.3.12 POW - Power +POW - Power .. math:: - dst.x = pow(src0.x, src1.x) - dst.y = pow(src0.x, src1.x) - dst.z = pow(src0.x, src1.x) - dst.w = pow(src0.x, src1.x) + dst.x = src0.x^{src1.x} + + dst.y = src0.x^{src1.x} + + dst.z = src0.x^{src1.x} + + dst.w = src0.x^{src1.x} 1.3.15 XPD - Cross Product @@ -1016,7 +1022,7 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). clamp(x,y,z) Clamp x between y and z. (x < y) ? y : (x > z) ? z : x - :math:`\lfloor x\rfloor` Floor of x. + :math:`\lfloor x\rfloor` Floor of `x`. lg2(x) Logarithm base 2 of x. @@ -1032,14 +1038,12 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). pop() Pop from stack. - pow(x,y) Raise x to power of y. + :math:`x^y` `x` to the power `y`. push(x) Push x on stack. round(x) Round x. - sqrt(x) Square root of x. - trunc(x) Truncate x. -- cgit v1.2.3 From 14743ac0e32e928f0027f8b8bee2878e1ee59a3d Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 21 Dec 2009 19:57:56 -0800 Subject: docs: abs, lg2, ceil. --- src/gallium/docs/source/tgsi.rst | 83 +++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 36 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index c62ad6541b..f49725295c 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -53,26 +53,26 @@ RCP - Reciprocal .. math:: - dst.x = 1.0 / src.x + dst.x = \frac{1}{src.x} - dst.y = 1.0 / src.x + dst.y = \frac{1}{src.x} - dst.z = 1.0 / src.x + dst.z = \frac{1}{src.x} - dst.w = 1.0 / src.x + dst.w = \frac{1}{src.x} RSQ - Reciprocal Square Root .. math:: - dst.x = 1.0 / \sqrt{abs(src.x)} + dst.x = \frac{1}{\sqrt{|src.x|}} - dst.y = 1.0 / \sqrt{abs(src.x)} + dst.y = \frac{1}{\sqrt{|src.x|}} - dst.z = 1.0 / \sqrt{abs(src.x)} + dst.z = \frac{1}{\sqrt{|src.x|}} - dst.w = 1.0 / \sqrt{abs(src.x)} + dst.w = \frac{1}{\sqrt{|src.x|}} EXP - Approximate Exponential Base 2 @@ -92,13 +92,13 @@ LOG - Approximate Logarithm Base 2 .. math:: - dst.x = \lfloor lg2(abs(src.x)))\rfloor + dst.x = \lfloor\log_2{|src.x|}\rfloor - dst.y = abs(src.x) / 2^{\lfloor lg2(abs(src.x))\rfloor} + dst.y = \frac{|src.x|}{2^{\lfloor\log_2{|src.x|}\rfloor}} - dst.z = lg2(abs(src.x)) + dst.z = \log_2{|src.x|} - dst.w = 1.0 + dst.w = 1 MUL - Multiply @@ -344,14 +344,17 @@ EX2 - Exponential Base 2 dst.w = 2^{src.x} -1.3.11 LG2 - Logarithm Base 2 +LG2 - Logarithm Base 2 .. math:: - dst.x = lg2(src.x) - dst.y = lg2(src.x) - dst.z = lg2(src.x) - dst.w = lg2(src.x) + dst.x = \log_2{src.x} + + dst.y = \log_2{src.x} + + dst.z = \log_2{src.x} + + dst.w = \log_2{src.x} POW - Power @@ -376,14 +379,17 @@ POW - Power dst.w = 1.0 -1.4.1 ABS - Absolute +ABS - Absolute .. math:: - dst.x = abs(src.x) - dst.y = abs(src.y) - dst.z = abs(src.z) - dst.w = abs(src.w) + dst.x = |src.x| + + dst.y = |src.y| + + dst.z = |src.z| + + dst.w = |src.w| 1.4.2 RCC - Reciprocal Clamped @@ -807,14 +813,17 @@ SCS - Sine Cosine Support for these opcodes indicated by a special pipe capability bit (TBD). -1.11.1 CEIL - Ceiling +CEIL - Ceiling .. math:: - dst.x = ceil(src.x) - dst.y = ceil(src.y) - dst.z = ceil(src.z) - dst.w = ceil(src.w) + dst.x = \lceil src.x\rceil + + dst.y = \lceil src.y\rceil + + dst.z = \lceil src.z\rceil + + dst.w = \lceil src.w\rceil 1.11.2 I2F - Integer To Float @@ -907,14 +916,17 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). dst.w = src0.w ^ src1.w -1.11.11 SAD - Sum Of Absolute Differences +SAD - Sum Of Absolute Differences .. math:: - dst.x = abs(src0.x - src1.x) + src2.x - dst.y = abs(src0.y - src1.y) + src2.y - dst.z = abs(src0.z - src1.z) + src2.z - dst.w = abs(src0.w - src1.w) + src2.w + dst.x = |src0.x - src1.x| + src2.x + + dst.y = |src0.y - src1.y| + src2.y + + dst.z = |src0.z - src1.z| + src2.z + + dst.w = |src0.w - src1.w| + src2.w 1.11.12 TXF - Texel Fetch @@ -1014,17 +1026,16 @@ Support for these opcodes indicated by a special pipe capability bit (TBD). -------------- - abs(x) Absolute value of x. - (x < 0.0) ? -x : x + :math:`|x|` Absolute value of `x`. - ceil(x) Ceiling of x. + :math:`\lceil x \rceil` Ceiling of `x`. clamp(x,y,z) Clamp x between y and z. (x < y) ? y : (x > z) ? z : x :math:`\lfloor x\rfloor` Floor of `x`. - lg2(x) Logarithm base 2 of x. + :math:`\log_2{x}` Logarithm of `x`, base 2. max(x,y) Maximum of x and y. (x > y) ? x : y -- cgit v1.2.3 From ecb2f2a230e3c0f16b4bf2197928152d05f805c0 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 21 Dec 2009 20:07:10 -0800 Subject: docs: \times. Yay for sed. --- src/gallium/docs/source/tgsi.rst | 102 +++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index f49725295c..69c29e77d1 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -105,13 +105,13 @@ MUL - Multiply .. math:: - dst.x = src0.x * src1.x + dst.x = src0.x \times src1.x - dst.y = src0.y * src1.y + dst.y = src0.y \times src1.y - dst.z = src0.z * src1.z + dst.z = src0.z \times src1.z - dst.w = src0.w * src1.w + dst.w = src0.w \times src1.w ADD - Add @@ -131,26 +131,26 @@ DP3 - 3-component Dot Product .. math:: - dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.x = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z - dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.y = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z - dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.z = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z - dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + dst.w = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z DP4 - 4-component Dot Product .. math:: - dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.x = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src0.w \times src1.w - dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.y = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src0.w \times src1.w - dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.z = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src0.w \times src1.w - dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src0.w * src1.w + dst.w = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src0.w \times src1.w DST - Distance Vector @@ -159,7 +159,7 @@ DST - Distance Vector dst.x = 1.0 - dst.y = src0.y * src1.y + dst.y = src0.y \times src1.y dst.z = src0.z @@ -222,13 +222,13 @@ MAD - Multiply And Add .. math:: - dst.x = src0.x * src1.x + src2.x + dst.x = src0.x \times src1.x + src2.x - dst.y = src0.y * src1.y + src2.y + dst.y = src0.y \times src1.y + src2.y - dst.z = src0.z * src1.z + src2.z + dst.z = src0.z \times src1.z + src2.z - dst.w = src0.w * src1.w + src2.w + dst.w = src0.w \times src1.w + src2.w SUB - Subtract @@ -248,13 +248,13 @@ LRP - Linear Interpolate .. math:: - dst.x = src0.x * (src1.x - src2.x) + src2.x + dst.x = src0.x \times (src1.x - src2.x) + src2.x - dst.y = src0.y * (src1.y - src2.y) + src2.y + dst.y = src0.y \times (src1.y - src2.y) + src2.y - dst.z = src0.z * (src1.z - src2.z) + src2.z + dst.z = src0.z \times (src1.z - src2.z) + src2.z - dst.w = src0.w * (src1.w - src2.w) + src2.w + dst.w = src0.w \times (src1.w - src2.w) + src2.w CND - Condition @@ -274,13 +274,13 @@ DP2A - 2-component Dot Product And Add .. math:: - dst.x = src0.x * src1.x + src0.y * src1.y + src2.x + dst.x = src0.x \times src1.x + src0.y \times src1.y + src2.x - dst.y = src0.x * src1.x + src0.y * src1.y + src2.x + dst.y = src0.x \times src1.x + src0.y \times src1.y + src2.x - dst.z = src0.x * src1.x + src0.y * src1.y + src2.x + dst.z = src0.x \times src1.x + src0.y \times src1.y + src2.x - dst.w = src0.x * src1.x + src0.y * src1.y + src2.x + dst.w = src0.x \times src1.x + src0.y \times src1.y + src2.x FRAC - Fraction @@ -373,9 +373,9 @@ POW - Power .. math:: - dst.x = src0.y * src1.z - src1.y * src0.z - dst.y = src0.z * src1.x - src1.z * src0.x - dst.z = src0.x * src1.y - src1.x * src0.y + dst.x = src0.y \times src1.z - src1.y \times src0.z + dst.y = src0.z \times src1.x - src1.z \times src0.x + dst.z = src0.x \times src1.y - src1.x \times src0.y dst.w = 1.0 @@ -406,10 +406,10 @@ ABS - Absolute .. math:: - dst.x = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w - dst.y = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w - dst.z = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w - dst.w = src0.x * src1.x + src0.y * src1.y + src0.z * src1.z + src1.w + dst.x = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w + dst.y = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w + dst.z = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w + dst.w = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w COS - Cosine @@ -476,9 +476,9 @@ COS - Cosine .. math:: - dst.x = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.x - src1.x - dst.y = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.y - src1.y - dst.z = 2.0 * (src0.x * src1.x + src0.y * src1.y + src0.z * src1.z) / (src0.x * src0.x + src0.y * src0.y + src0.z * src0.z) * src0.z - src1.z + dst.x = 2.0 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.x - src1.x + dst.y = 2.0 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.y - src1.y + dst.z = 2.0 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.z - src1.z dst.w = 1.0 Considered for removal. @@ -601,10 +601,10 @@ SIN - Sine .. math:: - dst.x = src0.x + src1.x * src2.x + src1.y * src2.y - dst.y = src0.y + src1.x * src2.z + src1.y * src2.w - dst.z = src0.x + src1.x * src2.x + src1.y * src2.y - dst.w = src0.y + src1.x * src2.z + src1.y * src2.w + dst.x = src0.x + src1.x \times src2.x + src1.y \times src2.y + dst.y = src0.y + src1.x \times src2.z + src1.y \times src2.w + dst.z = src0.x + src1.x \times src2.x + src1.y \times src2.y + dst.w = src0.y + src1.x \times src2.z + src1.y \times src2.w Considered for removal. @@ -646,7 +646,7 @@ Considered for removal. pc = pop() Potential restrictions: - * Only occurs at end of function. + \times Only occurs at end of function. 1.6.6 SSG - Set Sign @@ -699,9 +699,9 @@ SCS - Sine Cosine .. math:: - dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z) - dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z) - dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z) + dst.x = src.x / (src.x \times src.x + src.y \times src.y + src.z \times src.z) + dst.y = src.y / (src.x \times src.x + src.y \times src.y + src.z \times src.z) + dst.z = src.z / (src.x \times src.x + src.y \times src.y + src.z \times src.z) dst.w = 1.0 @@ -719,10 +719,10 @@ SCS - Sine Cosine .. math:: - dst.x = src0.x * src1.x + src0.y * src1.y - dst.y = src0.x * src1.x + src0.y * src1.y - dst.z = src0.x * src1.x + src0.y * src1.y - dst.w = src0.x * src1.x + src0.y * src1.y + dst.x = src0.x \times src1.x + src0.y \times src1.y + dst.y = src0.x \times src1.x + src0.y \times src1.y + dst.z = src0.x \times src1.x + src0.y \times src1.y + dst.w = src0.x \times src1.x + src0.y \times src1.y 1.9.5 TXL - Texture Lookup With LOD @@ -993,10 +993,10 @@ SAD - Sum Of Absolute Differences .. math:: - dst.x = src.x / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) - dst.y = src.y / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) - dst.z = src.z / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) - dst.w = src.w / (src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w) + dst.x = src.x / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) + dst.y = src.y / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) + dst.z = src.z / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) + dst.w = src.w / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) 1.17 ps_2_x -- cgit v1.2.3 From da65ac6bba9353aebf9bbd8eeb8bc4c23fc8534a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 21 Dec 2009 20:32:46 -0800 Subject: docs: Moar cleanup. Good enough for now! --- src/gallium/docs/source/tgsi.rst | 389 +++++++++++++++++++++++---------------- 1 file changed, 231 insertions(+), 158 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 69c29e77d1..de27d8a005 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -40,13 +40,13 @@ LIT - Light Coefficients .. math:: - dst.x = 1.0 + dst.x = 1 - dst.y = max(src.x, 0.0) + dst.y = max(src.x, 0) - dst.z = (src.x > 0.0) ? max(src.y, 0.0)^{clamp(src.w, -128.0, 128.0))} : 0.0 + dst.z = (src.x > 0) ? max(src.y, 0)^{clamp(src.w, -128, 128))} : 0 - dst.w = 1.0 + dst.w = 1 RCP - Reciprocal @@ -85,7 +85,7 @@ EXP - Approximate Exponential Base 2 dst.z = 2^{src.x} - dst.w = 1.0 + dst.w = 1 LOG - Approximate Logarithm Base 2 @@ -157,7 +157,7 @@ DST - Distance Vector .. math:: - dst.x = 1.0 + dst.x = 1 dst.y = src0.y \times src1.y @@ -196,26 +196,26 @@ SLT - Set On Less Than .. math:: - dst.x = (src0.x < src1.x) ? 1.0 : 0.0 + dst.x = (src0.x < src1.x) ? 1 : 0 - dst.y = (src0.y < src1.y) ? 1.0 : 0.0 + dst.y = (src0.y < src1.y) ? 1 : 0 - dst.z = (src0.z < src1.z) ? 1.0 : 0.0 + dst.z = (src0.z < src1.z) ? 1 : 0 - dst.w = (src0.w < src1.w) ? 1.0 : 0.0 + dst.w = (src0.w < src1.w) ? 1 : 0 SGE - Set On Greater Equal Than .. math:: - dst.x = (src0.x >= src1.x) ? 1.0 : 0.0 + dst.x = (src0.x >= src1.x) ? 1 : 0 - dst.y = (src0.y >= src1.y) ? 1.0 : 0.0 + dst.y = (src0.y >= src1.y) ? 1 : 0 - dst.z = (src0.z >= src1.z) ? 1.0 : 0.0 + dst.z = (src0.z >= src1.z) ? 1 : 0 - dst.w = (src0.w >= src1.w) ? 1.0 : 0.0 + dst.w = (src0.w >= src1.w) ? 1 : 0 MAD - Multiply And Add @@ -301,8 +301,11 @@ CLAMP - Clamp .. math:: dst.x = clamp(src0.x, src1.x, src2.x) + dst.y = clamp(src0.y, src1.y, src2.y) + dst.z = clamp(src0.z, src1.z, src2.z) + dst.w = clamp(src0.w, src1.w, src2.w) @@ -321,13 +324,16 @@ This is identical to ARL. dst.w = \lfloor src.w\rfloor -1.3.9 ROUND - Round +ROUND - Round .. math:: dst.x = round(src.x) + dst.y = round(src.y) + dst.z = round(src.z) + dst.w = round(src.w) @@ -369,14 +375,17 @@ POW - Power dst.w = src0.x^{src1.x} -1.3.15 XPD - Cross Product +XPD - Cross Product .. math:: dst.x = src0.y \times src1.z - src1.y \times src0.z + dst.y = src0.z \times src1.x - src1.z \times src0.x + dst.z = src0.x \times src1.y - src1.x \times src0.y - dst.w = 1.0 + + dst.w = 1 ABS - Absolute @@ -392,23 +401,31 @@ ABS - Absolute dst.w = |src.w| -1.4.2 RCC - Reciprocal Clamped +RCC - Reciprocal Clamped + +XXX cleanup on aisle three .. math:: - dst.x = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) - dst.y = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) - dst.z = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) - dst.w = (1.0 / src.x) > 0.0 ? clamp(1.0 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1.0 / src.x, -1.884467e+019, -5.42101e-020) + dst.x = (1 / src.x) > 0 ? clamp(1 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1 / src.x, -1.884467e+019, -5.42101e-020) + + dst.y = (1 / src.x) > 0 ? clamp(1 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1 / src.x, -1.884467e+019, -5.42101e-020) + + dst.z = (1 / src.x) > 0 ? clamp(1 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1 / src.x, -1.884467e+019, -5.42101e-020) + + dst.w = (1 / src.x) > 0 ? clamp(1 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1 / src.x, -1.884467e+019, -5.42101e-020) -1.4.3 DPH - Homogeneous Dot Product +DPH - Homogeneous Dot Product .. math:: dst.x = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w + dst.y = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w + dst.z = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w + dst.w = src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z + src1.w @@ -425,94 +442,101 @@ COS - Cosine dst.w = \cos{src.w} -1.5.2 DDX - Derivative Relative To X +DDX - Derivative Relative To X .. math:: dst.x = partialx(src.x) + dst.y = partialx(src.y) + dst.z = partialx(src.z) + dst.w = partialx(src.w) -1.5.3 DDY - Derivative Relative To Y +DDY - Derivative Relative To Y .. math:: dst.x = partialy(src.x) + dst.y = partialy(src.y) + dst.z = partialy(src.z) - dst.w = partialy(src.w) + dst.w = partialy(src.w) -1.5.7 KILP - Predicated Discard -.. math:: +KILP - Predicated Discard discard -1.5.10 PK2H - Pack Two 16-bit Floats +PK2H - Pack Two 16-bit Floats TBD -1.5.11 PK2US - Pack Two Unsigned 16-bit Scalars +PK2US - Pack Two Unsigned 16-bit Scalars TBD -1.5.12 PK4B - Pack Four Signed 8-bit Scalars +PK4B - Pack Four Signed 8-bit Scalars TBD -1.5.13 PK4UB - Pack Four Unsigned 8-bit Scalars +PK4UB - Pack Four Unsigned 8-bit Scalars TBD -1.5.15 RFL - Reflection Vector +RFL - Reflection Vector .. math:: - dst.x = 2.0 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.x - src1.x - dst.y = 2.0 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.y - src1.y - dst.z = 2.0 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.z - src1.z - dst.w = 1.0 + dst.x = 2 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.x - src1.x + + dst.y = 2 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.y - src1.y + + dst.z = 2 \times (src0.x \times src1.x + src0.y \times src1.y + src0.z \times src1.z) / (src0.x \times src0.x + src0.y \times src0.y + src0.z \times src0.z) \times src0.z - src1.z + + dst.w = 1 Considered for removal. -1.5.16 SEQ - Set On Equal +SEQ - Set On Equal .. math:: - dst.x = (src0.x == src1.x) ? 1.0 : 0.0 - dst.y = (src0.y == src1.y) ? 1.0 : 0.0 - dst.z = (src0.z == src1.z) ? 1.0 : 0.0 - dst.w = (src0.w == src1.w) ? 1.0 : 0.0 + dst.x = (src0.x == src1.x) ? 1 : 0 + dst.y = (src0.y == src1.y) ? 1 : 0 + dst.z = (src0.z == src1.z) ? 1 : 0 + dst.w = (src0.w == src1.w) ? 1 : 0 -1.5.17 SFL - Set On False +SFL - Set On False .. math:: - dst.x = 0.0 - dst.y = 0.0 - dst.z = 0.0 - dst.w = 0.0 + dst.x = 0 + dst.y = 0 + dst.z = 0 + dst.w = 0 Considered for removal. -1.5.18 SGT - Set On Greater Than +SGT - Set On Greater Than .. math:: - dst.x = (src0.x > src1.x) ? 1.0 : 0.0 - dst.y = (src0.y > src1.y) ? 1.0 : 0.0 - dst.z = (src0.z > src1.z) ? 1.0 : 0.0 - dst.w = (src0.w > src1.w) ? 1.0 : 0.0 + dst.x = (src0.x > src1.x) ? 1 : 0 + dst.y = (src0.y > src1.y) ? 1 : 0 + dst.z = (src0.z > src1.z) ? 1 : 0 + dst.w = (src0.w > src1.w) ? 1 : 0 SIN - Sine @@ -528,76 +552,76 @@ SIN - Sine dst.w = \sin{src.w} -1.5.20 SLE - Set On Less Equal Than +SLE - Set On Less Equal Than .. math:: - dst.x = (src0.x <= src1.x) ? 1.0 : 0.0 - dst.y = (src0.y <= src1.y) ? 1.0 : 0.0 - dst.z = (src0.z <= src1.z) ? 1.0 : 0.0 - dst.w = (src0.w <= src1.w) ? 1.0 : 0.0 + dst.x = (src0.x <= src1.x) ? 1 : 0 + dst.y = (src0.y <= src1.y) ? 1 : 0 + dst.z = (src0.z <= src1.z) ? 1 : 0 + dst.w = (src0.w <= src1.w) ? 1 : 0 -1.5.21 SNE - Set On Not Equal +SNE - Set On Not Equal .. math:: - dst.x = (src0.x != src1.x) ? 1.0 : 0.0 - dst.y = (src0.y != src1.y) ? 1.0 : 0.0 - dst.z = (src0.z != src1.z) ? 1.0 : 0.0 - dst.w = (src0.w != src1.w) ? 1.0 : 0.0 + dst.x = (src0.x != src1.x) ? 1 : 0 + dst.y = (src0.y != src1.y) ? 1 : 0 + dst.z = (src0.z != src1.z) ? 1 : 0 + dst.w = (src0.w != src1.w) ? 1 : 0 -1.5.22 STR - Set On True +STR - Set On True .. math:: - dst.x = 1.0 - dst.y = 1.0 - dst.z = 1.0 - dst.w = 1.0 + dst.x = 1 + dst.y = 1 + dst.z = 1 + dst.w = 1 -1.5.23 TEX - Texture Lookup +TEX - Texture Lookup TBD -1.5.24 TXD - Texture Lookup with Derivatives +TXD - Texture Lookup with Derivatives TBD -1.5.25 TXP - Projective Texture Lookup +TXP - Projective Texture Lookup TBD -1.5.26 UP2H - Unpack Two 16-Bit Floats +UP2H - Unpack Two 16-Bit Floats TBD Considered for removal. -1.5.27 UP2US - Unpack Two Unsigned 16-Bit Scalars +UP2US - Unpack Two Unsigned 16-Bit Scalars TBD Considered for removal. -1.5.28 UP4B - Unpack Four Signed 8-Bit Values +UP4B - Unpack Four Signed 8-Bit Values TBD Considered for removal. -1.5.29 UP4UB - Unpack Four Unsigned 8-Bit Scalars +UP4UB - Unpack Four Unsigned 8-Bit Scalars TBD Considered for removal. -1.5.30 X2D - 2D Coordinate Transformation +X2D - 2D Coordinate Transformation .. math:: @@ -609,70 +633,79 @@ SIN - Sine Considered for removal. -1.6 GL_NV_vertex_program2 +GL_NV_vertex_program2 -------------------------- -1.6.1 ARA - Address Register Add +ARA - Address Register Add TBD Considered for removal. -1.6.2 ARR - Address Register Load With Round +ARR - Address Register Load With Round .. math:: dst.x = round(src.x) + dst.y = round(src.y) + dst.z = round(src.z) + dst.w = round(src.w) -1.6.3 BRA - Branch +BRA - Branch pc = target Considered for removal. -1.6.4 CAL - Subroutine Call +CAL - Subroutine Call push(pc) pc = target -1.6.5 RET - Subroutine Call Return +RET - Subroutine Call Return pc = pop() Potential restrictions: \times Only occurs at end of function. -1.6.6 SSG - Set Sign +SSG - Set Sign .. math:: - dst.x = (src.x > 0.0) ? 1.0 : (src.x < 0.0) ? -1.0 : 0.0 - dst.y = (src.y > 0.0) ? 1.0 : (src.y < 0.0) ? -1.0 : 0.0 - dst.z = (src.z > 0.0) ? 1.0 : (src.z < 0.0) ? -1.0 : 0.0 - dst.w = (src.w > 0.0) ? 1.0 : (src.w < 0.0) ? -1.0 : 0.0 + dst.x = (src.x > 0) ? 1 : (src.x < 0) ? -1 : 0 + + dst.y = (src.y > 0) ? 1 : (src.y < 0) ? -1 : 0 + dst.z = (src.z > 0) ? 1 : (src.z < 0) ? -1 : 0 -1.8.1 CMP - Compare + dst.w = (src.w > 0) ? 1 : (src.w < 0) ? -1 : 0 + + +CMP - Compare .. math:: - dst.x = (src0.x < 0.0) ? src1.x : src2.x - dst.y = (src0.y < 0.0) ? src1.y : src2.y - dst.z = (src0.z < 0.0) ? src1.z : src2.z - dst.w = (src0.w < 0.0) ? src1.w : src2.w + dst.x = (src0.x < 0) ? src1.x : src2.x + + dst.y = (src0.y < 0) ? src1.y : src2.y + + dst.z = (src0.z < 0) ? src1.z : src2.z + + dst.w = (src0.w < 0) ? src1.w : src2.w -1.8.2 KIL - Conditional Discard +KIL - Conditional Discard .. math:: - if (src.x < 0.0 || src.y < 0.0 || src.z < 0.0 || src.w < 0.0) + if (src.x < 0 || src.y < 0 || src.z < 0 || src.w < 0) discard endif @@ -685,62 +718,71 @@ SCS - Sine Cosine dst.y = \sin{src.x} - dst.z = 0.0 + dst.z = 0 - dst.y = 1.0 + dst.y = 1 -1.8.4 TXB - Texture Lookup With Bias +TXB - Texture Lookup With Bias TBD -1.9.1 NRM - 3-component Vector Normalise +NRM - 3-component Vector Normalise .. math:: dst.x = src.x / (src.x \times src.x + src.y \times src.y + src.z \times src.z) + dst.y = src.y / (src.x \times src.x + src.y \times src.y + src.z \times src.z) + dst.z = src.z / (src.x \times src.x + src.y \times src.y + src.z \times src.z) - dst.w = 1.0 + + dst.w = 1 -1.9.2 DIV - Divide +DIV - Divide .. math:: - dst.x = src0.x / src1.x - dst.y = src0.y / src1.y - dst.z = src0.z / src1.z - dst.w = src0.w / src1.w + dst.x = \frac{src0.x}{src1.x} + + dst.y = \frac{src0.y}{src1.y} + + dst.z = \frac{src0.z}{src1.z} + dst.w = \frac{src0.w}{src1.w} -1.9.3 DP2 - 2-component Dot Product + +DP2 - 2-component Dot Product .. math:: dst.x = src0.x \times src1.x + src0.y \times src1.y + dst.y = src0.x \times src1.x + src0.y \times src1.y + dst.z = src0.x \times src1.x + src0.y \times src1.y + dst.w = src0.x \times src1.x + src0.y \times src1.y -1.9.5 TXL - Texture Lookup With LOD +TXL - Texture Lookup With LOD TBD -1.9.6 BRK - Break +BRK - Break TBD -1.9.7 IF - If +IF - If TBD -1.9.8 BGNFOR - Begin a For-Loop +BGNFOR - Begin a For-Loop dst.x = floor(src.x) dst.y = floor(src.y) @@ -756,22 +798,22 @@ SCS - Sine Cosine Considered for cleanup / removal. -1.9.9 REP - Repeat +REP - Repeat TBD -1.9.10 ELSE - Else +ELSE - Else TBD -1.9.11 ENDIF - End If +ENDIF - End If TBD -1.9.12 ENDFOR - End a For-Loop +ENDFOR - End a For-Loop dst.x = dst.x + dst.z dst.y = dst.y - 1.0 @@ -784,12 +826,12 @@ SCS - Sine Cosine Considered for cleanup / removal. -1.9.13 ENDREP - End Repeat +ENDREP - End Repeat TBD -1.10.1 PUSHA - Push Address Register On Stack +PUSHA - Push Address Register On Stack push(src.x) push(src.y) @@ -798,7 +840,7 @@ SCS - Sine Cosine Considered for cleanup / removal. -1.10.2 POPA - Pop Address Register From Stack +POPA - Pop Address Register From Stack dst.w = pop() dst.z = pop() @@ -808,7 +850,7 @@ SCS - Sine Cosine Considered for cleanup / removal. -1.11 GL_NV_gpu_program4 +GL_NV_gpu_program4 ------------------------ Support for these opcodes indicated by a special pipe capability bit (TBD). @@ -826,93 +868,122 @@ CEIL - Ceiling dst.w = \lceil src.w\rceil -1.11.2 I2F - Integer To Float +I2F - Integer To Float .. math:: dst.x = (float) src.x + dst.y = (float) src.y + dst.z = (float) src.z + dst.w = (float) src.w -1.11.3 NOT - Bitwise Not +NOT - Bitwise Not .. math:: dst.x = ~src.x + dst.y = ~src.y + dst.z = ~src.z + dst.w = ~src.w -1.11.4 TRUNC - Truncate +TRUNC - Truncate + +XXX how is this different from floor? .. math:: dst.x = trunc(src.x) + dst.y = trunc(src.y) + dst.z = trunc(src.z) + dst.w = trunc(src.w) -1.11.5 SHL - Shift Left +SHL - Shift Left .. math:: dst.x = src0.x << src1.x + dst.y = src0.y << src1.x + dst.z = src0.z << src1.x + dst.w = src0.w << src1.x -1.11.6 SHR - Shift Right +SHR - Shift Right .. math:: dst.x = src0.x >> src1.x + dst.y = src0.y >> src1.x + dst.z = src0.z >> src1.x + dst.w = src0.w >> src1.x -1.11.7 AND - Bitwise And +AND - Bitwise And .. math:: dst.x = src0.x & src1.x + dst.y = src0.y & src1.y + dst.z = src0.z & src1.z + dst.w = src0.w & src1.w -1.11.8 OR - Bitwise Or +OR - Bitwise Or .. math:: dst.x = src0.x | src1.x + dst.y = src0.y | src1.y + dst.z = src0.z | src1.z + dst.w = src0.w | src1.w -1.11.9 MOD - Modulus +MOD - Modulus .. math:: - dst.x = src0.x % src1.x - dst.y = src0.y % src1.y - dst.z = src0.z % src1.z - dst.w = src0.w % src1.w + dst.x = src0.x \bmod src1.x + + dst.y = src0.y \bmod src1.y + + dst.z = src0.z \bmod src1.z + dst.w = src0.w \bmod src1.w -1.11.10 XOR - Bitwise Xor + +XOR - Bitwise Xor .. math:: dst.x = src0.x ^ src1.x + dst.y = src0.y ^ src1.y + dst.z = src0.z ^ src1.z + dst.w = src0.w ^ src1.w @@ -929,100 +1000,101 @@ SAD - Sum Of Absolute Differences dst.w = |src0.w - src1.w| + src2.w -1.11.12 TXF - Texel Fetch +TXF - Texel Fetch TBD -1.11.13 TXQ - Texture Size Query +TXQ - Texture Size Query TBD -1.11.14 CONT - Continue +CONT - Continue TBD -1.12 GL_NV_geometry_program4 +GL_NV_geometry_program4 ----------------------------- -1.12.1 EMIT - Emit +EMIT - Emit TBD -1.12.2 ENDPRIM - End Primitive +ENDPRIM - End Primitive TBD -1.13 GLSL +GLSL ---------- -1.13.1 BGNLOOP - Begin a Loop +BGNLOOP - Begin a Loop TBD -1.13.2 BGNSUB - Begin Subroutine +BGNSUB - Begin Subroutine TBD -1.13.3 ENDLOOP - End a Loop +ENDLOOP - End a Loop TBD -1.13.4 ENDSUB - End Subroutine +ENDSUB - End Subroutine TBD -1.13.10 NOP - No Operation +NOP - No Operation - Do nothing. + Do nothing. +NRM4 - 4-component Vector Normalise +.. math:: -1.16.7 NRM4 - 4-component Vector Normalise + dst.x = \frac{src.x}{src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w} -.. math:: + dst.y = \frac{src.y}{src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w} + + dst.z = \frac{src.z}{src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w} - dst.x = src.x / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) - dst.y = src.y / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) - dst.z = src.z / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) - dst.w = src.w / (src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w) + dst.w = \frac{src.w}{src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w} -1.17 ps_2_x +ps_2_x ------------ -1.17.2 CALLNZ - Subroutine Call If Not Zero +CALLNZ - Subroutine Call If Not Zero TBD -1.17.3 IFC - If +IFC - If TBD -1.17.5 BREAKC - Break Conditional +BREAKC - Break Conditional TBD -2 Explanation of symbols used +Explanation of symbols used ============================== -2.1 Functions +Functions -------------- @@ -1058,7 +1130,7 @@ SAD - Sum Of Absolute Differences trunc(x) Truncate x. -2.2 Keywords +Keywords ------------- @@ -1081,11 +1153,11 @@ SAD - Sum Of Absolute Differences target Label of target instruction. -3 Other tokens +Other tokens =============== -3.1 Declaration Semantic +Declaration Semantic ------------------------- @@ -1106,7 +1178,8 @@ SAD - Sum Of Absolute Differences sections. -3.1.1 FACE +FACE +^^^^ Valid only in a fragment shader INPUT declaration. -- cgit v1.2.3 From 5bcd26c1725c5782875d329eb5f5637d4a95dd1f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 21 Dec 2009 21:04:10 -0800 Subject: docs: Re-adjust headers for TGSI, regenerate. --- src/gallium/docs/build/html/_sources/tgsi.txt | 35 ++++++++++---------- src/gallium/docs/build/html/index.html | 18 ++--------- src/gallium/docs/build/html/searchindex.js | 2 +- src/gallium/docs/build/html/tgsi.html | 46 +++++++++++++++------------ src/gallium/docs/source/tgsi.rst | 35 ++++++++++---------- 5 files changed, 68 insertions(+), 68 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/build/html/_sources/tgsi.txt b/src/gallium/docs/build/html/_sources/tgsi.txt index de27d8a005..86c09046f7 100644 --- a/src/gallium/docs/build/html/_sources/tgsi.txt +++ b/src/gallium/docs/build/html/_sources/tgsi.txt @@ -6,8 +6,11 @@ for describing shaders. Since Gallium is inherently shaderful, shaders are an important part of the API. TGSI is the only intermediate representation used by all drivers. +Instruction Set +--------------- + From GL_NV_vertex_program -------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^ ARL - Address Register Load @@ -633,8 +636,8 @@ X2D - 2D Coordinate Transformation Considered for removal. -GL_NV_vertex_program2 --------------------------- +From GL_NV_vertex_program2 +^^^^^^^^^^^^^^^^^^^^^^^^^^ ARA - Address Register Add @@ -850,8 +853,8 @@ POPA - Pop Address Register From Stack Considered for cleanup / removal. -GL_NV_gpu_program4 ------------------------- +From GL_NV_gpu_program4 +^^^^^^^^^^^^^^^^^^^^^^^^ Support for these opcodes indicated by a special pipe capability bit (TBD). @@ -1015,8 +1018,8 @@ CONT - Continue TBD -GL_NV_geometry_program4 ------------------------------ +From GL_NV_geometry_program4 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ EMIT - Emit @@ -1029,8 +1032,8 @@ ENDPRIM - End Primitive TBD -GLSL ----------- +From GLSL +^^^^^^^^^^ BGNLOOP - Begin a Loop @@ -1072,7 +1075,7 @@ NRM4 - 4-component Vector Normalise ps_2_x ------------- +^^^^^^^^^^^^ CALLNZ - Subroutine Call If Not Zero @@ -1091,11 +1094,11 @@ BREAKC - Break Conditional Explanation of symbols used -============================== +------------------------------ Functions --------------- +^^^^^^^^^^^^^^ :math:`|x|` Absolute value of `x`. @@ -1131,7 +1134,7 @@ Functions Keywords -------------- +^^^^^^^^^^^^^ discard Discard fragment. @@ -1154,11 +1157,11 @@ Keywords Other tokens -=============== +--------------- Declaration Semantic -------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^ Follows Declaration token if Semantic bit is set. @@ -1179,7 +1182,7 @@ Declaration Semantic FACE -^^^^ +"""" Valid only in a fragment shader INPUT declaration. diff --git a/src/gallium/docs/build/html/index.html b/src/gallium/docs/build/html/index.html index a01603fe2d..8c059aff45 100644 --- a/src/gallium/docs/build/html/index.html +++ b/src/gallium/docs/build/html/index.html @@ -50,21 +50,9 @@
  • TGSI -
  • -
  • Explanation of symbols used -
  • -
  • Other tokens
  • Screen
      diff --git a/src/gallium/docs/build/html/searchindex.js b/src/gallium/docs/build/html/searchindex.js index a2836ca1a4..c3c0b876ea 100644 --- a/src/gallium/docs/build/html/searchindex.js +++ b/src/gallium/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({desctypes:{},terms:{represent:4,all:[4,9,11],concept:9,edg:2,queri:[4,9],particular:9,four:[4,10],scalar:4,per:5,abil:9,follow:[4,9],depend:5,name:[3,4,9],intermedi:4,ps_2_x:[0,4],those:4,logarithm:4,sourc:[4,9],normalis:4,straightforward:7,fals:4,set_vertex_el:9,lrp:4,fan:5,partialx:4,level:10,pk4b:4,list:6,emul:9,prefilt:10,cosin:4,sine:4,small:9,div:4,round:4,cmp:4,dimens:10,impli:5,flr:4,up4b:4,sign:4,tex:4,second:[4,5,11],pass:[1,11],light_twosid:5,zfail_op:11,index:0,what:[0,7,8],sprite_coord_mod:5,sub:4,compar:4,neg:4,section:[4,9],current:9,delet:9,rgba:[9,10],method:[0,3,9],themselv:5,deriv:4,absolut:4,coeffici:4,inher:4,path:9,vertic:5,modifi:9,sinc:4,valu:[4,9,11],trunc:4,line_stipple_factor:5,search:0,shift:4,vbo:[],shader:[0,1,4,5,6,9,11],permit:[5,9],weird:10,gourard:5,semant:[0,4],txl:4,"boolean":3,txf:4,modul:0,txd:4,sgt:4,textur:[3,4,9,10],src2:4,src0:4,api:[1,4,7,10],brk:4,is_texture_referenc:9,visibl:5,oval:5,sge:4,txq:4,encapsul:7,gl_rasterization_rul:5,from:[0,4,5,9,10],offset_unit:5,subtract:4,regist:4,two:[4,6,9,11],program:4,call:[4,9],get_paramf:3,stage:4,type:6,more:9,desir:1,get_nam:3,raster:[0,1,5,9],pipe_primitive_quad:5,flag:5,indic:[0,4],fill_ccw:5,unpack:4,point_size_min:5,must:4,poly_smooth:5,graphic:[4,7],retriev:9,setup:3,work:1,obvious:5,can:[1,4,3,9],cal:4,purpos:4,root:4,fetch:4,control:[11,8,5,9,10],create_blend_st:9,pipe_surfac:9,templat:3,minimum:[4,5,10],want:9,dp2a:4,unsign:4,occur:4,gl_nv_vertex_program:[0,4],alwai:[11,5,10],point_size_per_vertex:5,multipl:[2,9],divid:4,anoth:9,write:[7,9,11],how:[4,5,9,10],flatshad:[1,5],simpl:9,sin:4,"42101e":[],product:4,sne:4,resourc:9,max:4,after:10,cso:[0,1,9],set_constant_buff:9,mad:4,mai:[5,9],end:4,fail_op:11,pipe_stencil_op:11,principl:1,essenti:7,third:4,bind:9,counter:4,element:5,endprim:4,inform:2,valuemask:11,order:11,rotat:5,over:9,move:[4,9],through:[5,11],sqrt:[],still:5,paramet:3,group:9,directli:9,bypass:5,main:5,easier:9,non:9,"return":[1,4,3],greater:4,thei:[1,11,5,9,10],fragment:[4,8,5,9,11],initi:9,get_vendor:3,"break":4,line_smooth:5,cull_mod:5,front:4,nop:4,introduct:[0,7],"884467e":[],separ:9,token:[0,4,6],each:[5,10],side:11,doxi:10,offset_ccw:5,clamp:[4,10],chunk:5,continu:4,bra:4,frac:4,special:[4,9],out:[1,11,10],variabl:9,dst:4,ret:4,content:0,vector:4,rel:4,hardwar:[7,5,11],got:3,linear:4,offset_cw:5,given:3,compare_func:10,endsub:4,base:4,begin_queri:9,"_rasterizer_st":9,reusabl:1,endrep:4,filter:10,turn:5,get_param:3,clump:11,first:[4,5],oper:[4,9,11],glsl:[0,4],rang:10,max_lod:10,render:[8,9],carri:11,independ:3,restrict:4,clear:9,instruct:4,done:11,size:[4,5],differ:[4,5],stencil:[0,1,9,11],exponenti:4,tradition:11,too:9,circl:5,scheme:9,moar:[3,5],store:11,nrm4:4,min_img_filt:10,option:[4,5,10],pipe_tex_filt:10,specifi:5,create_queri:9,part:[1,4,3],than:4,line_stipple_en:5,target:[4,8],keyword:[0,4],provid:[7,9],remov:4,see:3,structur:11,texel:[4,10],stippl:5,str:4,opaqu:1,posit:4,result:[8,9],pre:5,fashion:7,clip:5,pk4ub:4,ani:[1,9],"_blend_stat":9,bitfield:5,subroutin:4,max_anisotropi:10,txb:4,manner:[3,7],have:[11,5,9,10],tabl:0,need:5,seem:9,"null":9,bitwis:4,techniqu:2,unresolv:8,alias:[2,5],destroi:9,fill_cw:5,note:[1,4,5],ex2:4,take:2,set_viewport_st:9,pipe_func:11,noth:4,singl:9,pipelin:[4,5,9],xor:4,shade:5,normal:10,buffer:[2,8,9,11],object:[1,7,3,9],most:[5,9],sfl:4,mipmap:10,alpha:[0,1,9,11],pipe_primitive_polygon:5,segment:5,tradit:10,pk2h:4,nail:9,tgsi:[0,4],face:4,pipe:4,declar:[0,4],determin:5,pk2u:4,left:4,blend:[0,1,8,9],sum:4,dot:4,end_queri:9,popa:4,destroy_blend_st:9,wrap_:10,dst0:4,trivial:9,access:9,onli:[4,9],dp4:4,dp3:4,dp2:4,front_wind:5,point_sprit:5,should:[8,5],busi:9,endloop:4,lit:4,variou:9,get:3,set_scissor_st:9,stop:9,ceil:4,mul:4,tungsten:4,ssg:4,tgsi_token:6,tbd:4,set_fragment_sampler_textur:9,shr:4,enabl:[5,9,11],draw_el:9,"default":4,statist:9,contain:4,anisotrop:10,shl:4,valid:4,dph:4,arr:4,set:[4,5,9,10],set_framebuffer_st:9,seq:4,smooth:[2,5],ara:4,msaa:[2,5],wrap_t:10,wrap_r:10,fail:11,arl:4,purest:9,modulu:4,project:4,pattern:5,label:4,state:[1,5,8,9,10,11],between:4,"import":[4,5],subscript:4,triplet:9,screen:[0,3],min_mip_filt:10,entir:5,is_buffer_referenc:9,lod_bia:10,addit:9,both:[9,11],last:5,framebuff:9,x2d:4,region:9,equal:4,min_lod:10,context:[0,1,3,9],line_last_pixel:5,mani:10,destroy_queri:9,load:[4,10],undocu:[8,5,10],point:[3,5,9],color:[5,10],pow:4,address:4,pop:4,distinguish:4,callnz:4,reciproc:4,anti:[2,5],provok:5,lg2:4,asdf:[],light:4,endif:4,devic:[3,7,9],three:[4,11],been:11,compon:4,get_query_result:9,treat:10,basic:2,bgnsub:4,up4ub:4,sprite:5,nrm:4,normalized_coord:10,xxx:[3,4,5,8,10,11],coordin:[4,10],zero:4,minifi:10,texture_cr:3,func:11,predic:4,bgnloop:4,sad:4,present:9,multi:2,ident:4,slt:4,servic:7,properti:1,batch:9,rectangular:5,behavior:8,glossari:[2,0],sle:4,loop:4,pack:[4,9],gl_nv_vertex_program2:[0,4],cont:4,set_edgeflag:9,endfor:4,destin:[4,9],unit:10,primit:[4,5],"_vs_state":9,sever:[7,5],set_blend_color:9,surface_fil:9,welcom:0,bind_fragment_sampler_st:9,perform:9,make:9,cross:4,same:[4,9],member:[1,5,6,8,10,11],handl:[1,9],compare_mod:10,instanc:9,zpass_op:11,document:[0,11],difficult:9,finish:9,nest:9,driver:[4,7,9],effect:[1,5,10],mov:4,capabl:4,rais:[],kil:4,stack:4,squar:4,multisampl:5,off:[8,5],center:5,surface_copi:9,min:4,aisl:4,scissor:5,exampl:9,reflect:4,poly_stipple_en:5,thi:[2,4,5,8,9,10],interpol:[4,5],set_clip_st:9,dimension:10,i2f:4,usual:5,explan:[0,4],distanc:4,identifi:3,execut:11,less:4,kilp:4,up2u:4,up2h:4,tcl:5,simpli:5,semanticnam:4,breakc:4,languag:4,begin:4,gl_nv_geometry_program4:[0,4],expos:10,except:5,add:[4,9],cleanup:4,exercis:9,sampler:[0,1,9,10],els:4,mod:4,bypass_vs_clip_and_viewport:[1,5],match:4,pipe_tex_wrap:10,vendor:3,which:[1,7],format:[3,9],read:9,agnost:7,piec:9,bia:[4,10],bgnfor:4,magnifi:10,amp:11,bit:[4,5],truncat:4,apart:9,like:9,specif:[1,3,9,5],integ:[3,4],point_siz:5,src1:4,either:[4,9],output:4,page:0,mag_img_filt:10,refin:10,pipe_primitive_quad_strip:5,right:4,draw_range_el:9,some:[9,10],blend_en:8,pusha:4,opcod:4,sampl:[2,10],flush:9,guarante:9,bore:3,pixel:5,ddy:4,ddx:4,partiali:4,though:9,overlap:9,point_smooth:5,multipli:4,cnd:4,tracker:9,larg:7,select:10,condit:4,txp:4,refer:[11,10],core:[1,7],run:5,rsq:4,border_color:10,ifc:4,"_depth_stencil_alpha_st":9,appli:10,describ:[4,9],writemask:11,src:4,actual:[5,11],gallium:[0,1,4,7,6],semanticindex:4,bind_vertex_sampler_st:9,set_vertex_buff:9,stand:9,awai:5,discard:[4,11],approxim:4,mean:4,disabl:10,"final":[8,9],"float":[3,4],bound:[1,9,10],down:9,explain:4,wrap:10,chang:[5,9],mere:5,flatshade_first:[1,5],log:4,lod:[4,10],support:[4,6],rcp:4,transform:[4,5],xpd:4,avail:9,width:5,set_polygon_stippl:9,interfac:9,fraction:4,individu:[4,10],rcc:4,"function":[0,4,9,11],homogen:4,back:[3,4],set_vertex_sampler_textur:9,point_size_max:5,link:4,blit:9,line:5,"true":4,viewport:5,gl_nv_gpu_program4:[0,4],notat:10,flavour:9,input:4,draw_arrai:9,whether:[11,5,10],wish:5,caller:5,bind_blend_st:9,maximum:[4,5,10],"abstract":9,line_stipple_pattern:5,emit:4,offset_scal:5,gather:9,constant:[1,4],creat:[1,3,9],classic:9,certain:11,dure:11,rfl:4,repres:[3,9],implement:5,file:4,fill:[1,9],polygon:[2,5],floor:4,when:[4,5,9,10],detail:10,power:4,field:4,other:[0,4],lookup:4,futur:9,branch:4,test:[5,11],ref_valu:11,draw:9,repeat:4,exp:4,is_format_support:3,symbol:[0,4],vertex:[5,9],surfac:9,consid:4,receiv:11,blitter:9,algorithm:5,rule:5,pipe_primitive_triangle_fan:5,depth:[2,0,1,9,11],"_fs_state":9,potenti:4,time:[1,4],push:4,line_width:5,rep:4,togeth:11},titles:["Welcome to Gallium’s documentation!","CSO","Glossary","Screen","TGSI","Rasterizer","Shader","Introduction","Blend","Context","Sampler","Depth, Stencil, & Alpha"],modules:{},descrefs:{},filenames:["index","cso","glossary","screen","tgsi","cso/rasterizer","cso/shader","intro","cso/blend","context","cso/sampler","cso/dsa"]}) \ No newline at end of file +Search.setIndex({desctypes:{},terms:{represent:4,all:[4,9,11],concept:9,edg:2,queri:[4,9],particular:9,four:[4,10],scalar:4,per:5,abil:9,follow:[4,9],depend:5,intermedi:4,ps_2_x:4,those:4,logarithm:4,sourc:[4,9],normalis:4,straightforward:7,fals:4,set_vertex_el:9,lrp:4,fan:5,partialx:4,level:10,pk4b:4,list:6,"884467e":[],emul:9,prefilt:10,cosin:4,sine:4,small:9,div:4,round:4,cmp:4,dimens:10,impli:5,flr:4,up4b:4,sign:4,tex:4,second:[4,5,11],pass:[1,11],light_twosid:5,zfail_op:11,index:0,what:[0,7,8],sprite_coord_mod:5,sub:4,compar:4,neg:4,section:[4,9],current:9,delet:9,rgba:[9,10],method:[0,3,9],themselv:5,deriv:4,absolut:4,coeffici:4,inher:4,path:9,vertic:5,modifi:9,sinc:4,valu:[4,9,11],trunc:4,line_stipple_factor:5,search:0,shift:4,vbo:[],shader:[0,1,4,5,6,9,11],permit:[5,9],weird:10,gourard:5,semant:4,txl:4,"boolean":3,txf:4,modul:0,txd:4,sgt:4,src2:4,src0:4,api:[1,4,7,10],brk:4,is_texture_referenc:9,visibl:5,oval:5,sge:4,bra:4,encapsul:7,gl_rasterization_rul:5,from:[4,5,9,10],offset_unit:5,subtract:4,regist:4,two:[4,6,9,11],program:4,call:[4,9],get_paramf:3,stage:4,type:6,more:9,desir:1,get_nam:3,raster:[0,1,5,9],pipe_primitive_quad:5,flag:5,indic:[0,4],fill_ccw:5,unpack:4,point_size_min:5,must:4,poly_smooth:5,graphic:[4,7],retriev:9,setup:3,work:1,obvious:5,can:[1,4,3,9],cal:4,purpos:4,root:4,fetch:4,control:[11,8,5,9,10],create_blend_st:9,pipe_surfac:9,templat:3,minimum:[4,5,10],want:9,dp2a:4,unsign:4,occur:4,gl_nv_vertex_program:4,alwai:[11,5,10],point_size_per_vertex:5,multipl:[2,9],divid:4,anoth:9,write:[7,9,11],how:[4,5,9,10],flatshad:[1,5],simpl:9,sin:4,"42101e":[],product:4,sne:4,resourc:9,max:4,after:10,cso:[0,1,9],set_constant_buff:9,mad:4,mai:[5,9],end:4,fail_op:11,pipe_stencil_op:11,principl:1,essenti:7,third:4,bind:9,counter:4,element:5,endprim:4,inform:2,valuemask:11,order:11,rotat:5,over:9,move:[4,9],through:[5,11],sqrt:[],still:5,paramet:3,group:9,directli:9,bypass:5,main:5,easier:9,non:9,"return":[1,4,3],greater:4,thei:[1,11,5,9,10],fragment:[4,8,5,9,11],initi:9,get_vendor:3,"break":4,line_smooth:5,cull_mod:5,front:4,nop:4,introduct:[0,7],name:[3,4,9],separ:9,token:[0,4,6],each:[5,10],side:11,doxi:10,offset_ccw:5,clamp:[4,10],chunk:5,continu:4,frac:4,special:[4,9],out:[1,11,10],variabl:9,dst:4,ret:4,content:0,vector:4,rel:4,hardwar:[7,5,11],got:3,linear:4,offset_cw:5,given:3,compare_func:10,endsub:4,base:4,begin_queri:9,"_rasterizer_st":9,reusabl:1,endrep:4,filter:10,turn:5,get_param:3,clump:11,first:[4,5],oper:[4,9,11],glsl:4,rang:10,max_lod:10,render:[8,9],carri:11,independ:3,restrict:4,clear:9,instruct:[0,4],done:11,size:[4,5],differ:[4,5],stencil:[0,1,9,11],exponenti:4,tradition:11,too:9,circl:5,scheme:9,moar:[3,5],store:11,nrm4:4,min_img_filt:10,option:[4,5,10],pipe_tex_filt:10,specifi:5,create_queri:9,part:[1,4,3],than:4,line_stipple_en:5,target:[4,8],keyword:4,provid:[7,9],remov:4,see:3,structur:11,texel:[4,10],stippl:5,str:4,opaqu:1,posit:4,rcc:4,result:[8,9],pre:5,fashion:7,clip:5,pk4ub:4,ani:[1,9],"_blend_stat":9,bitfield:5,subroutin:4,max_anisotropi:10,txb:4,manner:[3,7],have:[11,5,9,10],tabl:0,need:5,seem:9,"null":9,bitwis:4,techniqu:2,unresolv:8,alias:[2,5],destroi:9,fill_cw:5,note:[1,4,5],ex2:4,take:2,set_viewport_st:9,pipe_func:11,noth:4,singl:9,pipelin:[4,5,9],xor:4,shade:5,normal:10,buffer:[2,8,9,11],object:[1,7,3,9],most:[5,9],sfl:4,mipmap:10,alpha:[0,1,9,11],pipe_primitive_polygon:5,segment:5,tradit:10,pk2h:4,nail:9,tgsi:[0,4],face:4,pipe:4,declar:4,determin:5,pk2u:4,left:4,blend:[0,1,8,9],sum:4,dot:4,end_queri:9,popa:4,destroy_blend_st:9,wrap_:10,dst0:4,trivial:9,access:9,onli:[4,9],dp4:4,dp3:4,dp2:4,front_wind:5,point_sprit:5,should:[8,5],busi:9,endloop:4,lit:4,variou:9,get:3,set_scissor_st:9,stop:9,ceil:4,mul:4,tungsten:4,ssg:4,tgsi_token:6,tbd:4,set_fragment_sampler_textur:9,shr:4,enabl:[5,9,11],draw_el:9,"default":4,statist:9,contain:4,anisotrop:10,shl:4,valid:4,dph:4,arr:4,set:[0,4,5,9,10],set_framebuffer_st:9,seq:4,smooth:[2,5],ara:4,msaa:[2,5],wrap_t:10,wrap_r:10,fail:11,arl:4,purest:9,modulu:4,project:4,pattern:5,label:4,state:[1,5,8,9,10,11],between:4,"import":[4,5],subscript:4,triplet:9,screen:[0,3],min_mip_filt:10,entir:5,is_buffer_referenc:9,lod_bia:10,addit:9,both:[9,11],last:5,framebuff:9,x2d:4,region:9,equal:4,pixel:5,min_lod:10,context:[0,1,3,9],line_last_pixel:5,mani:10,destroy_queri:9,load:[4,10],undocu:[8,5,10],point:[3,5,9],color:[5,10],pow:4,address:4,pop:4,distinguish:4,callnz:4,reciproc:4,anti:[2,5],provok:5,lg2:4,asdf:[],light:4,endif:4,devic:[3,7,9],three:[4,11],been:11,compon:4,get_query_result:9,treat:10,basic:2,bgnsub:4,up4ub:4,sprite:5,nrm:4,normalized_coord:10,xxx:[3,4,5,8,10,11],coordin:[4,10],zero:4,minifi:10,togeth:11,func:11,predic:4,bgnloop:4,sad:4,present:9,multi:2,ident:4,slt:4,servic:7,properti:1,batch:9,rectangular:5,behavior:8,glossari:[2,0],sle:4,loop:4,pack:[4,9],gl_nv_vertex_program2:4,cont:4,set_edgeflag:9,endfor:4,destin:[4,9],txq:4,primit:[4,5],"_vs_state":9,sever:[7,5],set_blend_color:9,surface_fil:9,welcom:0,bind_fragment_sampler_st:9,perform:9,make:9,cross:4,same:[4,9],member:[1,5,6,8,10,11],handl:[1,9],compare_mod:10,instanc:9,zpass_op:11,document:[0,11],difficult:9,finish:9,nest:9,driver:[4,7,9],effect:[1,5,10],mov:4,capabl:4,rais:[],kil:4,stack:4,squar:4,multisampl:5,off:[8,5],center:5,surface_copi:9,min:4,aisl:4,scissor:5,exampl:9,reflect:4,poly_stipple_en:5,thi:[2,4,5,8,9,10],interpol:[4,5],set_clip_st:9,dimension:10,i2f:4,usual:5,explan:[0,4],distanc:4,identifi:3,execut:11,less:4,kilp:4,up2u:4,up2h:4,tcl:5,simpli:5,semanticnam:4,breakc:4,languag:4,begin:4,gl_nv_geometry_program4:4,expos:10,except:5,add:[4,9],cleanup:4,exercis:9,sampler:[0,1,9,10],els:4,mod:4,bypass_vs_clip_and_viewport:[1,5],match:4,pipe_tex_wrap:10,vendor:3,which:[1,7],format:[3,9],read:9,agnost:7,piec:9,bia:[4,10],bgnfor:4,magnifi:10,amp:11,bit:[4,5],truncat:4,apart:9,like:9,specif:[1,3,9,5],integ:[3,4],point_siz:5,src1:4,either:[4,9],output:4,page:0,mag_img_filt:10,refin:10,pipe_primitive_quad_strip:5,right:4,draw_range_el:9,some:[9,10],back:[3,4],pusha:4,opcod:4,sampl:[2,10],flush:9,guarante:9,bore:3,textur:[3,4,9,10],ddy:4,ddx:4,partiali:4,though:9,overlap:9,point_smooth:5,multipli:4,cnd:4,tracker:9,larg:7,unit:10,condit:4,txp:4,refer:[11,10],core:[1,7],run:5,rsq:4,border_color:10,ifc:4,"_depth_stencil_alpha_st":9,appli:10,describ:[4,9],writemask:11,src:4,actual:[5,11],gallium:[0,1,4,7,6],semanticindex:4,bind_vertex_sampler_st:9,set_vertex_buff:9,stand:9,awai:5,discard:[4,11],approxim:4,mean:4,disabl:10,"final":[8,9],"float":[3,4],bound:[1,9,10],down:9,explain:4,wrap:10,chang:[5,9],mere:5,flatshade_first:[1,5],log:4,lod:[4,10],support:[4,6],rcp:4,transform:[4,5],xpd:4,avail:9,width:5,set_polygon_stippl:9,interfac:9,fraction:4,individu:[4,10],select:10,"function":[4,9,11],homogen:4,blend_en:8,set_vertex_sampler_textur:9,point_size_max:5,link:4,blit:9,line:5,"true":4,viewport:5,gl_nv_gpu_program4:4,notat:10,flavour:9,input:4,draw_arrai:9,whether:[11,5,10],wish:5,caller:5,bind_blend_st:9,maximum:[4,5,10],"abstract":9,line_stipple_pattern:5,emit:4,offset_scal:5,gather:9,constant:[1,4],creat:[1,3,9],classic:9,certain:11,dure:11,rfl:4,repres:[3,9],implement:5,file:4,fill:[1,9],polygon:[2,5],floor:4,when:[4,5,9,10],detail:10,power:4,field:4,other:[0,4],lookup:4,futur:9,branch:4,test:[5,11],ref_valu:11,draw:9,repeat:4,exp:4,is_format_support:3,symbol:[0,4],vertex:[5,9],surfac:9,consid:4,receiv:11,blitter:9,algorithm:5,rule:5,pipe_primitive_triangle_fan:5,depth:[2,0,1,9,11],"_fs_state":9,potenti:4,time:[1,4],push:4,line_width:5,rep:4,texture_cr:3},titles:["Welcome to Gallium’s documentation!","CSO","Glossary","Screen","TGSI","Rasterizer","Shader","Introduction","Blend","Context","Sampler","Depth, Stencil, & Alpha"],modules:{},descrefs:{},filenames:["index","cso","glossary","screen","tgsi","cso/rasterizer","cso/shader","intro","cso/blend","context","cso/sampler","cso/dsa"]}) \ No newline at end of file diff --git a/src/gallium/docs/build/html/tgsi.html b/src/gallium/docs/build/html/tgsi.html index 207607b90a..0dac00f25e 100644 --- a/src/gallium/docs/build/html/tgsi.html +++ b/src/gallium/docs/build/html/tgsi.html @@ -51,8 +51,10 @@ for describing shaders. Since Gallium is inherently shaderful, shaders are an important part of the API. TGSI is the only intermediate representation used by all drivers.

      +
      +

      Instruction Set

      -

      From GL_NV_vertex_program

      +

      From GL_NV_vertex_program

      ARL - Address Register Load

      dst.x = \lfloor src.x\rfloor
@@ -478,8 +480,8 @@ dst.z = src0.x + src1.x \times src2.x + src1.y \times src2.y
 dst.w = src0.y + src1.x \times src2.z + src1.y \times src2.w

      Considered for removal.

      -
      -

      GL_NV_vertex_program2

      +
      +

      From GL_NV_vertex_program2

      ARA - Address Register Add

      TBD

      @@ -637,8 +639,8 @@ dst.x = pop()

      Considered for cleanup / removal.

      -
      -

      GL_NV_gpu_program4

      +
      +

      From GL_NV_gpu_program4

      Support for these opcodes indicated by a special pipe capability bit (TBD).

      CEIL - Ceiling

      @@ -750,8 +752,8 @@ TBD
      TBD
      -
      -

      GL_NV_geometry_program4

      +
      +

      From GL_NV_geometry_program4

      EMIT - Emit

      TBD
      @@ -759,8 +761,8 @@ TBD
      TBD
      -
      -

      GLSL

      +
      +

      From GLSL

      BGNLOOP - Begin a Loop

      TBD
      @@ -787,7 +789,7 @@ dst.z = \frac{src.z}{src.x \times src.x + src.y \times src.y + src.z \times src. dst.w = \frac{src.w}{src.x \times src.x + src.y \times src.y + src.z \times src.z + src.w \times src.w}" />

      -

      ps_2_x

      +

      ps_2_x

      CALLNZ - Subroutine Call If Not Zero

      TBD
      @@ -800,9 +802,9 @@ TBD
      -

      Explanation of symbols used

      +

      Explanation of symbols used

      -

      Functions

      +

      Functions

      |x| Absolute value of x.

      \lceil x \rceil Ceiling of x.

      @@ -828,7 +830,7 @@ TBD
      -

      Keywords

      +

      Keywords

      discard Discard fragment.

      dst First destination register.

      @@ -843,9 +845,9 @@ TBD
      -

      Other tokens

      +

      Other tokens

      -

      Declaration Semantic

      +

      Declaration Semantic

      Follows Declaration token if Semantic bit is set.

      Since its purpose is to link a shader with other stages of the pipeline, @@ -860,7 +862,7 @@ is 0.

      sections.

      -

      FACE

      +

      FACE

      Valid only in a fragment shader INPUT declaration.

      FACE.x is negative when the primitive is back facing. FACE.x is positive @@ -868,6 +870,7 @@ when the primitive is front facing.

      +
      @@ -879,11 +882,12 @@ when the primitive is front facing.

      Table Of Contents

      +

    Previous topic

    diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index de27d8a005..86c09046f7 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -6,8 +6,11 @@ for describing shaders. Since Gallium is inherently shaderful, shaders are an important part of the API. TGSI is the only intermediate representation used by all drivers. +Instruction Set +--------------- + From GL_NV_vertex_program -------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^ ARL - Address Register Load @@ -633,8 +636,8 @@ X2D - 2D Coordinate Transformation Considered for removal. -GL_NV_vertex_program2 --------------------------- +From GL_NV_vertex_program2 +^^^^^^^^^^^^^^^^^^^^^^^^^^ ARA - Address Register Add @@ -850,8 +853,8 @@ POPA - Pop Address Register From Stack Considered for cleanup / removal. -GL_NV_gpu_program4 ------------------------- +From GL_NV_gpu_program4 +^^^^^^^^^^^^^^^^^^^^^^^^ Support for these opcodes indicated by a special pipe capability bit (TBD). @@ -1015,8 +1018,8 @@ CONT - Continue TBD -GL_NV_geometry_program4 ------------------------------ +From GL_NV_geometry_program4 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ EMIT - Emit @@ -1029,8 +1032,8 @@ ENDPRIM - End Primitive TBD -GLSL ----------- +From GLSL +^^^^^^^^^^ BGNLOOP - Begin a Loop @@ -1072,7 +1075,7 @@ NRM4 - 4-component Vector Normalise ps_2_x ------------- +^^^^^^^^^^^^ CALLNZ - Subroutine Call If Not Zero @@ -1091,11 +1094,11 @@ BREAKC - Break Conditional Explanation of symbols used -============================== +------------------------------ Functions --------------- +^^^^^^^^^^^^^^ :math:`|x|` Absolute value of `x`. @@ -1131,7 +1134,7 @@ Functions Keywords -------------- +^^^^^^^^^^^^^ discard Discard fragment. @@ -1154,11 +1157,11 @@ Keywords Other tokens -=============== +--------------- Declaration Semantic -------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^ Follows Declaration token if Semantic bit is set. @@ -1179,7 +1182,7 @@ Declaration Semantic FACE -^^^^ +"""" Valid only in a fragment shader INPUT declaration. -- cgit v1.2.3 From 54ddf642dfaea3532b60c8239cb6a83950762e43 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 23 Dec 2009 23:36:06 -0800 Subject: docs: Add all semantics to TGSI doc, regen. --- src/gallium/docs/build/html/_sources/tgsi.txt | 91 +++++++++++++++++++++++++-- src/gallium/docs/build/html/searchindex.js | 2 +- src/gallium/docs/build/html/tgsi.html | 87 ++++++++++++++++++++++--- src/gallium/docs/source/tgsi.rst | 91 +++++++++++++++++++++++++-- 4 files changed, 252 insertions(+), 19 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/build/html/_sources/tgsi.txt b/src/gallium/docs/build/html/_sources/tgsi.txt index 86c09046f7..12687f29dc 100644 --- a/src/gallium/docs/build/html/_sources/tgsi.txt +++ b/src/gallium/docs/build/html/_sources/tgsi.txt @@ -1180,11 +1180,92 @@ Declaration Semantic The meanings of the individual semantic names are explained in the following sections. +TGSI_SEMANTIC_POSITION +"""""""""""""""""""""" -FACE -"""" +Position, sometimes known as HPOS or WPOS for historical reasons, is the +location of the vertex in space, in ``(x, y, z, w)`` format. ``x``, ``y``, and ``z`` +are the Cartesian coordinates, and ``w`` is the homogenous coordinate and used +for the perspective divide, if enabled. - Valid only in a fragment shader INPUT declaration. +As a vertex shader output, position should be scaled to the viewport. When +used in fragment shaders, position will --- - FACE.x is negative when the primitive is back facing. FACE.x is positive - when the primitive is front facing. +XXX --- wait a minute. Should position be in [0,1] for x and y? + +XXX additionally, is there a way to configure the perspective divide? it's +accelerated on most chipsets AFAIK... + +Position, if not specified, usually defaults to ``(0, 0, 0, 1)``, and can +be partially specified as ``(x, y, 0, 1)`` or ``(x, y, z, 1)``. + +XXX usually? can we solidify that? + +TGSI_SEMANTIC_COLOR +""""""""""""""""""" + +Colors are used to, well, color the primitives. Colors are always in +``(r, g, b, a)`` format. + +If alpha is not specified, it defaults to 1. + +TGSI_SEMANTIC_BCOLOR +"""""""""""""""""""" + +Back-facing colors are only used for back-facing polygons, and are only valid +in vertex shader outputs. After rasterization, all polygons are front-facing +and COLOR and BCOLOR end up occupying the same slots in the fragment, so +all BCOLORs effectively become regular COLORs in the fragment shader. + +TGSI_SEMANTIC_FOG +""""""""""""""""" + +The fog coordinate historically has been used to replace the depth coordinate +for generation of fog in dedicated fog blocks. Gallium, however, does not use +dedicated fog acceleration, placing it entirely in the fragment shader +instead. + +The fog coordinate should be written in ``(f, 0, 0, 1)`` format. Only the first +component matters when writing from the vertex shader; the driver will ensure +that the coordinate is in this format when used as a fragment shader input. + +TGSI_SEMANTIC_PSIZE +""""""""""""""""""" + +PSIZE, or point size, is used to specify point sizes per-vertex. It should +be in ``(p, n, x, f)`` format, where ``p`` is the point size, ``n`` is the minimum +size, ``x`` is the maximum size, and ``f`` is the fade threshold. + +XXX this is arb_vp. is this what we actually do? should double-check... + +When using this semantic, be sure to set the appropriate state in the +:ref:`rasterizer` first. + +TGSI_SEMANTIC_GENERIC +""""""""""""""""""""" + +Generic semantics are nearly always used for texture coordinate attributes, +in ``(s, t, r, q)`` format. ``t`` and ``r`` may be unused for certain kinds +of lookups, and ``q`` is the level-of-detail bias for biased sampling. + +These attributes are called "generic" because they may be used for anything +else, including parameters, texture generation information, or anything that +can be stored inside a four-component vector. + +TGSI_SEMANTIC_NORMAL +"""""""""""""""""""" + +XXX no clue. + +TGSI_SEMANTIC_FACE +"""""""""""""""""" + +FACE is the facing bit, to store the facing information for the fragment +shader. ``(f, 0, 0, 1)`` is the format. The first component will be positive +when the fragment is front-facing, and negative when the component is +back-facing. + +TGSI_SEMANTIC_EDGEFLAG +"""""""""""""""""""""" + +XXX no clue diff --git a/src/gallium/docs/build/html/searchindex.js b/src/gallium/docs/build/html/searchindex.js index c3c0b876ea..0e3f2bb4a2 100644 --- a/src/gallium/docs/build/html/searchindex.js +++ b/src/gallium/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({desctypes:{},terms:{represent:4,all:[4,9,11],concept:9,edg:2,queri:[4,9],particular:9,four:[4,10],scalar:4,per:5,abil:9,follow:[4,9],depend:5,intermedi:4,ps_2_x:4,those:4,logarithm:4,sourc:[4,9],normalis:4,straightforward:7,fals:4,set_vertex_el:9,lrp:4,fan:5,partialx:4,level:10,pk4b:4,list:6,"884467e":[],emul:9,prefilt:10,cosin:4,sine:4,small:9,div:4,round:4,cmp:4,dimens:10,impli:5,flr:4,up4b:4,sign:4,tex:4,second:[4,5,11],pass:[1,11],light_twosid:5,zfail_op:11,index:0,what:[0,7,8],sprite_coord_mod:5,sub:4,compar:4,neg:4,section:[4,9],current:9,delet:9,rgba:[9,10],method:[0,3,9],themselv:5,deriv:4,absolut:4,coeffici:4,inher:4,path:9,vertic:5,modifi:9,sinc:4,valu:[4,9,11],trunc:4,line_stipple_factor:5,search:0,shift:4,vbo:[],shader:[0,1,4,5,6,9,11],permit:[5,9],weird:10,gourard:5,semant:4,txl:4,"boolean":3,txf:4,modul:0,txd:4,sgt:4,src2:4,src0:4,api:[1,4,7,10],brk:4,is_texture_referenc:9,visibl:5,oval:5,sge:4,bra:4,encapsul:7,gl_rasterization_rul:5,from:[4,5,9,10],offset_unit:5,subtract:4,regist:4,two:[4,6,9,11],program:4,call:[4,9],get_paramf:3,stage:4,type:6,more:9,desir:1,get_nam:3,raster:[0,1,5,9],pipe_primitive_quad:5,flag:5,indic:[0,4],fill_ccw:5,unpack:4,point_size_min:5,must:4,poly_smooth:5,graphic:[4,7],retriev:9,setup:3,work:1,obvious:5,can:[1,4,3,9],cal:4,purpos:4,root:4,fetch:4,control:[11,8,5,9,10],create_blend_st:9,pipe_surfac:9,templat:3,minimum:[4,5,10],want:9,dp2a:4,unsign:4,occur:4,gl_nv_vertex_program:4,alwai:[11,5,10],point_size_per_vertex:5,multipl:[2,9],divid:4,anoth:9,write:[7,9,11],how:[4,5,9,10],flatshad:[1,5],simpl:9,sin:4,"42101e":[],product:4,sne:4,resourc:9,max:4,after:10,cso:[0,1,9],set_constant_buff:9,mad:4,mai:[5,9],end:4,fail_op:11,pipe_stencil_op:11,principl:1,essenti:7,third:4,bind:9,counter:4,element:5,endprim:4,inform:2,valuemask:11,order:11,rotat:5,over:9,move:[4,9],through:[5,11],sqrt:[],still:5,paramet:3,group:9,directli:9,bypass:5,main:5,easier:9,non:9,"return":[1,4,3],greater:4,thei:[1,11,5,9,10],fragment:[4,8,5,9,11],initi:9,get_vendor:3,"break":4,line_smooth:5,cull_mod:5,front:4,nop:4,introduct:[0,7],name:[3,4,9],separ:9,token:[0,4,6],each:[5,10],side:11,doxi:10,offset_ccw:5,clamp:[4,10],chunk:5,continu:4,frac:4,special:[4,9],out:[1,11,10],variabl:9,dst:4,ret:4,content:0,vector:4,rel:4,hardwar:[7,5,11],got:3,linear:4,offset_cw:5,given:3,compare_func:10,endsub:4,base:4,begin_queri:9,"_rasterizer_st":9,reusabl:1,endrep:4,filter:10,turn:5,get_param:3,clump:11,first:[4,5],oper:[4,9,11],glsl:4,rang:10,max_lod:10,render:[8,9],carri:11,independ:3,restrict:4,clear:9,instruct:[0,4],done:11,size:[4,5],differ:[4,5],stencil:[0,1,9,11],exponenti:4,tradition:11,too:9,circl:5,scheme:9,moar:[3,5],store:11,nrm4:4,min_img_filt:10,option:[4,5,10],pipe_tex_filt:10,specifi:5,create_queri:9,part:[1,4,3],than:4,line_stipple_en:5,target:[4,8],keyword:4,provid:[7,9],remov:4,see:3,structur:11,texel:[4,10],stippl:5,str:4,opaqu:1,posit:4,rcc:4,result:[8,9],pre:5,fashion:7,clip:5,pk4ub:4,ani:[1,9],"_blend_stat":9,bitfield:5,subroutin:4,max_anisotropi:10,txb:4,manner:[3,7],have:[11,5,9,10],tabl:0,need:5,seem:9,"null":9,bitwis:4,techniqu:2,unresolv:8,alias:[2,5],destroi:9,fill_cw:5,note:[1,4,5],ex2:4,take:2,set_viewport_st:9,pipe_func:11,noth:4,singl:9,pipelin:[4,5,9],xor:4,shade:5,normal:10,buffer:[2,8,9,11],object:[1,7,3,9],most:[5,9],sfl:4,mipmap:10,alpha:[0,1,9,11],pipe_primitive_polygon:5,segment:5,tradit:10,pk2h:4,nail:9,tgsi:[0,4],face:4,pipe:4,declar:4,determin:5,pk2u:4,left:4,blend:[0,1,8,9],sum:4,dot:4,end_queri:9,popa:4,destroy_blend_st:9,wrap_:10,dst0:4,trivial:9,access:9,onli:[4,9],dp4:4,dp3:4,dp2:4,front_wind:5,point_sprit:5,should:[8,5],busi:9,endloop:4,lit:4,variou:9,get:3,set_scissor_st:9,stop:9,ceil:4,mul:4,tungsten:4,ssg:4,tgsi_token:6,tbd:4,set_fragment_sampler_textur:9,shr:4,enabl:[5,9,11],draw_el:9,"default":4,statist:9,contain:4,anisotrop:10,shl:4,valid:4,dph:4,arr:4,set:[0,4,5,9,10],set_framebuffer_st:9,seq:4,smooth:[2,5],ara:4,msaa:[2,5],wrap_t:10,wrap_r:10,fail:11,arl:4,purest:9,modulu:4,project:4,pattern:5,label:4,state:[1,5,8,9,10,11],between:4,"import":[4,5],subscript:4,triplet:9,screen:[0,3],min_mip_filt:10,entir:5,is_buffer_referenc:9,lod_bia:10,addit:9,both:[9,11],last:5,framebuff:9,x2d:4,region:9,equal:4,pixel:5,min_lod:10,context:[0,1,3,9],line_last_pixel:5,mani:10,destroy_queri:9,load:[4,10],undocu:[8,5,10],point:[3,5,9],color:[5,10],pow:4,address:4,pop:4,distinguish:4,callnz:4,reciproc:4,anti:[2,5],provok:5,lg2:4,asdf:[],light:4,endif:4,devic:[3,7,9],three:[4,11],been:11,compon:4,get_query_result:9,treat:10,basic:2,bgnsub:4,up4ub:4,sprite:5,nrm:4,normalized_coord:10,xxx:[3,4,5,8,10,11],coordin:[4,10],zero:4,minifi:10,togeth:11,func:11,predic:4,bgnloop:4,sad:4,present:9,multi:2,ident:4,slt:4,servic:7,properti:1,batch:9,rectangular:5,behavior:8,glossari:[2,0],sle:4,loop:4,pack:[4,9],gl_nv_vertex_program2:4,cont:4,set_edgeflag:9,endfor:4,destin:[4,9],txq:4,primit:[4,5],"_vs_state":9,sever:[7,5],set_blend_color:9,surface_fil:9,welcom:0,bind_fragment_sampler_st:9,perform:9,make:9,cross:4,same:[4,9],member:[1,5,6,8,10,11],handl:[1,9],compare_mod:10,instanc:9,zpass_op:11,document:[0,11],difficult:9,finish:9,nest:9,driver:[4,7,9],effect:[1,5,10],mov:4,capabl:4,rais:[],kil:4,stack:4,squar:4,multisampl:5,off:[8,5],center:5,surface_copi:9,min:4,aisl:4,scissor:5,exampl:9,reflect:4,poly_stipple_en:5,thi:[2,4,5,8,9,10],interpol:[4,5],set_clip_st:9,dimension:10,i2f:4,usual:5,explan:[0,4],distanc:4,identifi:3,execut:11,less:4,kilp:4,up2u:4,up2h:4,tcl:5,simpli:5,semanticnam:4,breakc:4,languag:4,begin:4,gl_nv_geometry_program4:4,expos:10,except:5,add:[4,9],cleanup:4,exercis:9,sampler:[0,1,9,10],els:4,mod:4,bypass_vs_clip_and_viewport:[1,5],match:4,pipe_tex_wrap:10,vendor:3,which:[1,7],format:[3,9],read:9,agnost:7,piec:9,bia:[4,10],bgnfor:4,magnifi:10,amp:11,bit:[4,5],truncat:4,apart:9,like:9,specif:[1,3,9,5],integ:[3,4],point_siz:5,src1:4,either:[4,9],output:4,page:0,mag_img_filt:10,refin:10,pipe_primitive_quad_strip:5,right:4,draw_range_el:9,some:[9,10],back:[3,4],pusha:4,opcod:4,sampl:[2,10],flush:9,guarante:9,bore:3,textur:[3,4,9,10],ddy:4,ddx:4,partiali:4,though:9,overlap:9,point_smooth:5,multipli:4,cnd:4,tracker:9,larg:7,unit:10,condit:4,txp:4,refer:[11,10],core:[1,7],run:5,rsq:4,border_color:10,ifc:4,"_depth_stencil_alpha_st":9,appli:10,describ:[4,9],writemask:11,src:4,actual:[5,11],gallium:[0,1,4,7,6],semanticindex:4,bind_vertex_sampler_st:9,set_vertex_buff:9,stand:9,awai:5,discard:[4,11],approxim:4,mean:4,disabl:10,"final":[8,9],"float":[3,4],bound:[1,9,10],down:9,explain:4,wrap:10,chang:[5,9],mere:5,flatshade_first:[1,5],log:4,lod:[4,10],support:[4,6],rcp:4,transform:[4,5],xpd:4,avail:9,width:5,set_polygon_stippl:9,interfac:9,fraction:4,individu:[4,10],select:10,"function":[4,9,11],homogen:4,blend_en:8,set_vertex_sampler_textur:9,point_size_max:5,link:4,blit:9,line:5,"true":4,viewport:5,gl_nv_gpu_program4:4,notat:10,flavour:9,input:4,draw_arrai:9,whether:[11,5,10],wish:5,caller:5,bind_blend_st:9,maximum:[4,5,10],"abstract":9,line_stipple_pattern:5,emit:4,offset_scal:5,gather:9,constant:[1,4],creat:[1,3,9],classic:9,certain:11,dure:11,rfl:4,repres:[3,9],implement:5,file:4,fill:[1,9],polygon:[2,5],floor:4,when:[4,5,9,10],detail:10,power:4,field:4,other:[0,4],lookup:4,futur:9,branch:4,test:[5,11],ref_valu:11,draw:9,repeat:4,exp:4,is_format_support:3,symbol:[0,4],vertex:[5,9],surfac:9,consid:4,receiv:11,blitter:9,algorithm:5,rule:5,pipe_primitive_triangle_fan:5,depth:[2,0,1,9,11],"_fs_state":9,potenti:4,time:[1,4],push:4,line_width:5,rep:4,texture_cr:3},titles:["Welcome to Gallium’s documentation!","CSO","Glossary","Screen","TGSI","Rasterizer","Shader","Introduction","Blend","Context","Sampler","Depth, Stencil, & Alpha"],modules:{},descrefs:{},filenames:["index","cso","glossary","screen","tgsi","cso/rasterizer","cso/shader","intro","cso/blend","context","cso/sampler","cso/dsa"]}) \ No newline at end of file +Search.setIndex({desctypes:{},terms:{represent:4,all:[4,9,11],concept:9,partial:4,edg:2,queri:[4,9],particular:9,four:[4,10],scalar:4,per:[4,5],abil:9,follow:[4,9],locat:4,depend:5,name:[3,4,9],intermedi:4,ps_2_x:4,those:4,unit:10,logarithm:4,sourc:[4,9],normalis:4,straightforward:7,fals:4,set_vertex_el:9,lrp:4,fan:5,partialx:4,level:[4,10],pk4b:4,list:6,emul:9,prefilt:10,cosin:4,small:9,div:4,round:4,cmp:4,dimens:10,impli:5,flr:4,tgsi_semantic_posit:4,up4b:4,sign:4,tex:4,second:[4,5,11],pass:[1,11],light_twosid:5,zfail_op:11,index:0,what:[8,0,4,7],xor:4,sub:4,compar:4,neg:4,section:[4,9],access:9,delet:9,rgba:[9,10],method:[0,3,9],themselv:5,deriv:4,gener:4,coeffici:4,psize:4,becom:4,inher:4,path:9,vertic:5,modifi:9,sinc:4,valu:[4,9,11],trunc:4,line_stipple_factor:5,search:0,shift:4,current:9,vbo:[],shader:[0,1,4,5,6,9,11],permit:[5,9],weird:10,gourard:5,endrep:4,semant:4,txl:4,"boolean":3,txf:4,modul:0,txd:4,sgt:4,textur:[3,4,9,10],src2:4,src0:4,api:[1,4,7,10],brk:4,is_texture_referenc:9,visibl:5,oval:5,sge:4,select:10,encapsul:7,gl_rasterization_rul:5,from:[4,5,9,10],offset_unit:5,subtract:4,doubl:4,regist:4,two:[4,6,9,11],program:4,call:[4,9],get_paramf:3,stage:4,type:6,more:9,desir:1,get_nam:3,raster:[0,1,4,5,9],pipe_primitive_quad:5,clue:4,flag:5,indic:[0,4],fill_ccw:5,known:4,unpack:4,point_size_min:5,must:4,poly_smooth:5,graphic:[4,7],retriev:9,setup:3,work:1,obvious:5,can:[1,4,3,9],cal:4,purpos:4,root:4,fetch:4,control:[11,8,5,9,10],create_blend_st:9,pipe_surfac:9,templat:3,minimum:[4,5,10],want:9,dp2a:4,unsign:4,occur:4,nearli:4,gl_nv_vertex_program:4,alwai:[11,4,5,10],point_size_per_vertex:5,multipl:[2,9],divid:4,anoth:9,write:[4,7,9,11],how:[4,5,9,10],flatshad:[1,5],instead:4,simpl:9,sin:4,"42101e":[],product:4,sne:4,resourc:9,max:4,after:[4,10],cso:[0,1,9],set_constant_buff:9,mad:4,mai:[4,5,9],end:4,fail_op:11,pipe_stencil_op:11,principl:1,essenti:7,third:4,bind:9,counter:4,element:5,endprim:4,inform:[2,4],valuemask:11,order:11,rotat:5,over:9,move:[4,9],becaus:4,through:[5,11],sqrt:[],still:5,tgsi_semantic_bcolor:4,paramet:[3,4],group:9,directli:9,bypass:5,main:5,easier:9,non:9,"return":[1,4,3],greater:4,thei:[1,4,5,9,10,11],fragment:[4,8,5,9,11],initi:9,get_vendor:3,"break":4,line_smooth:5,cull_mod:5,front:4,nop:4,introduct:[0,7],"884467e":[],anyth:4,perspect:4,separ:9,token:[0,4,6],each:[5,10],side:11,doxi:10,offset_ccw:5,clamp:[4,10],replac:4,chunk:5,continu:4,ensur:4,frac:4,special:[4,9],out:[1,11,10],variabl:9,space:4,dst:4,ret:4,content:0,vector:4,rel:4,hardwar:[7,5,11],got:3,linear:4,insid:4,offset_cw:5,given:3,compare_func:10,endsub:4,reason:4,base:4,begin_queri:9,"_rasterizer_st":9,reusabl:1,wai:4,where:4,filter:10,turn:5,wpo:4,place:4,get_param:3,clump:11,first:[4,5],oper:[4,9,11],glsl:4,rang:10,max_lod:10,render:[8,9],carri:11,independ:3,restrict:4,instruct:[0,4],done:11,tgsi_semantic_gener:4,light:4,size:[4,5],differ:[4,5],stencil:[0,1,9,11],exponenti:4,sometim:4,tradition:11,too:9,circl:5,scheme:9,moar:[3,5],store:[4,11],nrm4:4,min_img_filt:10,option:[4,5,10],pipe_tex_filt:10,specifi:[4,5],create_queri:9,part:[1,4,3],than:4,line_stipple_en:5,kind:4,target:[4,8],keyword:4,provid:[7,9],remov:4,see:3,structur:11,texel:[4,10],stippl:5,matter:4,str:4,opaqu:1,posit:4,minut:4,result:[8,9],pre:5,fashion:7,clip:5,pk4ub:4,ani:[1,9],"_blend_stat":9,bitfield:5,subroutin:4,max_anisotropi:10,txb:4,manner:[3,7],have:[11,5,9,10],tabl:0,need:5,dedic:4,"null":9,arb_vp:4,bitwis:4,techniqu:2,unresolv:8,alias:[2,5],destroi:9,fill_cw:5,note:[1,4,5],ex2:4,take:2,set_viewport_st:9,pipe_func:11,noth:4,singl:9,pipelin:[4,5,9],sure:4,shade:5,normal:10,buffer:[2,8,9,11],object:[1,7,3,9],most:[4,5,9],sfl:4,regular:4,mipmap:10,sprite_coord_mod:5,pipe_primitive_polygon:5,segment:5,tgsi_semantic_fog:4,tradit:10,pk2h:4,clear:9,tgsi:[0,4],face:4,pipe:4,declar:4,tracker:9,determin:5,pk2u:4,left:4,blend:[0,1,8,9],sum:4,dot:4,end_queri:9,popa:4,destroy_blend_st:9,wrap_:10,dst0:4,threshold:4,hpo:4,trivial:9,slot:4,absolut:4,onli:[4,9],dp4:4,dp3:4,dp2:4,front_wind:5,point_sprit:5,configur:4,written:4,should:[4,8,5],busi:9,endloop:4,lit:4,unus:4,variou:9,get:3,set_scissor_st:9,stop:9,tgsi_semantic_color:4,ceil:4,mul:4,tungsten:4,ssg:4,tgsi_token:6,tbd:4,set_fragment_sampler_textur:9,shr:4,enabl:[4,5,9,11],draw_el:9,"default":4,statist:9,contain:4,anisotrop:10,shl:4,valid:4,dph:4,arr:4,set:[0,4,5,9,10],set_framebuffer_st:9,seq:4,smooth:[2,5],tgsi_semantic_edgeflag:4,ara:4,msaa:[2,5],wrap_t:10,wrap_r:10,fail:11,arl:4,purest:9,modulu:4,project:4,pattern:5,label:4,state:[1,4,5,8,9,10,11],between:4,"import":[4,5],subscript:4,attribut:4,triplet:9,screen:[0,3],min_mip_filt:10,entir:[4,5],chipset:4,is_buffer_referenc:9,lod_bia:10,addit:9,both:[9,11],last:5,framebuff:9,x2d:4,region:9,equal:4,min_lod:10,context:[0,1,3,9],line_last_pixel:5,mani:10,destroy_queri:9,load:[4,10],acceler:4,undocu:[8,5,10],point:[3,4,5,9],color:[4,5,10],pow:4,address:4,pop:4,distinguish:4,callnz:4,reciproc:4,anti:[2,5],provok:5,lg2:4,asdf:[],sine:4,endif:4,addition:4,devic:[3,7,9],three:[4,11],been:[4,11],compon:4,get_query_result:9,treat:10,basic:2,wait:4,up4ub:4,sprite:5,nrm:4,normalized_coord:10,xxx:[3,4,5,8,10,11],fade:4,coordin:[4,10],zero:4,minifi:10,texture_cr:3,func:11,predic:4,bgnloop:4,sad:4,present:9,multi:2,ident:4,slt:4,servic:7,properti:1,histor:4,rectangular:5,behavior:8,glossari:[2,0],sle:4,howev:4,loop:4,pack:[4,9],gl_nv_vertex_program2:4,cont:4,set_edgeflag:9,endfor:4,destin:[4,9],txq:4,bias:4,primit:[4,5],"_vs_state":9,sever:[7,5],set_blend_color:9,surface_fil:9,welcom:0,bind_fragment_sampler_st:9,perform:9,make:9,nail:9,cross:4,same:[4,9],member:[1,5,6,8,10,11],handl:[1,9],compare_mod:10,instanc:9,zpass_op:11,document:[0,11],difficult:9,finish:9,nest:9,driver:[4,7,9],effect:[1,4,5,10],mov:4,capabl:4,rais:[],kil:4,stack:4,squar:4,multisampl:5,appropri:4,off:[8,5],center:5,surface_copi:9,min:4,well:4,bgnsub:4,aisl:4,scissor:5,exampl:9,reflect:4,poly_stipple_en:5,thi:[2,4,5,8,9,10],interpol:[4,5],set_clip_st:9,dimension:10,i2f:4,usual:[4,5],explan:[0,4],distanc:4,identifi:3,execut:11,less:4,kilp:4,up2u:4,up2h:4,tcl:5,simpli:5,semanticnam:4,breakc:4,languag:4,begin:4,gl_nv_geometry_program4:4,expos:10,afaik:4,except:5,seem:9,add:[4,9],cleanup:4,exercis:9,sampler:[0,1,9,10],els:4,mod:4,bypass_vs_clip_and_viewport:[1,5],match:4,pipe_tex_wrap:10,vendor:3,which:[1,7],format:[3,4,9],read:9,agnost:7,piec:9,bia:[4,10],bgnfor:4,magnifi:10,amp:11,bit:[4,5],truncat:4,apart:9,like:9,specif:[1,3,9,5],integ:[3,4],point_siz:5,src1:4,either:[4,9],output:4,page:0,mag_img_filt:10,refin:10,pipe_primitive_quad_strip:5,right:4,draw_range_el:9,some:[9,10],blend_en:8,pusha:4,opcod:4,sampl:[2,4,10],bcolor:4,flush:9,guarante:9,bore:3,pixel:5,ddy:4,ddx:4,partiali:4,though:9,overlap:9,point_smooth:5,multipli:4,cnd:4,fog:4,larg:7,bra:4,condit:4,txp:4,refer:[11,10],core:[1,7],tgsi_semantic_ps:4,run:5,rsq:4,border_color:10,ifc:4,"_depth_stencil_alpha_st":9,appli:10,describ:[4,9],writemask:11,src:4,actual:[4,5,11],solidifi:4,gallium:[0,1,4,7,6],semanticindex:4,bind_vertex_sampler_st:9,set_vertex_buff:9,stand:9,awai:5,discard:[4,11],approxim:4,mean:4,disabl:10,block:4,"final":[8,9],"float":[3,4],bound:[1,9,10],down:9,explain:4,alpha:[0,1,4,9,11],wrap:10,chang:[5,9],batch:9,mere:5,flatshade_first:[1,5],occupi:4,log:4,lod:[4,10],support:[4,6],rcp:4,transform:[4,5],xpd:4,avail:9,width:5,set_polygon_stippl:9,interfac:9,includ:4,fraction:4,cartesian:4,individu:[4,10],rcc:4,"function":[4,9,11],homogen:4,back:[3,4],tgsi_semantic_fac:4,set_vertex_sampler_textur:9,point_size_max:5,link:4,blit:9,line:5,"true":4,viewport:[4,5],gl_nv_gpu_program4:4,notat:10,flavour:9,input:4,draw_arrai:9,whether:[11,5,10],wish:5,caller:5,bind_blend_st:9,maximum:[4,5,10],"abstract":9,line_stipple_pattern:5,tgsi_semantic_norm:4,emit:4,offset_scal:5,gather:9,constant:[1,4],creat:[1,3,9],classic:9,certain:[4,11],dure:11,rfl:4,repres:[3,9],implement:5,file:4,doe:4,check:4,fill:[1,9],polygon:[2,4,5],floor:4,when:[4,5,9,10],detail:[4,10],power:4,field:4,other:[0,4],lookup:4,futur:9,branch:4,test:[5,11],ref_valu:11,draw:9,repeat:4,exp:4,is_format_support:3,symbol:[0,4],vertex:[4,5,9],surfac:9,scale:4,consid:4,receiv:11,blitter:9,algorithm:5,rule:5,pipe_primitive_triangle_fan:5,depth:[0,1,2,4,9,11],"_fs_state":9,potenti:4,time:[1,4],push:4,line_width:5,rep:4,togeth:11},titles:["Welcome to Gallium’s documentation!","CSO","Glossary","Screen","TGSI","Rasterizer","Shader","Introduction","Blend","Context","Sampler","Depth, Stencil, & Alpha"],modules:{},descrefs:{},filenames:["index","cso","glossary","screen","tgsi","cso/rasterizer","cso/shader","intro","cso/blend","context","cso/sampler","cso/dsa"]}) \ No newline at end of file diff --git a/src/gallium/docs/build/html/tgsi.html b/src/gallium/docs/build/html/tgsi.html index 0dac00f25e..7954e1de40 100644 --- a/src/gallium/docs/build/html/tgsi.html +++ b/src/gallium/docs/build/html/tgsi.html @@ -861,13 +861,76 @@ is 0.

    The meanings of the individual semantic names are explained in the following sections.

    -
    -

    FACE

    -
    -

    Valid only in a fragment shader INPUT declaration.

    -

    FACE.x is negative when the primitive is back facing. FACE.x is positive -when the primitive is front facing.

    -
    +
    +

    TGSI_SEMANTIC_POSITION

    +

    Position, sometimes known as HPOS or WPOS for historical reasons, is the +location of the vertex in space, in (x, y, z, w) format. x, y, and z +are the Cartesian coordinates, and w is the homogenous coordinate and used +for the perspective divide, if enabled.

    +

    As a vertex shader output, position should be scaled to the viewport. When +used in fragment shaders, position will —

    +

    XXX — wait a minute. Should position be in [0,1] for x and y?

    +

    XXX additionally, is there a way to configure the perspective divide? it’s +accelerated on most chipsets AFAIK...

    +

    Position, if not specified, usually defaults to (0, 0, 0, 1), and can +be partially specified as (x, y, 0, 1) or (x, y, z, 1).

    +

    XXX usually? can we solidify that?

    +
    +
    +

    TGSI_SEMANTIC_COLOR

    +

    Colors are used to, well, color the primitives. Colors are always in +(r, g, b, a) format.

    +

    If alpha is not specified, it defaults to 1.

    +
    +
    +

    TGSI_SEMANTIC_BCOLOR

    +

    Back-facing colors are only used for back-facing polygons, and are only valid +in vertex shader outputs. After rasterization, all polygons are front-facing +and COLOR and BCOLOR end up occupying the same slots in the fragment, so +all BCOLORs effectively become regular COLORs in the fragment shader.

    +
    +
    +

    TGSI_SEMANTIC_FOG

    +

    The fog coordinate historically has been used to replace the depth coordinate +for generation of fog in dedicated fog blocks. Gallium, however, does not use +dedicated fog acceleration, placing it entirely in the fragment shader +instead.

    +

    The fog coordinate should be written in (f, 0, 0, 1) format. Only the first +component matters when writing from the vertex shader; the driver will ensure +that the coordinate is in this format when used as a fragment shader input.

    +
    +
    +

    TGSI_SEMANTIC_PSIZE

    +

    PSIZE, or point size, is used to specify point sizes per-vertex. It should +be in (p, n, x, f) format, where p is the point size, n is the minimum +size, x is the maximum size, and f is the fade threshold.

    +

    XXX this is arb_vp. is this what we actually do? should double-check...

    +

    When using this semantic, be sure to set the appropriate state in the +Rasterizer first.

    +
    +
    +

    TGSI_SEMANTIC_GENERIC

    +

    Generic semantics are nearly always used for texture coordinate attributes, +in (s, t, r, q) format. t and r may be unused for certain kinds +of lookups, and q is the level-of-detail bias for biased sampling.

    +

    These attributes are called “generic” because they may be used for anything +else, including parameters, texture generation information, or anything that +can be stored inside a four-component vector.

    +
    +
    +

    TGSI_SEMANTIC_NORMAL

    +

    XXX no clue.

    +
    +
    +

    TGSI_SEMANTIC_FACE

    +

    FACE is the facing bit, to store the facing information for the fragment +shader. (f, 0, 0, 1) is the format. The first component will be positive +when the fragment is front-facing, and negative when the component is +back-facing.

    +
    +
    +

    TGSI_SEMANTIC_EDGEFLAG

    +

    XXX no clue

    @@ -898,7 +961,15 @@ when the primitive is front facing.

  • Other tokens diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 86c09046f7..12687f29dc 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -1180,11 +1180,92 @@ Declaration Semantic The meanings of the individual semantic names are explained in the following sections. +TGSI_SEMANTIC_POSITION +"""""""""""""""""""""" -FACE -"""" +Position, sometimes known as HPOS or WPOS for historical reasons, is the +location of the vertex in space, in ``(x, y, z, w)`` format. ``x``, ``y``, and ``z`` +are the Cartesian coordinates, and ``w`` is the homogenous coordinate and used +for the perspective divide, if enabled. - Valid only in a fragment shader INPUT declaration. +As a vertex shader output, position should be scaled to the viewport. When +used in fragment shaders, position will --- - FACE.x is negative when the primitive is back facing. FACE.x is positive - when the primitive is front facing. +XXX --- wait a minute. Should position be in [0,1] for x and y? + +XXX additionally, is there a way to configure the perspective divide? it's +accelerated on most chipsets AFAIK... + +Position, if not specified, usually defaults to ``(0, 0, 0, 1)``, and can +be partially specified as ``(x, y, 0, 1)`` or ``(x, y, z, 1)``. + +XXX usually? can we solidify that? + +TGSI_SEMANTIC_COLOR +""""""""""""""""""" + +Colors are used to, well, color the primitives. Colors are always in +``(r, g, b, a)`` format. + +If alpha is not specified, it defaults to 1. + +TGSI_SEMANTIC_BCOLOR +"""""""""""""""""""" + +Back-facing colors are only used for back-facing polygons, and are only valid +in vertex shader outputs. After rasterization, all polygons are front-facing +and COLOR and BCOLOR end up occupying the same slots in the fragment, so +all BCOLORs effectively become regular COLORs in the fragment shader. + +TGSI_SEMANTIC_FOG +""""""""""""""""" + +The fog coordinate historically has been used to replace the depth coordinate +for generation of fog in dedicated fog blocks. Gallium, however, does not use +dedicated fog acceleration, placing it entirely in the fragment shader +instead. + +The fog coordinate should be written in ``(f, 0, 0, 1)`` format. Only the first +component matters when writing from the vertex shader; the driver will ensure +that the coordinate is in this format when used as a fragment shader input. + +TGSI_SEMANTIC_PSIZE +""""""""""""""""""" + +PSIZE, or point size, is used to specify point sizes per-vertex. It should +be in ``(p, n, x, f)`` format, where ``p`` is the point size, ``n`` is the minimum +size, ``x`` is the maximum size, and ``f`` is the fade threshold. + +XXX this is arb_vp. is this what we actually do? should double-check... + +When using this semantic, be sure to set the appropriate state in the +:ref:`rasterizer` first. + +TGSI_SEMANTIC_GENERIC +""""""""""""""""""""" + +Generic semantics are nearly always used for texture coordinate attributes, +in ``(s, t, r, q)`` format. ``t`` and ``r`` may be unused for certain kinds +of lookups, and ``q`` is the level-of-detail bias for biased sampling. + +These attributes are called "generic" because they may be used for anything +else, including parameters, texture generation information, or anything that +can be stored inside a four-component vector. + +TGSI_SEMANTIC_NORMAL +"""""""""""""""""""" + +XXX no clue. + +TGSI_SEMANTIC_FACE +"""""""""""""""""" + +FACE is the facing bit, to store the facing information for the fragment +shader. ``(f, 0, 0, 1)`` is the format. The first component will be positive +when the fragment is front-facing, and negative when the component is +back-facing. + +TGSI_SEMANTIC_EDGEFLAG +"""""""""""""""""""""" + +XXX no clue -- cgit v1.2.3 From b6659681f2ec73026eecafd54bfad72c2712b4dd Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 4 Jan 2010 12:52:43 +0100 Subject: docs: Correct TGSI acronym expansion. --- src/gallium/docs/source/tgsi.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 12687f29dc..12c3680973 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -1,7 +1,7 @@ TGSI ==== -TGSI, Tungsten Graphics Shader Instructions, is an intermediate language +TGSI, Tungsten Graphics Shader Infrastructure, is an intermediate language for describing shaders. Since Gallium is inherently shaderful, shaders are an important part of the API. TGSI is the only intermediate representation used by all drivers. -- cgit v1.2.3 From b3567fc9837cf12c03fe901b01cc4878e007fe52 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 4 Jan 2010 12:59:17 +0100 Subject: docs: Clarify math description of TGSI LRP instruction operation. --- src/gallium/docs/source/tgsi.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 12c3680973..30d74aefd4 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -251,13 +251,13 @@ LRP - Linear Interpolate .. math:: - dst.x = src0.x \times (src1.x - src2.x) + src2.x + dst.x = src0.x \times src1.x + (1 - src0.x) \times src2.x - dst.y = src0.y \times (src1.y - src2.y) + src2.y + dst.y = src0.y \times src1.y + (1 - src0.y) \times src2.y - dst.z = src0.z \times (src1.z - src2.z) + src2.z + dst.z = src0.z \times src1.z + (1 - src0.z) \times src2.z - dst.w = src0.w \times (src1.w - src2.w) + src2.w + dst.w = src0.w \times src1.w + (1 - src0.w) \times src2.w CND - Condition -- cgit v1.2.3 From c929664fdf257ce5e41a70545df72eb2f6b51d92 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 4 Jan 2010 13:12:27 +0100 Subject: docs: TGSI SIN and COS are scalar instructions. --- src/gallium/docs/source/tgsi.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 30d74aefd4..cd84b0289a 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -442,7 +442,7 @@ COS - Cosine dst.z = \cos{src.x} - dst.w = \cos{src.w} + dst.w = \cos{src.x} DDX - Derivative Relative To X @@ -552,7 +552,7 @@ SIN - Sine dst.z = \sin{src.x} - dst.w = \sin{src.w} + dst.w = \sin{src.x} SLE - Set On Less Equal Than -- cgit v1.2.3 From cef218062aeb86bc7564483b3c39d61532d35e48 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 4 Jan 2010 13:15:28 +0100 Subject: docs: Replace bogus `\times' back with `*'. --- src/gallium/docs/source/tgsi.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index cd84b0289a..028ddce839 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -676,7 +676,7 @@ RET - Subroutine Call Return pc = pop() Potential restrictions: - \times Only occurs at end of function. + * Only occurs at end of function. SSG - Set Sign -- cgit v1.2.3 From 07f416cdc9cfdbad6bbeee0cbd826252e93ed26e Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 4 Jan 2010 13:21:32 +0100 Subject: docs: Clarify what truncate means. --- src/gallium/docs/source/tgsi.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 028ddce839..0a3aa4f8c4 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -899,8 +899,6 @@ NOT - Bitwise Not TRUNC - Truncate -XXX how is this different from floor? - .. math:: dst.x = trunc(src.x) @@ -1130,7 +1128,7 @@ Functions round(x) Round x. - trunc(x) Truncate x. + trunc(x) Truncate x, i.e. drop the fraction bits. Keywords -- cgit v1.2.3 From 8ab89d7681b90ba4cf556237fe5d08b706fd11ae Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 4 Jan 2010 13:23:41 +0100 Subject: docs: Fix indent. --- src/gallium/docs/source/tgsi.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 0a3aa4f8c4..492a1b7ea3 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -1054,10 +1054,10 @@ ENDSUB - End Subroutine TBD - NOP - No Operation - Do nothing. + Do nothing. + NRM4 - 4-component Vector Normalise -- cgit v1.2.3 From 86b336f71b21c813a1fa890440553aedcfb08fa7 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 4 Jan 2010 13:38:58 +0100 Subject: docs: Explain TGSI_SEMANTIC_NORMAL. --- src/gallium/docs/source/tgsi.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 492a1b7ea3..ebee4902b0 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -1253,7 +1253,8 @@ can be stored inside a four-component vector. TGSI_SEMANTIC_NORMAL """""""""""""""""""" -XXX no clue. +Vertex normal; could be used to implement per-pixel lighting for legacy APIs +that allow mixing fixed-function and programmable stages. TGSI_SEMANTIC_FACE """""""""""""""""" -- cgit v1.2.3