TLD : Texture Load

Format

SPA 5.0:
{@{!}Pg} TLD{.B}.lod{.AOFFI}{.MS}{.CL}{.NODEP}{.phase} {Ps, } Rd, Ra{, Rb}, #tsPtrIdxU13, #paramA{, #wmskU04} {&req_6} {&rdN} {&wrN} {?sched} ; .B: Bindless mode, where the texture header pointer and sampler pointer is packed into a 32 bit register as: samplerPtr[31:20] | headerPtr[19:0]// sampler is not used in this instruction Data is sent via register Rb. .lod: LOD adjust mode. .LZ - LOD level 0 (finest) // no register required .LL - LOD absolute // 1 U32 register required\ LOD Level 0 actually selects the level set by textureHeader.resViewMinMapLevel. .AOFFI: Programmable Texture Offset. _aoffimmi(u,v,w) [DX10] // 1 register required ((w & 0xf)<<8) | ((v & 0xf)<<4) | (u & 0xf) Each 4b field is a 2's complement integer from -8 to +7. .MS: Programmable Multisample location. .MS can only be used with the .LZ LOD option, and 2D/ARRAY_2D textures. .MS cannot be combined with .CL Multisample location // 1 U32 register required .CL: Enable edge clamp (feature added for video). Normally, per dx10, TLD will return black border color for an out-of-range coordinate or out-of-range array index. When TLD.CL is specified, edge clamping is forced ON. Note that in neither case is the sampler clamping state observed. Note that for 1D-array and 2D-array cases, the array index will also be clamped to [0..array_size-1] when .CL is requested .CL cannot be combined with .MS .NODEP: Indicates that there is no subsequent quad derivatives to be calculated. Threads that have been "killed" will be disabled to stop unnecessary texture fetches.

.phase: Allows control on the current warps texture hash, used for scheduling.
< NONE >
.T - postfix increment of the 3 bit texture component of the hash.
.P - postfix increment of the 5 bit phase component, and zero out the 3 bit texture component of the hash.

Ps:
Predicate returning sparse tile status. Indicate that the surface access is happening to a page marked as sparse (valid, not mapped).


Immediate Inputs:

#tsPtrIdxU13:
This immediate index (word address) is used to fetch the packed header+sampler pointer entry from constant cache. The bank from
which it is fetched is determined by bundle state. The constant bank entry is 32 bit structure of the form
"samplerPtr[31:20] | headerPtr[19:0]". Only headerPtr is used by this instruction.
Note: Ignored if .B option is used.
Any header pointer greater than one specified in SetTexHeaderPoolC.MaximumIndex will be regarded as an "invalid"
texture (i.e. equivalent to BIND_GROUP_TEXTURE_HEADER_VALID_FALSE in fermi).
#paramA: source coordinate description.
Valid paramA specifiers for TLD
parameterCoordinate Registers implied
1Ds
2Ds,t
3Ds,t,r
RESERVED// for CUBE
ARRAY_1Da,s
ARRAY_2Da,s,t
RESERVED// for ARRAY_3D
RESERVED// for ARRAY_CUBE
           s,t,r are S32, 
a is U16 integer
     If the source coordinate description does not match the texture type of the texture header,
zeroes will be returned. The array specifiers can be freely used with non-array textures
(and the opposite holds as well), provided the number of coordinates (1D,2D,3D) matches.

#wmskU04 destination write mask (decimated contiguous writes)
Allows for write masking the returning data writes via a bit enable
for each of R,G,B,A. A four-vector is always returned from TEX.
#wmskU04 defaults to 0xf.

Description

Texture load (point sample only) using a texture coordinates/parameters packed in Ra/Rb registers. The assignment of parameters to Ra/Rb is as follows:

    Texture parameter packing in Ra and Rb
    Regparameterformat
    Ra+0array[15:0]u32
    Ra+1sS32
    Ra+2tS32
    Ra+3rS32
    Rb+0SamplerPtr[31:20] | HeaderPtr[19:0]u32
    Rb+1LOD (absolute)U32
    Rb+2toff[11:0]u32
    Rb+3Multisample Location(MS)u32

    In the table above, "+0/1/2/3" represents the order of packing parameters in Ra/Rb. If a parameter is not specified, then the rest are compacted upwards within the same Ra or Rb register.

    The texture parameter source registers Ra/Rb and the destination (result) register Rd have alignment restrictions based on the number of scalar registers being read/written. Specifically,

    1. Rd should be aligned to number of valid components being returned (as specified by wmask)
    2. Ra/Rb should always be aligned to
      1. 1 (scalar register) if the scalar count for that register (Ra or Rb) is 1
      2. 2 (vec2 register) if the scalar count for that register (Ra or Rb) is 2
      3. 4 (vec4 register) if the scalar count for that register (Ra or Rb) is 3 or 4
    3. Rb should be specified as RZ if no parameters need to be packed in Rb. (However no error is generated if non-RZ register is specified)
    4. Ra/Rb must not be specified as RZ if any parameters need to be packed in Ra/Rb.

    Some input texture values will be sanitized before being used.

Additional Information:

Corresponds to these DX ops:

   ld        =  TLD                    // load
ld2ms = TLD.MS // load multisample

Texture Header State Overrides

Unlike other texture instructions, TLD overrides a great deal of texture header/sampler state with different values. The following tables show how the texture state will be treated for these instructions

    +--------------------------+--------------------------+
| Header Field | TLD Value |
+--------------------------+--------------------------+
| UseHeaderOptControl | FALSE |
| MaxAnisotropy | ANISO_1_TO_1 |
+--------------------------+--------------------------+

+--------------------------+--------------------------+
| Sampler Field | TLD Value |
+--------------------------+--------------------------+
| MagFiler | MAG_POINT |
| MinFilter | MIN_POINT |
| MipFilter | MIP_POINT |
| MaxAnisotropy | ANISO_1_TO_1 |
| BorderColorR | 0 |
| BorderColorG | 0 |
| BorderColorB | 0 |
| BorderColorA | 0 |
| sRGBBorderColorR | 0 |
| sRGBBorderColorR | 0 |
| sRGBBorderColorR | 0 |
| sRGBBorderColorR | 0 |
| DepthCompare | FALSE |
+--------------------------+--------------------------+

The following texture sampler fields have their values overriden based on the presence of the TLD.CL opcode extension.

    +--------------------------+--------------------------+--------------------------+
| Sampler Field | TLD Value | TLD.CL Value |
+--------------------------+--------------------------+--------------------------+
| AddressU | BORDER | CLAMP_TO_EDGE |
| AddressV | BORDER | CLAMP_TO_EDGE |
| AddressO | BORDER | CLAMP_TO_EDGE |
+--------------------------+--------------------------+--------------------------+

Examples:

TLD.LZ     R0, R4, 0, 2D, 0xf;
TLD.LZ.MS R0, R4, R6, 0, 2D, 0xf;

Back to Index of Instructions