gallium/tgsi: Add resource write-back support.

Define a new STORE opcode with a role dual to the LOAD opcode, and add
flags to specify that a shader resource is intended for writing.
This commit is contained in:
Francisco Jerez
2012-04-30 20:20:29 +02:00
parent 82c90b2da8
commit b8e808f1ef
8 changed files with 45 additions and 4 deletions

View File

@@ -134,7 +134,8 @@ the ``level``, ``first_layer`` and ``last_layer`` pipe_surface fields
specify the mipmap level and the range of layers the texture will be
constrained to. In the case of buffers, ``first_element`` and
``last_element`` specify the range within the buffer that will be used
by the shader resource.
by the shader resource. Writes to a shader resource are only allowed
when the ``writable`` flag is set.
Surfaces
^^^^^^^^

View File

@@ -1490,6 +1490,29 @@ Resource Access Opcodes
texture arrays and 2D textures. address.w is always
ignored.
.. opcode:: STORE - Write data to a shader resource
Syntax: ``STORE resource, address, src``
Example: ``STORE RES[0], TEMP[0], TEMP[1]``
Using the provided integer address, STORE writes data
to the specified buffer or texture.
The 'address' is specified as a vector of unsigned
integers. If the 'address' is out of range the result
is unspecified.
Only the first mipmap level of a resource can be
written to using this instruction.
For 1D or 2D texture arrays, the array index is
provided as an unsigned integer in address.y or
address.z, respectively. address.yz are ignored for
buffers and 1D textures. address.z is ignored for 1D
texture arrays and 2D textures. address.w is always
ignored.
Explanation of symbols used
------------------------------
@@ -1745,7 +1768,7 @@ Declaration Resource
Follows Declaration token if file is TGSI_FILE_RESOURCE.
DCL RES[#], resource [, RAW]
DCL RES[#], resource [, WR] [, RAW]
Declares a shader input resource and assigns it to a RES[#]
register.
@@ -1766,6 +1789,9 @@ Declaration Resource
interpreted in byte units instead of texel units. The result of
accessing a misaligned address is undefined.
Usage of the STORE opcode is only allowed if the WR (writable) flag
is set.
Properties
^^^^^^^^^^^^^^^^^^^^^^^^