summaryrefslogtreecommitdiffstats
path: root/src/gallium/docs/source/tgsi.rst
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2012-04-30 19:08:55 +0200
committerFrancisco Jerez <[email protected]>2012-05-11 12:39:41 +0200
commit82c90b2da8e236bc134cb2bd0ec4e09551b12164 (patch)
tree7e6fd5e47737a52c438700bc6734f4da61d1ef09 /src/gallium/docs/source/tgsi.rst
parenta4ebb04214bab1cd9bd41967232ec89441e31744 (diff)
gallium/tgsi: Add support for raw resources.
Normal resource access (e.g. the LOAD TGSI opcode) is supposed to perform a series of conversions to turn the texture data as it's found in memory into the target data type. In compute programs it's often the case that we only want to access the raw bits as they're stored in some buffer object, and any kind of channel conversion and scaling is harmful or inefficient, especially in implementations that lack proper hardware support to take care of it -- in those cases the conversion has to be implemented in software and it's likely to result in a performance hit even if the pipe_buffer and declaration data types are set up in a way that would just pass the data through. Add a declaration flag that marks a resource as typeless. No channel conversion will be performed in that case, and the X coordinate of the address vector will be interpreted in byte units instead of elements for obvious reasons. This is similar to D3D11's ByteAddressBuffer, and will be used to implement OpenCL's constant arguments. The remaining four compute memory spaces can also be understood as raw resources.
Diffstat (limited to 'src/gallium/docs/source/tgsi.rst')
-rw-r--r--src/gallium/docs/source/tgsi.rst15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 6a1cb7e2e2c..eb8be46e354 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -1745,7 +1745,7 @@ Declaration Resource
Follows Declaration token if file is TGSI_FILE_RESOURCE.
- DCL RES[#], resource
+ DCL RES[#], resource [, RAW]
Declares a shader input resource and assigns it to a RES[#]
register.
@@ -1753,6 +1753,19 @@ Declaration Resource
resource can be one of BUFFER, 1D, 2D, 3D, CUBE, 1DArray and
2DArray.
+ If the RAW keyword is not specified, the texture data will be
+ subject to conversion, swizzling and scaling as required to yield
+ the specified data type from the physical data format of the bound
+ resource.
+
+ If the RAW keyword is specified, no channel conversion will be
+ performed: the values read for each of the channels (X,Y,Z,W) will
+ correspond to consecutive words in the same order and format
+ they're found in memory. No element-to-address conversion will be
+ performed either: the value of the provided X coordinate will be
+ interpreted in byte units instead of texel units. The result of
+ accessing a misaligned address is undefined.
+
Properties
^^^^^^^^^^^^^^^^^^^^^^^^