summaryrefslogtreecommitdiffstats
path: root/src/libs/dxvk-native-1.9.2a/src/dxso/dxso_enums.h
blob: 84f2e5b73f89faee97eb0a620f51757c6103e16a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#pragma once

#include "dxso_include.h"

#include <cstdint>

namespace dxvk {

  /**
   * \brief Instruction code listing
   */
  enum class DxsoOpcode : uint32_t {
    Nop          = 0,
    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     = 64,
    TexKill      ,
    Tex          ,
    TexBem       ,
    TexBemL      ,
    TexReg2Ar    ,
    TexReg2Gb    ,
    TexM3x2Pad   ,
    TexM3x2Tex   ,
    TexM3x3Pad   ,
    TexM3x3Tex   ,
    Reserved0    ,
    TexM3x3Spec  ,
    TexM3x3VSpec ,
    ExpP         ,
    LogP         ,
    Cnd          ,
    Def          ,
    TexReg2Rgb   ,
    TexDp3Tex    ,
    TexM3x2Depth ,
    TexDp3       ,
    TexM3x3      ,
    TexDepth     ,
    Cmp          ,
    Bem          ,
    Dp2Add       ,
    DsX          ,
    DsY          ,
    TexLdd       ,
    SetP         ,
    TexLdl       ,
    BreakP       ,

    Phase        = 0xfffd,
    Comment      = 0xfffe,
    End          = 0xffff
  };

  std::ostream& operator << (std::ostream& os, DxsoOpcode opcode);

  enum class DxsoRegisterType : uint32_t {
    Temp           =  0, // Temporary Register File
    Input          =  1, // Input Register File
    Const          =  2, // Constant Register File
    Addr           =  3, // Address Register (VS)
    Texture        =  3, // Texture Register File (PS)
    RasterizerOut  =  4, // Rasterizer Register File
    AttributeOut   =  5, // Attribute Output Register File
    TexcoordOut    =  6, // Texture Coordinate Output Register File
    Output         =  6, // Output register file for VS3.0+
    ConstInt       =  7, // Constant Integer Vector Register File
    ColorOut       =  8, // Color Output Register File
    DepthOut       =  9, // Depth Output Register File
    Sampler        = 10, // Sampler State Register File
    Const2         = 11, // Constant Register File  2048 - 4095
    Const3         = 12, // Constant Register File  4096 - 6143
    Const4         = 13, // Constant Register File  6144 - 8191
    ConstBool      = 14, // Constant Boolean register file
    Loop           = 15, // Loop counter register file
    TempFloat16    = 16, // 16-bit float temp register file
    MiscType       = 17, // Miscellaneous (single) registers.
    Label          = 18, // Label
    Predicate      = 19, // Predicate register
    PixelTexcoord  = 20
  };

  enum class DxsoUsage : uint32_t {
    Position        = 0,
    BlendWeight,   // 1
    BlendIndices,  // 2
    Normal,        // 3
    PointSize,     // 4
    Texcoord,      // 5
    Tangent,       // 6
    Binormal,      // 7
    TessFactor,    // 8
    PositionT,     // 9
    Color,         // 10
    Fog,           // 11
    Depth,         // 12
    Sample,        // 13
  };

  enum class DxsoTextureType : uint32_t {
    Texture2D   = 2,
    TextureCube = 3,
    Texture3D   = 4
  };

  enum DxsoReasterizerOutIndices : uint32_t {
    RasterOutPosition  = 0,
    RasterOutFog       = 1,
    RasterOutPointSize = 2
  };

  enum DxsoMiscTypeIndices : uint32_t {
    MiscTypePosition,
    MiscTypeFace,
  };

}