ATI CTM Guide v. 1.01
© 2006 Advanced Micro Devices, Inc.
32 Texture Instructions
3.3.10
ALU Result
Every instruction has an "ALU result." In order to use it, an ALU instruction must write an ALU result, and it must
be consumed by the next flow control instruction. The ALU result is preserved across other ALU/texture instructions
that do not write a new ALU result, but is NOT preserved across flow control instructions; therefore the ALU result
must be consumed by the first flow control statement after it is written.
The ALU result is a single bit. The channel source for the ALU result is selected by the ALU_RESULT_SEL field:
• ALU_RESULT_SEL_RED
• ALU_RESULT_SEL_ALPHA
How to interpret the floating point result to set the ALU result bit is specified by the ALU_RESULT_OP field, which
is similar to the interpretation of the TARGET field for setting the predicate bits:
• ALU_RESULT_OP_EQUAL - Set when channel is zero
• ALU_RESULT_OP_LESS - Set when channel is negative
• ALU_RESULT_OP_GREATER_EQUAL - Set when channel is non-negative
• ALU_RESULT_OP_NOT_EQUAL - Set when channel is non-zero
The ALU instruction that updates the ALU result must set the ALU_WMASK bit.
If the instruction result is clamped, the comparison happens on the post-clamped result. If output modifier is disabled,
denormals may be compared—denormals are equivalent to zero.
3.4
Texture Instructions
Texture instructions are simpler than ALU or flow control instructions. Texture instructions have one destination
temporary address, 1 to 3 source temporary addresses, a sampler ID, and an opcode and control bits specifying how
to lookup the texture.
As with ALU temporary addresses, the loop variable (aL) may be added to any texture temporary address (source and
destination). Texture source addresses allow arbitrary swizzles from RGBA to STRQ coordinate space, and the
RGBA result from the texture unit may also be swizzled. Unlike with ALU instructions, the texture swizzles cannot
be used to select constant inputs (0, 0.5, 1). Texture source addresses always read from the temporary registers; they
cannot read from the constant bank.
Texture instructions feature a texture semaphore mechanism to synchronize texture lookup with instructions using the
result of the lookup. See below for more information.
You may choose to limit which channels of a texture lookup are written by using the write masks RGB_WMASK and
ALPHA_WMASK. These write masks may be predicated; the RGB results from the texture unit are predicated with
RGB_PRED_SEL and RGB_PRED_INV, while the alpha result from the texture unit is predicated with
ALPHA_PRED_SEL and ALPHA_PRED_INV.
Texture instructions have an UNSCALED bit that control whether the texture coordinates are scaled by the texture
dimensions before lookup. In typical usage, this bit is cleared for normal texture lookups which supply coordinates in
the range [0.0, 1.0], and set for texture lookups which supply coordinates that are prescaled to the texture dimensions.
Uncached reads (used for UMRT) should set the UNSCALED bit: the coordinates supplied to the program are
prescaled, and the index coordinate should always be an integer value.
Содержание ATI CTM
Страница 1: ...ATI CTM Guide Technical Reference Manual Version 1 01...
Страница 6: ...ATI CTM Guide v 1 01 2006 Advanced Micro Devices Inc 2 Related Documents...
Страница 48: ...ATI CTM Guide v 1 01 2006 Advanced Micro Devices Inc 44 Errata...
Страница 54: ...ATI CTM Guide v 1 01 2006 Advanced Micro Devices Inc 50 Executable Files...