STP : Set Texture Phase

Format

SPA 5.0:
           STP{.WAIT}{.phase}   #Imm08   {&req_6}   {?sched}   ;   

  .WAIT:   In earlier architectures this modifier made STP wait for the current texture hash.  This behavior is always implied 
           in SM3.0, with or without the modifier.

  .phase:  Allows control on the current warps texture hash, used for scheduling.  If either option is used, 
           the Imm08 is ignored.
               .T - postfix increment of the 3 bit texture componenet of the hash.  
               .P - postfix increment of the 5 bit phase componenent, and zero out the 3 bit texture component of the hash. 

  .phase:      { .T, .P }

Description

To encourage coherence in texture (and other cached memory) requests, there is a texture phase. A shader program may be divided up into phases allowing the the hw to execute multiple non-dependent memory requests in one phase across multiple warps before moving on to the next dependent phase.

Phasing is explained in the programming guide under Texture Phasing

STP waits for the current texture hash, just like other texture operations. Once the SM's texture hash matches the current warp's, the current STP will be issuable.

If no phase is specified, the current phase.tex portion of the texture hash will be set to the Imm08 value.

Note that all texture instructions support the .T and .P postfix increments of texture and phase. STP allows setting of the hash explicitly, and makes it possible to use the texture phasing implementation to cohere with non-texture instructions.

Examples:

# [beginning of pixel shader] 
STP 0x4 # start phase 4 
<.. math ops ..>
TEX
TEX
TEX
STP 0x5 # end phase 4, start phase 5 
<.. math ops ..>
TEX
TEX
STP 0x0 # end phase 5, start phase 0 
<.. math ops ..>
EXIT

Back to Index of Instructions