1b8e80941Smrg/**********************************************************
2b8e80941Smrg * Copyright 2007-2015 VMware, Inc.  All rights reserved.
3b8e80941Smrg *
4b8e80941Smrg * Permission is hereby granted, free of charge, to any person
5b8e80941Smrg * obtaining a copy of this software and associated documentation
6b8e80941Smrg * files (the "Software"), to deal in the Software without
7b8e80941Smrg * restriction, including without limitation the rights to use, copy,
8b8e80941Smrg * modify, merge, publish, distribute, sublicense, and/or sell copies
9b8e80941Smrg * of the Software, and to permit persons to whom the Software is
10b8e80941Smrg * furnished to do so, subject to the following conditions:
11b8e80941Smrg *
12b8e80941Smrg * The above copyright notice and this permission notice shall be
13b8e80941Smrg * included in all copies or substantial portions of the Software.
14b8e80941Smrg *
15b8e80941Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16b8e80941Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17b8e80941Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18b8e80941Smrg * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19b8e80941Smrg * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20b8e80941Smrg * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21b8e80941Smrg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22b8e80941Smrg * SOFTWARE.
23b8e80941Smrg *
24b8e80941Smrg **********************************************************/
25b8e80941Smrg
26b8e80941Smrg/*
27b8e80941Smrg * VGPU10ShaderTokens.h --
28b8e80941Smrg *
29b8e80941Smrg *    VGPU10 shader token definitions.
30b8e80941Smrg *
31b8e80941Smrg */
32b8e80941Smrg
33b8e80941Smrg#ifndef VGPU10SHADERTOKENS_H
34b8e80941Smrg#define VGPU10SHADERTOKENS_H
35b8e80941Smrg
36b8e80941Smrg/* Shader limits */
37b8e80941Smrg#define VGPU10_MAX_VS_INPUTS 16
38b8e80941Smrg#define VGPU10_MAX_VS_OUTPUTS 16
39b8e80941Smrg#define VGPU10_MAX_GS_INPUTS 16
40b8e80941Smrg#define VGPU10_MAX_GS_OUTPUTS 32
41b8e80941Smrg#define VGPU10_MAX_FS_INPUTS 32
42b8e80941Smrg#define VGPU10_MAX_FS_OUTPUTS 8
43b8e80941Smrg#define VGPU10_MAX_TEMPS 4096
44b8e80941Smrg#define VGPU10_MAX_CONSTANT_BUFFERS 14
45b8e80941Smrg#define VGPU10_MAX_CONSTANT_BUFFER_ELEMENT_COUNT 4096
46b8e80941Smrg#define VGPU10_MAX_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT 4096
47b8e80941Smrg#define VGPU10_MAX_SAMPLERS 16
48b8e80941Smrg#define VGPU10_MAX_RESOURCES 128
49b8e80941Smrg#define VGPU10_MIN_TEXEL_FETCH_OFFSET -8
50b8e80941Smrg#define VGPU10_MAX_TEXEL_FETCH_OFFSET 7
51b8e80941Smrg
52b8e80941Smrgtypedef enum {
53b8e80941Smrg   VGPU10_PIXEL_SHADER = 0,
54b8e80941Smrg   VGPU10_VERTEX_SHADER = 1,
55b8e80941Smrg   VGPU10_GEOMETRY_SHADER = 2
56b8e80941Smrg} VGPU10_PROGRAM_TYPE;
57b8e80941Smrg
58b8e80941Smrgtypedef union {
59b8e80941Smrg   struct {
60b8e80941Smrg      unsigned int minorVersion  : 4;
61b8e80941Smrg      unsigned int majorVersion  : 4;
62b8e80941Smrg      unsigned int               : 8;
63b8e80941Smrg      unsigned int programType   : 16; /* VGPU10_PROGRAM_TYPE */
64b8e80941Smrg   };
65b8e80941Smrg   uint32 value;
66b8e80941Smrg} VGPU10ProgramToken;
67b8e80941Smrg
68b8e80941Smrg
69b8e80941Smrgtypedef enum {
70b8e80941Smrg   VGPU10_OPCODE_ADD                               = 0,
71b8e80941Smrg   VGPU10_OPCODE_AND                               = 1,
72b8e80941Smrg   VGPU10_OPCODE_BREAK                             = 2,
73b8e80941Smrg   VGPU10_OPCODE_BREAKC                            = 3,
74b8e80941Smrg   VGPU10_OPCODE_CALL                              = 4,
75b8e80941Smrg   VGPU10_OPCODE_CALLC                             = 5,
76b8e80941Smrg   VGPU10_OPCODE_CASE                              = 6,
77b8e80941Smrg   VGPU10_OPCODE_CONTINUE                          = 7,
78b8e80941Smrg   VGPU10_OPCODE_CONTINUEC                         = 8,
79b8e80941Smrg   VGPU10_OPCODE_CUT                               = 9,
80b8e80941Smrg   VGPU10_OPCODE_DEFAULT                           = 10,
81b8e80941Smrg   VGPU10_OPCODE_DERIV_RTX                         = 11,
82b8e80941Smrg   VGPU10_OPCODE_DERIV_RTY                         = 12,
83b8e80941Smrg   VGPU10_OPCODE_DISCARD                           = 13,
84b8e80941Smrg   VGPU10_OPCODE_DIV                               = 14,
85b8e80941Smrg   VGPU10_OPCODE_DP2                               = 15,
86b8e80941Smrg   VGPU10_OPCODE_DP3                               = 16,
87b8e80941Smrg   VGPU10_OPCODE_DP4                               = 17,
88b8e80941Smrg   VGPU10_OPCODE_ELSE                              = 18,
89b8e80941Smrg   VGPU10_OPCODE_EMIT                              = 19,
90b8e80941Smrg   VGPU10_OPCODE_EMITTHENCUT                       = 20,
91b8e80941Smrg   VGPU10_OPCODE_ENDIF                             = 21,
92b8e80941Smrg   VGPU10_OPCODE_ENDLOOP                           = 22,
93b8e80941Smrg   VGPU10_OPCODE_ENDSWITCH                         = 23,
94b8e80941Smrg   VGPU10_OPCODE_EQ                                = 24,
95b8e80941Smrg   VGPU10_OPCODE_EXP                               = 25,
96b8e80941Smrg   VGPU10_OPCODE_FRC                               = 26,
97b8e80941Smrg   VGPU10_OPCODE_FTOI                              = 27,
98b8e80941Smrg   VGPU10_OPCODE_FTOU                              = 28,
99b8e80941Smrg   VGPU10_OPCODE_GE                                = 29,
100b8e80941Smrg   VGPU10_OPCODE_IADD                              = 30,
101b8e80941Smrg   VGPU10_OPCODE_IF                                = 31,
102b8e80941Smrg   VGPU10_OPCODE_IEQ                               = 32,
103b8e80941Smrg   VGPU10_OPCODE_IGE                               = 33,
104b8e80941Smrg   VGPU10_OPCODE_ILT                               = 34,
105b8e80941Smrg   VGPU10_OPCODE_IMAD                              = 35,
106b8e80941Smrg   VGPU10_OPCODE_IMAX                              = 36,
107b8e80941Smrg   VGPU10_OPCODE_IMIN                              = 37,
108b8e80941Smrg   VGPU10_OPCODE_IMUL                              = 38,
109b8e80941Smrg   VGPU10_OPCODE_INE                               = 39,
110b8e80941Smrg   VGPU10_OPCODE_INEG                              = 40,
111b8e80941Smrg   VGPU10_OPCODE_ISHL                              = 41,
112b8e80941Smrg   VGPU10_OPCODE_ISHR                              = 42,
113b8e80941Smrg   VGPU10_OPCODE_ITOF                              = 43,
114b8e80941Smrg   VGPU10_OPCODE_LABEL                             = 44,
115b8e80941Smrg   VGPU10_OPCODE_LD                                = 45,
116b8e80941Smrg   VGPU10_OPCODE_LD_MS                             = 46,
117b8e80941Smrg   VGPU10_OPCODE_LOG                               = 47,
118b8e80941Smrg   VGPU10_OPCODE_LOOP                              = 48,
119b8e80941Smrg   VGPU10_OPCODE_LT                                = 49,
120b8e80941Smrg   VGPU10_OPCODE_MAD                               = 50,
121b8e80941Smrg   VGPU10_OPCODE_MIN                               = 51,
122b8e80941Smrg   VGPU10_OPCODE_MAX                               = 52,
123b8e80941Smrg   VGPU10_OPCODE_CUSTOMDATA                        = 53,
124b8e80941Smrg   VGPU10_OPCODE_MOV                               = 54,
125b8e80941Smrg   VGPU10_OPCODE_MOVC                              = 55,
126b8e80941Smrg   VGPU10_OPCODE_MUL                               = 56,
127b8e80941Smrg   VGPU10_OPCODE_NE                                = 57,
128b8e80941Smrg   VGPU10_OPCODE_NOP                               = 58,
129b8e80941Smrg   VGPU10_OPCODE_NOT                               = 59,
130b8e80941Smrg   VGPU10_OPCODE_OR                                = 60,
131b8e80941Smrg   VGPU10_OPCODE_RESINFO                           = 61,
132b8e80941Smrg   VGPU10_OPCODE_RET                               = 62,
133b8e80941Smrg   VGPU10_OPCODE_RETC                              = 63,
134b8e80941Smrg   VGPU10_OPCODE_ROUND_NE                          = 64,
135b8e80941Smrg   VGPU10_OPCODE_ROUND_NI                          = 65,
136b8e80941Smrg   VGPU10_OPCODE_ROUND_PI                          = 66,
137b8e80941Smrg   VGPU10_OPCODE_ROUND_Z                           = 67,
138b8e80941Smrg   VGPU10_OPCODE_RSQ                               = 68,
139b8e80941Smrg   VGPU10_OPCODE_SAMPLE                            = 69,
140b8e80941Smrg   VGPU10_OPCODE_SAMPLE_C                          = 70,
141b8e80941Smrg   VGPU10_OPCODE_SAMPLE_C_LZ                       = 71,
142b8e80941Smrg   VGPU10_OPCODE_SAMPLE_L                          = 72,
143b8e80941Smrg   VGPU10_OPCODE_SAMPLE_D                          = 73,
144b8e80941Smrg   VGPU10_OPCODE_SAMPLE_B                          = 74,
145b8e80941Smrg   VGPU10_OPCODE_SQRT                              = 75,
146b8e80941Smrg   VGPU10_OPCODE_SWITCH                            = 76,
147b8e80941Smrg   VGPU10_OPCODE_SINCOS                            = 77,
148b8e80941Smrg   VGPU10_OPCODE_UDIV                              = 78,
149b8e80941Smrg   VGPU10_OPCODE_ULT                               = 79,
150b8e80941Smrg   VGPU10_OPCODE_UGE                               = 80,
151b8e80941Smrg   VGPU10_OPCODE_UMUL                              = 81,
152b8e80941Smrg   VGPU10_OPCODE_UMAD                              = 82,
153b8e80941Smrg   VGPU10_OPCODE_UMAX                              = 83,
154b8e80941Smrg   VGPU10_OPCODE_UMIN                              = 84,
155b8e80941Smrg   VGPU10_OPCODE_USHR                              = 85,
156b8e80941Smrg   VGPU10_OPCODE_UTOF                              = 86,
157b8e80941Smrg   VGPU10_OPCODE_XOR                               = 87,
158b8e80941Smrg   VGPU10_OPCODE_DCL_RESOURCE                      = 88,
159b8e80941Smrg   VGPU10_OPCODE_DCL_CONSTANT_BUFFER               = 89,
160b8e80941Smrg   VGPU10_OPCODE_DCL_SAMPLER                       = 90,
161b8e80941Smrg   VGPU10_OPCODE_DCL_INDEX_RANGE                   = 91,
162b8e80941Smrg   VGPU10_OPCODE_DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY  = 92,
163b8e80941Smrg   VGPU10_OPCODE_DCL_GS_INPUT_PRIMITIVE            = 93,
164b8e80941Smrg   VGPU10_OPCODE_DCL_MAX_OUTPUT_VERTEX_COUNT       = 94,
165b8e80941Smrg   VGPU10_OPCODE_DCL_INPUT                         = 95,
166b8e80941Smrg   VGPU10_OPCODE_DCL_INPUT_SGV                     = 96,
167b8e80941Smrg   VGPU10_OPCODE_DCL_INPUT_SIV                     = 97,
168b8e80941Smrg   VGPU10_OPCODE_DCL_INPUT_PS                      = 98,
169b8e80941Smrg   VGPU10_OPCODE_DCL_INPUT_PS_SGV                  = 99,
170b8e80941Smrg   VGPU10_OPCODE_DCL_INPUT_PS_SIV                  = 100,
171b8e80941Smrg   VGPU10_OPCODE_DCL_OUTPUT                        = 101,
172b8e80941Smrg   VGPU10_OPCODE_DCL_OUTPUT_SGV                    = 102,
173b8e80941Smrg   VGPU10_OPCODE_DCL_OUTPUT_SIV                    = 103,
174b8e80941Smrg   VGPU10_OPCODE_DCL_TEMPS                         = 104,
175b8e80941Smrg   VGPU10_OPCODE_DCL_INDEXABLE_TEMP                = 105,
176b8e80941Smrg   VGPU10_OPCODE_DCL_GLOBAL_FLAGS                  = 106,
177b8e80941Smrg   VGPU10_OPCODE_IDIV                              = 107,
178b8e80941Smrg   VGPU10_OPCODE_LOD                               = 108,
179b8e80941Smrg   VGPU10_OPCODE_GATHER4                           = 109,
180b8e80941Smrg   VGPU10_OPCODE_SAMPLE_POS                        = 110,
181b8e80941Smrg   VGPU10_OPCODE_SAMPLE_INFO                       = 111,
182b8e80941Smrg   VGPU10_NUM_OPCODES                  /* Should be the last entry. */
183b8e80941Smrg} VGPU10_OPCODE_TYPE;
184b8e80941Smrg
185b8e80941Smrgtypedef enum {
186b8e80941Smrg   VGPU10_INTERPOLATION_UNDEFINED = 0,
187b8e80941Smrg   VGPU10_INTERPOLATION_CONSTANT = 1,
188b8e80941Smrg   VGPU10_INTERPOLATION_LINEAR = 2,
189b8e80941Smrg   VGPU10_INTERPOLATION_LINEAR_CENTROID = 3,
190b8e80941Smrg   VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4,
191b8e80941Smrg   VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5,
192b8e80941Smrg   VGPU10_INTERPOLATION_LINEAR_SAMPLE = 6,                  /* DX10.1 */
193b8e80941Smrg   VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7     /* DX10.1 */
194b8e80941Smrg} VGPU10_INTERPOLATION_MODE;
195b8e80941Smrg
196b8e80941Smrgtypedef enum {
197b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_UNKNOWN = 0,
198b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_BUFFER = 1,
199b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURE1D = 2,
200b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2D = 3,
201b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2DMS = 4,
202b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURE3D = 5,
203b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURECUBE = 6,
204b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURE1DARRAY = 7,
205b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2DARRAY = 8,
206b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2DMSARRAY = 9,
207b8e80941Smrg   VGPU10_RESOURCE_DIMENSION_TEXTURECUBEARRAY = 10
208b8e80941Smrg} VGPU10_RESOURCE_DIMENSION;
209b8e80941Smrg
210b8e80941Smrgtypedef enum {
211b8e80941Smrg   VGPU10_SAMPLER_MODE_DEFAULT = 0,
212b8e80941Smrg   VGPU10_SAMPLER_MODE_COMPARISON = 1,
213b8e80941Smrg   VGPU10_SAMPLER_MODE_MONO = 2
214b8e80941Smrg} VGPU10_SAMPLER_MODE;
215b8e80941Smrg
216b8e80941Smrgtypedef enum {
217b8e80941Smrg   VGPU10_INSTRUCTION_TEST_ZERO     = 0,
218b8e80941Smrg   VGPU10_INSTRUCTION_TEST_NONZERO  = 1
219b8e80941Smrg} VGPU10_INSTRUCTION_TEST_BOOLEAN;
220b8e80941Smrg
221b8e80941Smrgtypedef enum {
222b8e80941Smrg   VGPU10_CB_IMMEDIATE_INDEXED   = 0,
223b8e80941Smrg   VGPU10_CB_DYNAMIC_INDEXED     = 1
224b8e80941Smrg} VGPU10_CB_ACCESS_PATTERN;
225b8e80941Smrg
226b8e80941Smrgtypedef enum {
227b8e80941Smrg   VGPU10_PRIMITIVE_UNDEFINED    = 0,
228b8e80941Smrg   VGPU10_PRIMITIVE_POINT        = 1,
229b8e80941Smrg   VGPU10_PRIMITIVE_LINE         = 2,
230b8e80941Smrg   VGPU10_PRIMITIVE_TRIANGLE     = 3,
231b8e80941Smrg   VGPU10_PRIMITIVE_LINE_ADJ     = 6,
232b8e80941Smrg   VGPU10_PRIMITIVE_TRIANGLE_ADJ = 7
233b8e80941Smrg} VGPU10_PRIMITIVE;
234b8e80941Smrg
235b8e80941Smrgtypedef enum {
236b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_UNDEFINED          = 0,
237b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_POINTLIST          = 1,
238b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_LINELIST           = 2,
239b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_LINESTRIP          = 3,
240b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLELIST       = 4,
241b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP      = 5,
242b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ       = 10,
243b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ      = 11,
244b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ   = 12,
245b8e80941Smrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ  = 13
246b8e80941Smrg} VGPU10_PRIMITIVE_TOPOLOGY;
247b8e80941Smrg
248b8e80941Smrgtypedef enum {
249b8e80941Smrg   VGPU10_CUSTOMDATA_COMMENT                       = 0,
250b8e80941Smrg   VGPU10_CUSTOMDATA_DEBUGINFO                     = 1,
251b8e80941Smrg   VGPU10_CUSTOMDATA_OPAQUE                        = 2,
252b8e80941Smrg   VGPU10_CUSTOMDATA_DCL_IMMEDIATE_CONSTANT_BUFFER = 3
253b8e80941Smrg} VGPU10_CUSTOMDATA_CLASS;
254b8e80941Smrg
255b8e80941Smrgtypedef enum {
256b8e80941Smrg   VGPU10_RESINFO_RETURN_FLOAT      = 0,
257b8e80941Smrg   VGPU10_RESINFO_RETURN_RCPFLOAT   = 1,
258b8e80941Smrg   VGPU10_RESINFO_RETURN_UINT       = 2
259b8e80941Smrg} VGPU10_RESINFO_RETURN_TYPE;
260b8e80941Smrg
261b8e80941Smrg
262b8e80941Smrgtypedef enum {
263b8e80941Smrg   VGPU10_INSTRUCTION_RETURN_FLOAT  = 0,
264b8e80941Smrg   VGPU10_INSTRUCTION_RETURN_UINT   = 1
265b8e80941Smrg} VGPU10_INSTRUCTION_RETURN_TYPE;
266b8e80941Smrg
267b8e80941Smrgtypedef union {
268b8e80941Smrg   struct {
269b8e80941Smrg      unsigned int opcodeType          : 11; /* VGPU10_OPCODE_TYPE */
270b8e80941Smrg      unsigned int interpolationMode   : 4;  /* VGPU10_INTERPOLATION_MODE */
271b8e80941Smrg      unsigned int                     : 3;
272b8e80941Smrg      unsigned int testBoolean         : 1;  /* VGPU10_INSTRUCTION_TEST_BOOLEAN */
273b8e80941Smrg      unsigned int                     : 5;
274b8e80941Smrg      unsigned int instructionLength   : 7;
275b8e80941Smrg      unsigned int extended            : 1;
276b8e80941Smrg   };
277b8e80941Smrg   struct {
278b8e80941Smrg      unsigned int                     : 11;
279b8e80941Smrg      unsigned int resourceDimension   : 5;  /* VGPU10_RESOURCE_DIMENSION */
280b8e80941Smrg      unsigned int sampleCount         : 7;
281b8e80941Smrg   };
282b8e80941Smrg   struct {
283b8e80941Smrg      unsigned int                     : 11;
284b8e80941Smrg      unsigned int samplerMode         : 4;  /* VGPU10_SAMPLER_MODE */
285b8e80941Smrg   };
286b8e80941Smrg   struct {
287b8e80941Smrg      unsigned int                     : 11;
288b8e80941Smrg      unsigned int accessPattern       : 1;  /* VGPU10_CB_ACCESS_PATTERN */
289b8e80941Smrg   };
290b8e80941Smrg   struct {
291b8e80941Smrg      unsigned int                     : 11;
292b8e80941Smrg      unsigned int primitive           : 6;  /* VGPU10_PRIMITIVE */
293b8e80941Smrg   };
294b8e80941Smrg   struct {
295b8e80941Smrg      unsigned int                     : 11;
296b8e80941Smrg      unsigned int primitiveTopology   : 6;  /* VGPU10_PRIMITIVE_TOPOLOGY */
297b8e80941Smrg   };
298b8e80941Smrg   struct {
299b8e80941Smrg      unsigned int                     : 11;
300b8e80941Smrg      unsigned int customDataClass     : 21; /* VGPU10_CUSTOMDATA_CLASS */
301b8e80941Smrg   };
302b8e80941Smrg   struct {
303b8e80941Smrg      unsigned int                     : 11;
304b8e80941Smrg      unsigned int resinfoReturnType   : 2;  /* VGPU10_RESINFO_RETURN_TYPE */
305b8e80941Smrg      unsigned int saturate            : 1;
306b8e80941Smrg   };
307b8e80941Smrg   struct {
308b8e80941Smrg      unsigned int                     : 11;
309b8e80941Smrg      unsigned int refactoringAllowed  : 1;
310b8e80941Smrg   };
311b8e80941Smrg   struct {
312b8e80941Smrg      unsigned int                     : 11;
313b8e80941Smrg      unsigned int instReturnType      : 2;  /* VGPU10_INSTRUCTION_RETURN_TYPE */
314b8e80941Smrg   };
315b8e80941Smrg   uint32 value;
316b8e80941Smrg} VGPU10OpcodeToken0;
317b8e80941Smrg
318b8e80941Smrg
319b8e80941Smrgtypedef enum {
320b8e80941Smrg   VGPU10_EXTENDED_OPCODE_EMPTY = 0,
321b8e80941Smrg   VGPU10_EXTENDED_OPCODE_SAMPLE_CONTROLS
322b8e80941Smrg} VGPU10_EXTENDED_OPCODE_TYPE;
323b8e80941Smrg
324b8e80941Smrgtypedef union {
325b8e80941Smrg   struct {
326b8e80941Smrg      unsigned int opcodeType : 6;  /* VGPU10_EXTENDED_OPCODE_TYPE */
327b8e80941Smrg      unsigned int            : 3;
328b8e80941Smrg      unsigned int offsetU    : 4;  /* Two's complement. */
329b8e80941Smrg      unsigned int offsetV    : 4;  /* Two's complement. */
330b8e80941Smrg      unsigned int offsetW    : 4;  /* Two's complement. */
331b8e80941Smrg      unsigned int            : 10;
332b8e80941Smrg      unsigned int extended   : 1;
333b8e80941Smrg   };
334b8e80941Smrg   uint32 value;
335b8e80941Smrg} VGPU10OpcodeToken1;
336b8e80941Smrg
337b8e80941Smrg
338b8e80941Smrgtypedef enum {
339b8e80941Smrg   VGPU10_OPERAND_0_COMPONENT = 0,
340b8e80941Smrg   VGPU10_OPERAND_1_COMPONENT = 1,
341b8e80941Smrg   VGPU10_OPERAND_4_COMPONENT = 2,
342b8e80941Smrg   VGPU10_OPERAND_N_COMPONENT = 3   /* Unused for now. */
343b8e80941Smrg} VGPU10_OPERAND_NUM_COMPONENTS;
344b8e80941Smrg
345b8e80941Smrgtypedef enum {
346b8e80941Smrg   VGPU10_OPERAND_4_COMPONENT_MASK_MODE = 0,
347b8e80941Smrg   VGPU10_OPERAND_4_COMPONENT_SWIZZLE_MODE = 1,
348b8e80941Smrg   VGPU10_OPERAND_4_COMPONENT_SELECT_1_MODE = 2
349b8e80941Smrg} VGPU10_OPERAND_4_COMPONENT_SELECTION_MODE;
350b8e80941Smrg
351b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_X    0x1
352b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_Y    0x2
353b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_Z    0x4
354b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_W    0x8
355b8e80941Smrg
356b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XY   (VGPU10_OPERAND_4_COMPONENT_MASK_X   | VGPU10_OPERAND_4_COMPONENT_MASK_Y)
357b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XZ   (VGPU10_OPERAND_4_COMPONENT_MASK_X   | VGPU10_OPERAND_4_COMPONENT_MASK_Z)
358b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XW   (VGPU10_OPERAND_4_COMPONENT_MASK_X   | VGPU10_OPERAND_4_COMPONENT_MASK_W)
359b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_YZ   (VGPU10_OPERAND_4_COMPONENT_MASK_Y   | VGPU10_OPERAND_4_COMPONENT_MASK_Z)
360b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_YW   (VGPU10_OPERAND_4_COMPONENT_MASK_Y   | VGPU10_OPERAND_4_COMPONENT_MASK_W)
361b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_ZW   (VGPU10_OPERAND_4_COMPONENT_MASK_Z   | VGPU10_OPERAND_4_COMPONENT_MASK_W)
362b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XYZ  (VGPU10_OPERAND_4_COMPONENT_MASK_XY  | VGPU10_OPERAND_4_COMPONENT_MASK_Z)
363b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XYW  (VGPU10_OPERAND_4_COMPONENT_MASK_XY  | VGPU10_OPERAND_4_COMPONENT_MASK_W)
364b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XZW  (VGPU10_OPERAND_4_COMPONENT_MASK_XZ  | VGPU10_OPERAND_4_COMPONENT_MASK_W)
365b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_YZW  (VGPU10_OPERAND_4_COMPONENT_MASK_YZ  | VGPU10_OPERAND_4_COMPONENT_MASK_W)
366b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XYZW (VGPU10_OPERAND_4_COMPONENT_MASK_XYZ | VGPU10_OPERAND_4_COMPONENT_MASK_W)
367b8e80941Smrg#define VGPU10_OPERAND_4_COMPONENT_MASK_ALL  VGPU10_OPERAND_4_COMPONENT_MASK_XYZW
368b8e80941Smrg
369b8e80941Smrg#define VGPU10_REGISTER_INDEX_FROM_SEMANTIC  0xffffffff
370b8e80941Smrg
371b8e80941Smrgtypedef enum {
372b8e80941Smrg   VGPU10_COMPONENT_X = 0,
373b8e80941Smrg   VGPU10_COMPONENT_Y = 1,
374b8e80941Smrg   VGPU10_COMPONENT_Z = 2,
375b8e80941Smrg   VGPU10_COMPONENT_W = 3
376b8e80941Smrg} VGPU10_COMPONENT_NAME;
377b8e80941Smrg
378b8e80941Smrgtypedef enum {
379b8e80941Smrg   VGPU10_OPERAND_TYPE_TEMP = 0,
380b8e80941Smrg   VGPU10_OPERAND_TYPE_INPUT = 1,
381b8e80941Smrg   VGPU10_OPERAND_TYPE_OUTPUT = 2,
382b8e80941Smrg   VGPU10_OPERAND_TYPE_INDEXABLE_TEMP = 3,
383b8e80941Smrg   VGPU10_OPERAND_TYPE_IMMEDIATE32 = 4,
384b8e80941Smrg   VGPU10_OPERAND_TYPE_IMMEDIATE64 = 5,
385b8e80941Smrg   VGPU10_OPERAND_TYPE_SAMPLER = 6,
386b8e80941Smrg   VGPU10_OPERAND_TYPE_RESOURCE = 7,
387b8e80941Smrg   VGPU10_OPERAND_TYPE_CONSTANT_BUFFER = 8,
388b8e80941Smrg   VGPU10_OPERAND_TYPE_IMMEDIATE_CONSTANT_BUFFER = 9,
389b8e80941Smrg   VGPU10_OPERAND_TYPE_LABEL = 10,
390b8e80941Smrg   VGPU10_OPERAND_TYPE_INPUT_PRIMITIVEID = 11,
391b8e80941Smrg   VGPU10_OPERAND_TYPE_OUTPUT_DEPTH = 12,
392b8e80941Smrg   VGPU10_OPERAND_TYPE_NULL = 13,
393b8e80941Smrg   VGPU10_OPERAND_TYPE_RASTERIZER = 14,            /* DX10.1 */
394b8e80941Smrg   VGPU10_OPERAND_TYPE_OUTPUT_COVERAGE_MASK = 15   /* DX10.1 */
395b8e80941Smrg} VGPU10_OPERAND_TYPE;
396b8e80941Smrg
397b8e80941Smrgtypedef enum {
398b8e80941Smrg   VGPU10_OPERAND_INDEX_0D = 0,
399b8e80941Smrg   VGPU10_OPERAND_INDEX_1D = 1,
400b8e80941Smrg   VGPU10_OPERAND_INDEX_2D = 2,
401b8e80941Smrg   VGPU10_OPERAND_INDEX_3D = 3
402b8e80941Smrg} VGPU10_OPERAND_INDEX_DIMENSION;
403b8e80941Smrg
404b8e80941Smrgtypedef enum {
405b8e80941Smrg   VGPU10_OPERAND_INDEX_IMMEDIATE32 = 0,
406b8e80941Smrg   VGPU10_OPERAND_INDEX_IMMEDIATE64 = 1,
407b8e80941Smrg   VGPU10_OPERAND_INDEX_RELATIVE = 2,
408b8e80941Smrg   VGPU10_OPERAND_INDEX_IMMEDIATE32_PLUS_RELATIVE = 3,
409b8e80941Smrg   VGPU10_OPERAND_INDEX_IMMEDIATE64_PLUS_RELATIVE = 4
410b8e80941Smrg} VGPU10_OPERAND_INDEX_REPRESENTATION;
411b8e80941Smrg
412b8e80941Smrgtypedef union {
413b8e80941Smrg   struct {
414b8e80941Smrg      unsigned int numComponents          : 2;  /* VGPU10_OPERAND_NUM_COMPONENTS */
415b8e80941Smrg      unsigned int selectionMode          : 2;  /* VGPU10_OPERAND_4_COMPONENT_SELECTION_MODE */
416b8e80941Smrg      unsigned int mask                   : 4;  /* D3D10_SB_OPERAND_4_COMPONENT_MASK_* */
417b8e80941Smrg      unsigned int                        : 4;
418b8e80941Smrg      unsigned int operandType            : 8;  /* VGPU10_OPERAND_TYPE */
419b8e80941Smrg      unsigned int indexDimension         : 2;  /* VGPU10_OPERAND_INDEX_DIMENSION */
420b8e80941Smrg      unsigned int index0Representation   : 3;  /* VGPU10_OPERAND_INDEX_REPRESENTATION */
421b8e80941Smrg      unsigned int index1Representation   : 3;  /* VGPU10_OPERAND_INDEX_REPRESENTATION */
422b8e80941Smrg      unsigned int                        : 3;
423b8e80941Smrg      unsigned int extended               : 1;
424b8e80941Smrg   };
425b8e80941Smrg   struct {
426b8e80941Smrg      unsigned int                        : 4;
427b8e80941Smrg      unsigned int swizzleX               : 2;  /* VGPU10_COMPONENT_NAME */
428b8e80941Smrg      unsigned int swizzleY               : 2;  /* VGPU10_COMPONENT_NAME */
429b8e80941Smrg      unsigned int swizzleZ               : 2;  /* VGPU10_COMPONENT_NAME */
430b8e80941Smrg      unsigned int swizzleW               : 2;  /* VGPU10_COMPONENT_NAME */
431b8e80941Smrg   };
432b8e80941Smrg   struct {
433b8e80941Smrg      unsigned int                        : 4;
434b8e80941Smrg      unsigned int selectMask             : 2;  /* VGPU10_COMPONENT_NAME */
435b8e80941Smrg   };
436b8e80941Smrg   uint32 value;
437b8e80941Smrg} VGPU10OperandToken0;
438b8e80941Smrg
439b8e80941Smrg
440b8e80941Smrgtypedef enum {
441b8e80941Smrg   VGPU10_EXTENDED_OPERAND_EMPTY = 0,
442b8e80941Smrg   VGPU10_EXTENDED_OPERAND_MODIFIER = 1
443b8e80941Smrg} VGPU10_EXTENDED_OPERAND_TYPE;
444b8e80941Smrg
445b8e80941Smrgtypedef enum {
446b8e80941Smrg   VGPU10_OPERAND_MODIFIER_NONE = 0,
447b8e80941Smrg   VGPU10_OPERAND_MODIFIER_NEG = 1,
448b8e80941Smrg   VGPU10_OPERAND_MODIFIER_ABS = 2,
449b8e80941Smrg   VGPU10_OPERAND_MODIFIER_ABSNEG = 3
450b8e80941Smrg} VGPU10_OPERAND_MODIFIER;
451b8e80941Smrg
452b8e80941Smrgtypedef union {
453b8e80941Smrg   struct {
454b8e80941Smrg      unsigned int extendedOperandType : 6;  /* VGPU10_EXTENDED_OPERAND_TYPE */
455b8e80941Smrg      unsigned int operandModifier     : 8;  /* VGPU10_OPERAND_MODIFIER */
456b8e80941Smrg      unsigned int                     : 17;
457b8e80941Smrg      unsigned int extended            : 1;
458b8e80941Smrg   };
459b8e80941Smrg   uint32 value;
460b8e80941Smrg} VGPU10OperandToken1;
461b8e80941Smrg
462b8e80941Smrg
463b8e80941Smrgtypedef enum {
464b8e80941Smrg   VGPU10_RETURN_TYPE_MIN     = 1,
465b8e80941Smrg   VGPU10_RETURN_TYPE_UNORM   = 1,
466b8e80941Smrg   VGPU10_RETURN_TYPE_SNORM   = 2,
467b8e80941Smrg   VGPU10_RETURN_TYPE_SINT    = 3,
468b8e80941Smrg   VGPU10_RETURN_TYPE_UINT    = 4,
469b8e80941Smrg   VGPU10_RETURN_TYPE_FLOAT   = 5,
470b8e80941Smrg   VGPU10_RETURN_TYPE_MIXED   = 6,
471b8e80941Smrg   VGPU10_RETURN_TYPE_MAX     = 6
472b8e80941Smrg} VGPU10_RESOURCE_RETURN_TYPE;
473b8e80941Smrg
474b8e80941Smrgtypedef union {
475b8e80941Smrg   struct {
476b8e80941Smrg      unsigned int component0 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
477b8e80941Smrg      unsigned int component1 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
478b8e80941Smrg      unsigned int component2 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
479b8e80941Smrg      unsigned int component3 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
480b8e80941Smrg   };
481b8e80941Smrg   uint32 value;
482b8e80941Smrg} VGPU10ResourceReturnTypeToken;
483b8e80941Smrg
484b8e80941Smrg
485b8e80941Smrgtypedef enum {
486b8e80941Smrg   VGPU10_NAME_MIN                        = 0,
487b8e80941Smrg   VGPU10_NAME_UNDEFINED                  = 0,
488b8e80941Smrg   VGPU10_NAME_POSITION                   = 1,
489b8e80941Smrg   VGPU10_NAME_CLIP_DISTANCE              = 2,
490b8e80941Smrg   VGPU10_NAME_CULL_DISTANCE              = 3,
491b8e80941Smrg   VGPU10_NAME_RENDER_TARGET_ARRAY_INDEX  = 4,
492b8e80941Smrg   VGPU10_NAME_VIEWPORT_ARRAY_INDEX       = 5,
493b8e80941Smrg   VGPU10_NAME_VERTEX_ID                  = 6,
494b8e80941Smrg   VGPU10_NAME_PRIMITIVE_ID               = 7,
495b8e80941Smrg   VGPU10_NAME_INSTANCE_ID                = 8,
496b8e80941Smrg   VGPU10_NAME_IS_FRONT_FACE              = 9,
497b8e80941Smrg   VGPU10_NAME_SAMPLE_INDEX               = 10,
498b8e80941Smrg   VGPU10_NAME_MAX                        = 10
499b8e80941Smrg} VGPU10_SYSTEM_NAME;
500b8e80941Smrg
501b8e80941Smrgtypedef union {
502b8e80941Smrg   struct {
503b8e80941Smrg      unsigned int name : 16; /* VGPU10_SYSTEM_NAME */
504b8e80941Smrg   };
505b8e80941Smrg   uint32 value;
506b8e80941Smrg} VGPU10NameToken;
507b8e80941Smrg
508b8e80941Smrg#endif
509