pub enum Opcode {
Show 82 variants
Nop,
Mov,
Add,
Sub,
Mad,
Mul,
Rcp,
Rsq,
Dp3,
Dp4,
Min,
Max,
Slt,
Sge,
Exp,
Log,
Lit,
Dst,
Lrp,
Frc,
M4x4,
M4x3,
M3x4,
M3x3,
M3x2,
Call,
CallNz,
Loop,
Ret,
EndLoop,
Label,
Dcl,
Pow,
Crs,
Sgn,
Abs,
Nrm,
SinCos,
Rep,
EndRep,
If,
IfC,
Else,
EndIf,
Break,
BreakC,
Mova,
DefB,
DefI,
TexCoord,
TexKill,
Tex,
TexBem,
TexBemL,
TexReg2Ar,
TexReg2Gb,
TexM3x2Pad,
TexM3x2Tex,
TexM3x3Pad,
TexM3x3Tex,
TexM3x3Spec,
TexM3x3VSpec,
ExpP,
LogP,
Cnd,
Def,
TexReg2Rgb,
TexDp3Tex,
TexM3x2Depth,
TexDp3,
TexM3x3,
TexDepth,
Cmp,
Bem,
Dp2Add,
Dsx,
Dsy,
TexLdd,
SetP,
TexLdl,
BreakP,
Phase,
}Expand description
An instruction opcode: the low 16 bits of an instruction token. The variants carry the token value
(Opcode::code) and the assembler’s name (Opcode::name); declarations (dcl), definitions (def, defi,
defb), comments and end are opcodes of the stream as well but are read into their own records.
Variants§
Nop
nop (0).
Mov
mov (1).
Add
add (2).
Sub
sub (3).
Mad
mad (4).
Mul
mul (5).
Rcp
rcp (6).
Rsq
rsq (7).
Dp3
dp3 (8).
Dp4
dp4 (9).
Min
min (10).
Max
max (11).
Slt
slt (12).
Sge
sge (13).
Exp
exp (14).
Log
log (15).
Lit
lit (16).
Dst
dst (17).
Lrp
lrp (18).
Frc
frc (19).
M4x4
m4x4 (20).
M4x3
m4x3 (21).
M3x4
m3x4 (22).
M3x3
m3x3 (23).
M3x2
m3x2 (24).
Call
call (25): its source is the label lN.
CallNz
callnz (26): a label, then the boolean constant bN or the predicate p0 it tests.
Loop
loop (27): the loop counter aL, then the integer constant iN of its start, count and step.
Ret
ret (28).
EndLoop
endloop (29).
Label
label (30): its source is the label lN.
Dcl
dcl (31), read into a crate::Declaration.
Pow
pow (32).
Crs
crs (33).
Sgn
sgn (34): three sources in Shader Model 2, one in 3.
Abs
abs (35).
Nrm
nrm (36).
SinCos
sincos (37): three sources in Shader Model 2 (the angle and the two D3DSINCOSCONST registers), one in 3.
Rep
rep (38): its source is the integer constant iN whose x lane is the count.
EndRep
endrep (39).
If
if (40): its source is the boolean constant bN or the predicate p0.
IfC
if_comp (41): two sources compared as crate::Instruction::comparison says.
Else
else (42).
EndIf
endif (43).
Break
break (44).
BreakC
break_comp (45): two sources compared as crate::Instruction::comparison says.
Mova
mova (46).
DefB
defb (47), read into a crate::Definition.
DefI
defi (48), read into a crate::Definition.
TexCoord
texcoord (64) before pixel 1.4, texcrd in 1.4.
TexKill
texkill (65): its destination token names the register tested.
Tex
tex (66) before pixel 1.4, texld from 1.4 on (texldp and texldb by crate::Instruction::control).
TexBem
texbem (67).
TexBemL
texbeml (68).
TexReg2Ar
texreg2ar (69).
TexReg2Gb
texreg2gb (70).
TexM3x2Pad
texm3x2pad (71).
TexM3x2Tex
texm3x2tex (72).
TexM3x3Pad
texm3x3pad (73).
TexM3x3Tex
texm3x3tex (74).
TexM3x3Spec
texm3x3spec (76).
TexM3x3VSpec
texm3x3vspec (77).
ExpP
expp (78).
LogP
logp (79).
Cnd
cnd (80).
Def
def (81), read into a crate::Definition.
TexReg2Rgb
texreg2rgb (82).
TexDp3Tex
texdp3tex (83).
TexM3x2Depth
texm3x2depth (84).
TexDp3
texdp3 (85).
TexM3x3
texm3x3 (86).
TexDepth
texdepth (87).
Cmp
cmp (88).
Bem
bem (89).
Dp2Add
dp2add (90).
Dsx
dsx (91).
Dsy
dsy (92).
TexLdd
texldd (93).
SetP
setp_comp (94): its destination is the predicate p0, its two sources compared as
crate::Instruction::comparison says.
TexLdl
texldl (95).
BreakP
breakp (96): its source is the predicate p0.
Phase
phase (0xfffd): the boundary between the two phases of a pixel 1.4 program.
Implementations§
Source§impl Opcode
impl Opcode
Sourcepub fn name(self) -> &'static str
pub fn name(self) -> &'static str
The assembler’s name of the opcode, as d3d9types.h names it in lower case (if_comp for IFC, setp_comp
for SETP; tex and texcoord whatever the version, which the assembler spells texld and texcrd from
pixel 1.4 on).
Sourcepub fn from_code(code: u16) -> Option<Self>
pub fn from_code(code: u16) -> Option<Self>
The opcode of a token value, None for a value Direct3D 9 does not define (75, the reserved texm3x3diff,
among them).
Sourcepub fn in_version(self, version: Version) -> bool
pub fn in_version(self, version: Version) -> bool
True when the opcode is an instruction of version.