Hardware Dev Center

Collapse the table of content
Expand the table of content
Expand Minimize
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ps_3_0 Instructions

This section contains reference information for the pixel shader version 3_0 instructions.

There are several types of pixel shader instructions, as shown in the table. Columns to the right mean the following:

  • Instruction slots - Number of instruction slots used by each instruction.
  • Setup - A pixel shader must have a version instruction and it must be the first instruction.
  • Arithmetic - These instructions provide the mathematical operations in a shader.
  • Texture - These instructions are used to load and sample texture data, and to modify texture coordinates.
  • Flow control - These instructions provide static and dynamic flow control to the execution of instructions.
  • New - These instructions are new to this version.

Instruction Set

NameDescriptionInstruction slotsSetupArithmeticTextureFlow controlNew
abs - ps Absolute value1x
add - ps Add two vectors1x
break - ps Break out of a loop...endloop or rep...endrep block1x
break_comp - ps Conditionally break out of a loop...endloop or rep...endrep block, with a comparison3x
breakp - ps break out of a loop...endloop or rep...endrep block, based on a predicate3x
call - ps Call a subroutine2x
callnz bool - ps Call a subroutine if a boolean register is not zero3x
callnz pred - ps Call a subroutine if a predicate register is not zero3x
cmp - ps Compare source to 01x
crs - ps Cross product2x
dcl_samplerType (sm2, sm3 - ps asm) Declare the texture dimension for a sampler0x
dcl_semantics (sm3 - ps asm) Declare input and output registers0xx
def - ps Define constants0x
defb - ps Define a Boolean constant0x
defi - ps Define an integer constant0x
dp2add - ps 2D dot product and add2x
dp3 - ps 3D dot product1x
dp4 - ps 4D dot product1x
dsx - ps Rate of change in the x-direction2x
dsy - ps Rate of change in the y direction2x
else - ps Begin an else block1x
endif - ps End an if...else block1x
endloop - ps End a loop2xx
endrep - ps End of a repeat block2x
exp - ps Full precision 2x1x
frc - ps Fractional component1x
if bool - ps Begin an if block3x
if_comp - ps Begin an if block with a comparison3x
if pred - ps Begin an if block with predication3x
label - ps Label0x
log - ps Full precision log₂(x)1x
loop - ps Loop3xx
lrp - ps Linear interpolate2x
m3x2 - ps 3x2 multiply2x
m3x3 - ps 3x3 multiply3x
m3x4 - ps 3x4 multiply4x
m4x3 - ps 4x3 multiply3x
m4x4 - ps 4x4 multiply4x
mad - ps Multiply and add1x
max - ps Maximum1x
min - ps Minimum1x
mov - ps Move1x
mul - ps Multiply1x
nop - ps No operation1x
nrm - ps Normalize3x
pow - ps xy3x
ps Version0x
rcp - ps Reciprocal1x
rep - ps Repeat3x
ret - ps End of a subroutine1x
rsq - ps Reciprocal square root1x
setp_comp Set the predicate register1x
sincos - ps Sine and cosine8x
sub - ps Subtract1x
texkill - ps Kill pixel render2x
texld - ps_2_0 and up Sample a textureSee note 1x
texldb - ps Texture sampling with level-of-detail bias from w-component6x
texldl - ps Texture sampling with level-of-detail from w-componentSee note 2xx
texldd - ps Texture sampling with user-provided gradients3x
texldp - ps Texture sampling with projective divide by w-componentSee note 3x

 

Notes:

  1. If the texture is a cube map, slots = 4; otherwise slots = 1.
  2. If the texture is a cube map, slots = 5; otherwise slots = 2.
  3. If the texture is a cube map, slots = 4; otherwise slots = 3.

 

 

Community Additions

Show:
© 2015 Microsoft