summaryrefslogtreecommitdiffstats
path: root/src/gallium/docs/source/tgsi.rst
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2013-09-21 18:45:43 +1000
committerDave Airlie <[email protected]>2014-02-25 13:29:17 +1000
commit2fcbec48d78af2cd03138feb83e63e439a4b6a60 (patch)
tree3d6a39c65d50b4aa5953fae347838d2294e3e71d /src/gallium/docs/source/tgsi.rst
parent122c3b9486d3dbf8cb6b796c9a25f43817f006d3 (diff)
gallium: add texture gather support to gallium (v3)
This adds support to gallium for a TG4 instruction, and two CAPs. The first CAP is required for GL_ARB_texture_gather. The second CAP is required to expose GL_ARB_gpu_shader5. However so far we haven't found any hardware that natively exposes the textureGatherOffsets feature from GL, so just lower it for now. If hardware appears for this we can add another CAP to allow TG4 to take 4 offsets. v2: add component selection src and a cap to say hw can do it. (st can use to help control GL_ARB_gpu_shader5/GLSL 4.00). Add docs. v3: rename to SM5, add docs. Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/docs/source/tgsi.rst')
-rw-r--r--src/gallium/docs/source/tgsi.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index be4257255b3..03c5df846f7 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -986,6 +986,42 @@ XXX doesn't look like most of the opcodes really belong here.
dst.z = texture_depth(unit, lod)
+.. opcode:: TG4 - Texture Gather (as per ARB_texture_gather)
+ Gathers the four texels to be used in a bi-linear
+ filtering operation and packs them into a single register.
+ Only works with 2D, 2D array, cubemaps, and cubemaps arrays.
+ For 2D textures, only the addressing modes of the sampler and
+ the top level of any mip pyramid are used. Set W to zero.
+ It behaves like the TEX instruction, but a filtered
+ sample is not generated. The four samples that contribute
+ to filtering are placed into xyzw in clockwise order,
+ starting with the (u,v) texture coordinate delta at the
+ following locations (-, +), (+, +), (+, -), (-, -), where
+ the magnitude of the deltas are half a texel.
+
+ PIPE_CAP_TEXTURE_SM5 enhances this instruction to support
+ shadow per-sample depth compares, single component selection,
+ and a non-constant offset. It doesn't allow support for the
+ GL independent offset to get i0,j0. This would require another
+ CAP is hw can do it natively. For now we lower that before
+ TGSI.
+
+.. math::
+
+ coord = src0
+
+ component = src1
+
+ dst = texture_gather4 (unit, coord, component)
+
+(with SM5 - cube array shadow)
+
+ coord = src0
+
+ compare = src1
+
+ dst = texture_gather (uint, coord, compare)
+
Integer ISA
^^^^^^^^^^^^^^^^^^^^^^^^