101e04c3fSmrg/**********************************************************
201e04c3fSmrg * Copyright 2007-2015 VMware, Inc.  All rights reserved.
301e04c3fSmrg *
401e04c3fSmrg * Permission is hereby granted, free of charge, to any person
501e04c3fSmrg * obtaining a copy of this software and associated documentation
601e04c3fSmrg * files (the "Software"), to deal in the Software without
701e04c3fSmrg * restriction, including without limitation the rights to use, copy,
801e04c3fSmrg * modify, merge, publish, distribute, sublicense, and/or sell copies
901e04c3fSmrg * of the Software, and to permit persons to whom the Software is
1001e04c3fSmrg * furnished to do so, subject to the following conditions:
1101e04c3fSmrg *
1201e04c3fSmrg * The above copyright notice and this permission notice shall be
1301e04c3fSmrg * included in all copies or substantial portions of the Software.
1401e04c3fSmrg *
1501e04c3fSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1601e04c3fSmrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1701e04c3fSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1801e04c3fSmrg * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
1901e04c3fSmrg * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2001e04c3fSmrg * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2101e04c3fSmrg * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2201e04c3fSmrg * SOFTWARE.
2301e04c3fSmrg *
2401e04c3fSmrg **********************************************************/
2501e04c3fSmrg
2601e04c3fSmrg/*
2701e04c3fSmrg * VGPU10ShaderTokens.h --
2801e04c3fSmrg *
2901e04c3fSmrg *    VGPU10 shader token definitions.
3001e04c3fSmrg *
3101e04c3fSmrg */
3201e04c3fSmrg
3301e04c3fSmrg#ifndef VGPU10SHADERTOKENS_H
3401e04c3fSmrg#define VGPU10SHADERTOKENS_H
3501e04c3fSmrg
3601e04c3fSmrg/* Shader limits */
3701e04c3fSmrg#define VGPU10_MAX_VS_INPUTS 16
3801e04c3fSmrg#define VGPU10_MAX_VS_OUTPUTS 16
3901e04c3fSmrg#define VGPU10_MAX_GS_INPUTS 16
4001e04c3fSmrg#define VGPU10_MAX_GS_OUTPUTS 32
4101e04c3fSmrg#define VGPU10_MAX_FS_INPUTS 32
4201e04c3fSmrg#define VGPU10_MAX_FS_OUTPUTS 8
4301e04c3fSmrg#define VGPU10_MAX_TEMPS 4096
447ec681f3Smrg#define VGPU10_MAX_CONSTANT_BUFFERS (14 + 1)
4501e04c3fSmrg#define VGPU10_MAX_CONSTANT_BUFFER_ELEMENT_COUNT 4096
4601e04c3fSmrg#define VGPU10_MAX_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT 4096
4701e04c3fSmrg#define VGPU10_MAX_SAMPLERS 16
4801e04c3fSmrg#define VGPU10_MAX_RESOURCES 128
4901e04c3fSmrg#define VGPU10_MIN_TEXEL_FETCH_OFFSET -8
5001e04c3fSmrg#define VGPU10_MAX_TEXEL_FETCH_OFFSET 7
5101e04c3fSmrg
527ec681f3Smrg/* Shader Model 4.1 limits */
537ec681f3Smrg#define VGPU10_1_MAX_VS_INPUTS   32
547ec681f3Smrg#define VGPU10_1_MAX_VS_OUTPUTS  32
557ec681f3Smrg#define VGPU10_1_MAX_GS_INPUTS   32
567ec681f3Smrg
577ec681f3Smrg/* Shader Model 5.0 limits */
587ec681f3Smrg#define VGPU11_MAX_HS_INPUTS                    32
597ec681f3Smrg#define VGPU11_MAX_HS_INPUT_CONTROL_POINTS      32
607ec681f3Smrg#define VGPU11_MAX_HS_INPUT_PATCH_CONSTANTS     32
617ec681f3Smrg#define VGPU11_MAX_HS_OUTPUTS                   32
627ec681f3Smrg#define VGPU11_MAX_DS_INPUT_CONTROL_POINTS      32
637ec681f3Smrg#define VGPU11_MAX_DS_INPUT_PATCH_CONSTANTS     32
647ec681f3Smrg#define VGPU11_MAX_DS_OUTPUTS                   32
657ec681f3Smrg#define VGPU11_MAX_GS_STREAMS                   4
667ec681f3Smrg
677ec681f3Smrg/* Maximums of limits for all stages */
687ec681f3Smrg#define VGPU10_MAX_INPUTS                 32
697ec681f3Smrg#define VGPU10_MAX_OUTPUTS                32
707ec681f3Smrg#define VGPU10_MAX_INPUT_PATCH_CONSTANTS  32
717ec681f3Smrg
7201e04c3fSmrgtypedef enum {
737ec681f3Smrg   VGPU10_PIXEL_SHADER     = 0,
747ec681f3Smrg   VGPU10_VERTEX_SHADER    = 1,
757ec681f3Smrg   VGPU10_GEOMETRY_SHADER  = 2,
767ec681f3Smrg
777ec681f3Smrg   /* DX11 */
787ec681f3Smrg   VGPU10_HULL_SHADER      = 3,
797ec681f3Smrg   VGPU10_DOMAIN_SHADER    = 4,
807ec681f3Smrg   VGPU10_COMPUTE_SHADER   = 5
8101e04c3fSmrg} VGPU10_PROGRAM_TYPE;
8201e04c3fSmrg
8301e04c3fSmrgtypedef union {
8401e04c3fSmrg   struct {
8501e04c3fSmrg      unsigned int minorVersion  : 4;
8601e04c3fSmrg      unsigned int majorVersion  : 4;
8701e04c3fSmrg      unsigned int               : 8;
8801e04c3fSmrg      unsigned int programType   : 16; /* VGPU10_PROGRAM_TYPE */
8901e04c3fSmrg   };
9001e04c3fSmrg   uint32 value;
9101e04c3fSmrg} VGPU10ProgramToken;
9201e04c3fSmrg
9301e04c3fSmrg
9401e04c3fSmrgtypedef enum {
9501e04c3fSmrg   VGPU10_OPCODE_ADD                               = 0,
9601e04c3fSmrg   VGPU10_OPCODE_AND                               = 1,
9701e04c3fSmrg   VGPU10_OPCODE_BREAK                             = 2,
9801e04c3fSmrg   VGPU10_OPCODE_BREAKC                            = 3,
9901e04c3fSmrg   VGPU10_OPCODE_CALL                              = 4,
10001e04c3fSmrg   VGPU10_OPCODE_CALLC                             = 5,
10101e04c3fSmrg   VGPU10_OPCODE_CASE                              = 6,
10201e04c3fSmrg   VGPU10_OPCODE_CONTINUE                          = 7,
10301e04c3fSmrg   VGPU10_OPCODE_CONTINUEC                         = 8,
10401e04c3fSmrg   VGPU10_OPCODE_CUT                               = 9,
10501e04c3fSmrg   VGPU10_OPCODE_DEFAULT                           = 10,
10601e04c3fSmrg   VGPU10_OPCODE_DERIV_RTX                         = 11,
10701e04c3fSmrg   VGPU10_OPCODE_DERIV_RTY                         = 12,
10801e04c3fSmrg   VGPU10_OPCODE_DISCARD                           = 13,
10901e04c3fSmrg   VGPU10_OPCODE_DIV                               = 14,
11001e04c3fSmrg   VGPU10_OPCODE_DP2                               = 15,
11101e04c3fSmrg   VGPU10_OPCODE_DP3                               = 16,
11201e04c3fSmrg   VGPU10_OPCODE_DP4                               = 17,
11301e04c3fSmrg   VGPU10_OPCODE_ELSE                              = 18,
11401e04c3fSmrg   VGPU10_OPCODE_EMIT                              = 19,
11501e04c3fSmrg   VGPU10_OPCODE_EMITTHENCUT                       = 20,
11601e04c3fSmrg   VGPU10_OPCODE_ENDIF                             = 21,
11701e04c3fSmrg   VGPU10_OPCODE_ENDLOOP                           = 22,
11801e04c3fSmrg   VGPU10_OPCODE_ENDSWITCH                         = 23,
11901e04c3fSmrg   VGPU10_OPCODE_EQ                                = 24,
12001e04c3fSmrg   VGPU10_OPCODE_EXP                               = 25,
12101e04c3fSmrg   VGPU10_OPCODE_FRC                               = 26,
12201e04c3fSmrg   VGPU10_OPCODE_FTOI                              = 27,
12301e04c3fSmrg   VGPU10_OPCODE_FTOU                              = 28,
12401e04c3fSmrg   VGPU10_OPCODE_GE                                = 29,
12501e04c3fSmrg   VGPU10_OPCODE_IADD                              = 30,
12601e04c3fSmrg   VGPU10_OPCODE_IF                                = 31,
12701e04c3fSmrg   VGPU10_OPCODE_IEQ                               = 32,
12801e04c3fSmrg   VGPU10_OPCODE_IGE                               = 33,
12901e04c3fSmrg   VGPU10_OPCODE_ILT                               = 34,
13001e04c3fSmrg   VGPU10_OPCODE_IMAD                              = 35,
13101e04c3fSmrg   VGPU10_OPCODE_IMAX                              = 36,
13201e04c3fSmrg   VGPU10_OPCODE_IMIN                              = 37,
13301e04c3fSmrg   VGPU10_OPCODE_IMUL                              = 38,
13401e04c3fSmrg   VGPU10_OPCODE_INE                               = 39,
13501e04c3fSmrg   VGPU10_OPCODE_INEG                              = 40,
13601e04c3fSmrg   VGPU10_OPCODE_ISHL                              = 41,
13701e04c3fSmrg   VGPU10_OPCODE_ISHR                              = 42,
13801e04c3fSmrg   VGPU10_OPCODE_ITOF                              = 43,
13901e04c3fSmrg   VGPU10_OPCODE_LABEL                             = 44,
14001e04c3fSmrg   VGPU10_OPCODE_LD                                = 45,
14101e04c3fSmrg   VGPU10_OPCODE_LD_MS                             = 46,
14201e04c3fSmrg   VGPU10_OPCODE_LOG                               = 47,
14301e04c3fSmrg   VGPU10_OPCODE_LOOP                              = 48,
14401e04c3fSmrg   VGPU10_OPCODE_LT                                = 49,
14501e04c3fSmrg   VGPU10_OPCODE_MAD                               = 50,
14601e04c3fSmrg   VGPU10_OPCODE_MIN                               = 51,
14701e04c3fSmrg   VGPU10_OPCODE_MAX                               = 52,
14801e04c3fSmrg   VGPU10_OPCODE_CUSTOMDATA                        = 53,
14901e04c3fSmrg   VGPU10_OPCODE_MOV                               = 54,
15001e04c3fSmrg   VGPU10_OPCODE_MOVC                              = 55,
15101e04c3fSmrg   VGPU10_OPCODE_MUL                               = 56,
15201e04c3fSmrg   VGPU10_OPCODE_NE                                = 57,
15301e04c3fSmrg   VGPU10_OPCODE_NOP                               = 58,
15401e04c3fSmrg   VGPU10_OPCODE_NOT                               = 59,
15501e04c3fSmrg   VGPU10_OPCODE_OR                                = 60,
15601e04c3fSmrg   VGPU10_OPCODE_RESINFO                           = 61,
15701e04c3fSmrg   VGPU10_OPCODE_RET                               = 62,
15801e04c3fSmrg   VGPU10_OPCODE_RETC                              = 63,
15901e04c3fSmrg   VGPU10_OPCODE_ROUND_NE                          = 64,
16001e04c3fSmrg   VGPU10_OPCODE_ROUND_NI                          = 65,
16101e04c3fSmrg   VGPU10_OPCODE_ROUND_PI                          = 66,
16201e04c3fSmrg   VGPU10_OPCODE_ROUND_Z                           = 67,
16301e04c3fSmrg   VGPU10_OPCODE_RSQ                               = 68,
16401e04c3fSmrg   VGPU10_OPCODE_SAMPLE                            = 69,
16501e04c3fSmrg   VGPU10_OPCODE_SAMPLE_C                          = 70,
16601e04c3fSmrg   VGPU10_OPCODE_SAMPLE_C_LZ                       = 71,
16701e04c3fSmrg   VGPU10_OPCODE_SAMPLE_L                          = 72,
16801e04c3fSmrg   VGPU10_OPCODE_SAMPLE_D                          = 73,
16901e04c3fSmrg   VGPU10_OPCODE_SAMPLE_B                          = 74,
17001e04c3fSmrg   VGPU10_OPCODE_SQRT                              = 75,
17101e04c3fSmrg   VGPU10_OPCODE_SWITCH                            = 76,
17201e04c3fSmrg   VGPU10_OPCODE_SINCOS                            = 77,
17301e04c3fSmrg   VGPU10_OPCODE_UDIV                              = 78,
17401e04c3fSmrg   VGPU10_OPCODE_ULT                               = 79,
17501e04c3fSmrg   VGPU10_OPCODE_UGE                               = 80,
17601e04c3fSmrg   VGPU10_OPCODE_UMUL                              = 81,
17701e04c3fSmrg   VGPU10_OPCODE_UMAD                              = 82,
17801e04c3fSmrg   VGPU10_OPCODE_UMAX                              = 83,
17901e04c3fSmrg   VGPU10_OPCODE_UMIN                              = 84,
18001e04c3fSmrg   VGPU10_OPCODE_USHR                              = 85,
18101e04c3fSmrg   VGPU10_OPCODE_UTOF                              = 86,
18201e04c3fSmrg   VGPU10_OPCODE_XOR                               = 87,
18301e04c3fSmrg   VGPU10_OPCODE_DCL_RESOURCE                      = 88,
18401e04c3fSmrg   VGPU10_OPCODE_DCL_CONSTANT_BUFFER               = 89,
18501e04c3fSmrg   VGPU10_OPCODE_DCL_SAMPLER                       = 90,
18601e04c3fSmrg   VGPU10_OPCODE_DCL_INDEX_RANGE                   = 91,
18701e04c3fSmrg   VGPU10_OPCODE_DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY  = 92,
18801e04c3fSmrg   VGPU10_OPCODE_DCL_GS_INPUT_PRIMITIVE            = 93,
18901e04c3fSmrg   VGPU10_OPCODE_DCL_MAX_OUTPUT_VERTEX_COUNT       = 94,
19001e04c3fSmrg   VGPU10_OPCODE_DCL_INPUT                         = 95,
19101e04c3fSmrg   VGPU10_OPCODE_DCL_INPUT_SGV                     = 96,
19201e04c3fSmrg   VGPU10_OPCODE_DCL_INPUT_SIV                     = 97,
19301e04c3fSmrg   VGPU10_OPCODE_DCL_INPUT_PS                      = 98,
19401e04c3fSmrg   VGPU10_OPCODE_DCL_INPUT_PS_SGV                  = 99,
19501e04c3fSmrg   VGPU10_OPCODE_DCL_INPUT_PS_SIV                  = 100,
19601e04c3fSmrg   VGPU10_OPCODE_DCL_OUTPUT                        = 101,
19701e04c3fSmrg   VGPU10_OPCODE_DCL_OUTPUT_SGV                    = 102,
19801e04c3fSmrg   VGPU10_OPCODE_DCL_OUTPUT_SIV                    = 103,
19901e04c3fSmrg   VGPU10_OPCODE_DCL_TEMPS                         = 104,
20001e04c3fSmrg   VGPU10_OPCODE_DCL_INDEXABLE_TEMP                = 105,
20101e04c3fSmrg   VGPU10_OPCODE_DCL_GLOBAL_FLAGS                  = 106,
2027ec681f3Smrg
2037ec681f3Smrg   /* GL guest */
2047ec681f3Smrg   VGPU10_OPCODE_VMWARE                            = 107,
2057ec681f3Smrg
2067ec681f3Smrg   /* DX10.1 */
20701e04c3fSmrg   VGPU10_OPCODE_LOD                               = 108,
20801e04c3fSmrg   VGPU10_OPCODE_GATHER4                           = 109,
20901e04c3fSmrg   VGPU10_OPCODE_SAMPLE_POS                        = 110,
21001e04c3fSmrg   VGPU10_OPCODE_SAMPLE_INFO                       = 111,
2117ec681f3Smrg
2127ec681f3Smrg   /* DX11 */
2137ec681f3Smrg   VGPU10_OPCODE_RESERVED1                         = 112,
2147ec681f3Smrg   VGPU10_OPCODE_HS_DECLS                          = 113,
2157ec681f3Smrg   VGPU10_OPCODE_HS_CONTROL_POINT_PHASE            = 114,
2167ec681f3Smrg   VGPU10_OPCODE_HS_FORK_PHASE                     = 115,
2177ec681f3Smrg   VGPU10_OPCODE_HS_JOIN_PHASE                     = 116,
2187ec681f3Smrg   VGPU10_OPCODE_EMIT_STREAM                       = 117,
2197ec681f3Smrg   VGPU10_OPCODE_CUT_STREAM                        = 118,
2207ec681f3Smrg   VGPU10_OPCODE_EMITTHENCUT_STREAM                = 119,
2217ec681f3Smrg   VGPU10_OPCODE_INTERFACE_CALL                    = 120,
2227ec681f3Smrg   VGPU10_OPCODE_BUFINFO                           = 121,
2237ec681f3Smrg   VGPU10_OPCODE_DERIV_RTX_COARSE                  = 122,
2247ec681f3Smrg   VGPU10_OPCODE_DERIV_RTX_FINE                    = 123,
2257ec681f3Smrg   VGPU10_OPCODE_DERIV_RTY_COARSE                  = 124,
2267ec681f3Smrg   VGPU10_OPCODE_DERIV_RTY_FINE                    = 125,
2277ec681f3Smrg   VGPU10_OPCODE_GATHER4_C                         = 126,
2287ec681f3Smrg   VGPU10_OPCODE_GATHER4_PO                        = 127,
2297ec681f3Smrg   VGPU10_OPCODE_GATHER4_PO_C                      = 128,
2307ec681f3Smrg   VGPU10_OPCODE_RCP                               = 129,
2317ec681f3Smrg   VGPU10_OPCODE_F32TOF16                          = 130,
2327ec681f3Smrg   VGPU10_OPCODE_F16TOF32                          = 131,
2337ec681f3Smrg   VGPU10_OPCODE_UADDC                             = 132,
2347ec681f3Smrg   VGPU10_OPCODE_USUBB                             = 133,
2357ec681f3Smrg   VGPU10_OPCODE_COUNTBITS                         = 134,
2367ec681f3Smrg   VGPU10_OPCODE_FIRSTBIT_HI                       = 135,
2377ec681f3Smrg   VGPU10_OPCODE_FIRSTBIT_LO                       = 136,
2387ec681f3Smrg   VGPU10_OPCODE_FIRSTBIT_SHI                      = 137,
2397ec681f3Smrg   VGPU10_OPCODE_UBFE                              = 138,
2407ec681f3Smrg   VGPU10_OPCODE_IBFE                              = 139,
2417ec681f3Smrg   VGPU10_OPCODE_BFI                               = 140,
2427ec681f3Smrg   VGPU10_OPCODE_BFREV                             = 141,
2437ec681f3Smrg   VGPU10_OPCODE_SWAPC                             = 142,
2447ec681f3Smrg   VGPU10_OPCODE_DCL_STREAM                        = 143,
2457ec681f3Smrg   VGPU10_OPCODE_DCL_FUNCTION_BODY                 = 144,
2467ec681f3Smrg   VGPU10_OPCODE_DCL_FUNCTION_TABLE                = 145,
2477ec681f3Smrg   VGPU10_OPCODE_DCL_INTERFACE                     = 146,
2487ec681f3Smrg   VGPU10_OPCODE_DCL_INPUT_CONTROL_POINT_COUNT     = 147,
2497ec681f3Smrg   VGPU10_OPCODE_DCL_OUTPUT_CONTROL_POINT_COUNT    = 148,
2507ec681f3Smrg   VGPU10_OPCODE_DCL_TESS_DOMAIN                   = 149,
2517ec681f3Smrg   VGPU10_OPCODE_DCL_TESS_PARTITIONING             = 150,
2527ec681f3Smrg   VGPU10_OPCODE_DCL_TESS_OUTPUT_PRIMITIVE         = 151,
2537ec681f3Smrg   VGPU10_OPCODE_DCL_HS_MAX_TESSFACTOR             = 152,
2547ec681f3Smrg   VGPU10_OPCODE_DCL_HS_FORK_PHASE_INSTANCE_COUNT  = 153,
2557ec681f3Smrg   VGPU10_OPCODE_DCL_HS_JOIN_PHASE_INSTANCE_COUNT  = 154,
2567ec681f3Smrg   VGPU10_OPCODE_DCL_THREAD_GROUP                  = 155,
2577ec681f3Smrg   VGPU10_OPCODE_DCL_UAV_TYPED                     = 156,
2587ec681f3Smrg   VGPU10_OPCODE_DCL_UAV_RAW                       = 157,
2597ec681f3Smrg   VGPU10_OPCODE_DCL_UAV_STRUCTURED                = 158,
2607ec681f3Smrg   VGPU10_OPCODE_DCL_TGSM_RAW                      = 159,
2617ec681f3Smrg   VGPU10_OPCODE_DCL_TGSM_STRUCTURED               = 160,
2627ec681f3Smrg   VGPU10_OPCODE_DCL_RESOURCE_RAW                  = 161,
2637ec681f3Smrg   VGPU10_OPCODE_DCL_RESOURCE_STRUCTURED           = 162,
2647ec681f3Smrg   VGPU10_OPCODE_LD_UAV_TYPED                      = 163,
2657ec681f3Smrg   VGPU10_OPCODE_STORE_UAV_TYPED                   = 164,
2667ec681f3Smrg   VGPU10_OPCODE_LD_RAW                            = 165,
2677ec681f3Smrg   VGPU10_OPCODE_STORE_RAW                         = 166,
2687ec681f3Smrg   VGPU10_OPCODE_LD_STRUCTURED                     = 167,
2697ec681f3Smrg   VGPU10_OPCODE_STORE_STRUCTURED                  = 168,
2707ec681f3Smrg   VGPU10_OPCODE_ATOMIC_AND                        = 169,
2717ec681f3Smrg   VGPU10_OPCODE_ATOMIC_OR                         = 170,
2727ec681f3Smrg   VGPU10_OPCODE_ATOMIC_XOR                        = 171,
2737ec681f3Smrg   VGPU10_OPCODE_ATOMIC_CMP_STORE                  = 172,
2747ec681f3Smrg   VGPU10_OPCODE_ATOMIC_IADD                       = 173,
2757ec681f3Smrg   VGPU10_OPCODE_ATOMIC_IMAX                       = 174,
2767ec681f3Smrg   VGPU10_OPCODE_ATOMIC_IMIN                       = 175,
2777ec681f3Smrg   VGPU10_OPCODE_ATOMIC_UMAX                       = 176,
2787ec681f3Smrg   VGPU10_OPCODE_ATOMIC_UMIN                       = 177,
2797ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_ALLOC                  = 178,
2807ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_CONSUME                = 179,
2817ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_IADD                   = 180,
2827ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_AND                    = 181,
2837ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_OR                     = 182,
2847ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_XOR                    = 183,
2857ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_EXCH                   = 184,
2867ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_CMP_EXCH               = 185,
2877ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_IMAX                   = 186,
2887ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_IMIN                   = 187,
2897ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_UMAX                   = 188,
2907ec681f3Smrg   VGPU10_OPCODE_IMM_ATOMIC_UMIN                   = 189,
2917ec681f3Smrg   VGPU10_OPCODE_SYNC                              = 190,
2927ec681f3Smrg   VGPU10_OPCODE_DADD                              = 191,
2937ec681f3Smrg   VGPU10_OPCODE_DMAX                              = 192,
2947ec681f3Smrg   VGPU10_OPCODE_DMIN                              = 193,
2957ec681f3Smrg   VGPU10_OPCODE_DMUL                              = 194,
2967ec681f3Smrg   VGPU10_OPCODE_DEQ                               = 195,
2977ec681f3Smrg   VGPU10_OPCODE_DGE                               = 196,
2987ec681f3Smrg   VGPU10_OPCODE_DLT                               = 197,
2997ec681f3Smrg   VGPU10_OPCODE_DNE                               = 198,
3007ec681f3Smrg   VGPU10_OPCODE_DMOV                              = 199,
3017ec681f3Smrg   VGPU10_OPCODE_DMOVC                             = 200,
3027ec681f3Smrg   VGPU10_OPCODE_DTOF                              = 201,
3037ec681f3Smrg   VGPU10_OPCODE_FTOD                              = 202,
3047ec681f3Smrg   VGPU10_OPCODE_EVAL_SNAPPED                      = 203,
3057ec681f3Smrg   VGPU10_OPCODE_EVAL_SAMPLE_INDEX                 = 204,
3067ec681f3Smrg   VGPU10_OPCODE_EVAL_CENTROID                     = 205,
3077ec681f3Smrg   VGPU10_OPCODE_DCL_GS_INSTANCE_COUNT             = 206,
3087ec681f3Smrg   VGPU10_OPCODE_ABORT                             = 207,
3097ec681f3Smrg   VGPU10_OPCODE_DEBUG_BREAK                       = 208,
3107ec681f3Smrg
3117ec681f3Smrg   /* DX11.1 */
3127ec681f3Smrg   VGPU10_OPCODE_RESERVED0                         = 209,
3137ec681f3Smrg   VGPU10_OPCODE_DDIV                              = 210,
3147ec681f3Smrg   VGPU10_OPCODE_DFMA                              = 211,
3157ec681f3Smrg   VGPU10_OPCODE_DRCP                              = 212,
3167ec681f3Smrg   VGPU10_OPCODE_MSAD                              = 213,
3177ec681f3Smrg   VGPU10_OPCODE_DTOI                              = 214,
3187ec681f3Smrg   VGPU10_OPCODE_DTOU                              = 215,
3197ec681f3Smrg   VGPU10_OPCODE_ITOD                              = 216,
3207ec681f3Smrg   VGPU10_OPCODE_UTOD                              = 217,
3217ec681f3Smrg
32201e04c3fSmrg   VGPU10_NUM_OPCODES                  /* Should be the last entry. */
32301e04c3fSmrg} VGPU10_OPCODE_TYPE;
32401e04c3fSmrg
3257ec681f3Smrg/* Sub-opcode of VGPU10_OPCODE_VMWARE. */
3267ec681f3Smrgtypedef enum {
3277ec681f3Smrg   VGPU10_VMWARE_OPCODE_IDIV                       = 0,
3287ec681f3Smrg   VGPU10_VMWARE_OPCODE_DFRC                       = 1,
3297ec681f3Smrg   VGPU10_VMWARE_OPCODE_DRSQ                       = 2,
3307ec681f3Smrg   VGPU10_VMWARE_NUM_OPCODES           /* Should be the last entry. */
3317ec681f3Smrg} VGPU10_VMWARE_OPCODE_TYPE;
3327ec681f3Smrg
33301e04c3fSmrgtypedef enum {
33401e04c3fSmrg   VGPU10_INTERPOLATION_UNDEFINED = 0,
33501e04c3fSmrg   VGPU10_INTERPOLATION_CONSTANT = 1,
33601e04c3fSmrg   VGPU10_INTERPOLATION_LINEAR = 2,
33701e04c3fSmrg   VGPU10_INTERPOLATION_LINEAR_CENTROID = 3,
33801e04c3fSmrg   VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4,
33901e04c3fSmrg   VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5,
34001e04c3fSmrg   VGPU10_INTERPOLATION_LINEAR_SAMPLE = 6,                  /* DX10.1 */
34101e04c3fSmrg   VGPU10_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7     /* DX10.1 */
34201e04c3fSmrg} VGPU10_INTERPOLATION_MODE;
34301e04c3fSmrg
34401e04c3fSmrgtypedef enum {
34501e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_UNKNOWN = 0,
34601e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_BUFFER = 1,
34701e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURE1D = 2,
34801e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2D = 3,
34901e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2DMS = 4,
35001e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURE3D = 5,
35101e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURECUBE = 6,
35201e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURE1DARRAY = 7,
35301e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2DARRAY = 8,
35401e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURE2DMSARRAY = 9,
35501e04c3fSmrg   VGPU10_RESOURCE_DIMENSION_TEXTURECUBEARRAY = 10
35601e04c3fSmrg} VGPU10_RESOURCE_DIMENSION;
35701e04c3fSmrg
35801e04c3fSmrgtypedef enum {
35901e04c3fSmrg   VGPU10_SAMPLER_MODE_DEFAULT = 0,
36001e04c3fSmrg   VGPU10_SAMPLER_MODE_COMPARISON = 1,
36101e04c3fSmrg   VGPU10_SAMPLER_MODE_MONO = 2
36201e04c3fSmrg} VGPU10_SAMPLER_MODE;
36301e04c3fSmrg
36401e04c3fSmrgtypedef enum {
36501e04c3fSmrg   VGPU10_INSTRUCTION_TEST_ZERO     = 0,
36601e04c3fSmrg   VGPU10_INSTRUCTION_TEST_NONZERO  = 1
36701e04c3fSmrg} VGPU10_INSTRUCTION_TEST_BOOLEAN;
36801e04c3fSmrg
36901e04c3fSmrgtypedef enum {
37001e04c3fSmrg   VGPU10_CB_IMMEDIATE_INDEXED   = 0,
37101e04c3fSmrg   VGPU10_CB_DYNAMIC_INDEXED     = 1
37201e04c3fSmrg} VGPU10_CB_ACCESS_PATTERN;
37301e04c3fSmrg
37401e04c3fSmrgtypedef enum {
37501e04c3fSmrg   VGPU10_PRIMITIVE_UNDEFINED    = 0,
37601e04c3fSmrg   VGPU10_PRIMITIVE_POINT        = 1,
37701e04c3fSmrg   VGPU10_PRIMITIVE_LINE         = 2,
37801e04c3fSmrg   VGPU10_PRIMITIVE_TRIANGLE     = 3,
37901e04c3fSmrg   VGPU10_PRIMITIVE_LINE_ADJ     = 6,
3807ec681f3Smrg   VGPU10_PRIMITIVE_TRIANGLE_ADJ = 7,
3817ec681f3Smrg   VGPU10_PRIMITIVE_SM40_MAX     = 7,
3827ec681f3Smrg
3837ec681f3Smrg   /* DX11 */
3847ec681f3Smrg   VGPU10_PRIMITIVE_1_CONTROL_POINT_PATCH    = 8,
3857ec681f3Smrg   VGPU10_PRIMITIVE_2_CONTROL_POINT_PATCH    = 9,
3867ec681f3Smrg   VGPU10_PRIMITIVE_3_CONTROL_POINT_PATCH    = 10,
3877ec681f3Smrg   VGPU10_PRIMITIVE_4_CONTROL_POINT_PATCH    = 11,
3887ec681f3Smrg   VGPU10_PRIMITIVE_5_CONTROL_POINT_PATCH    = 12,
3897ec681f3Smrg   VGPU10_PRIMITIVE_6_CONTROL_POINT_PATCH    = 13,
3907ec681f3Smrg   VGPU10_PRIMITIVE_7_CONTROL_POINT_PATCH    = 14,
3917ec681f3Smrg   VGPU10_PRIMITIVE_8_CONTROL_POINT_PATCH    = 15,
3927ec681f3Smrg   VGPU10_PRIMITIVE_9_CONTROL_POINT_PATCH    = 16,
3937ec681f3Smrg   VGPU10_PRIMITIVE_10_CONTROL_POINT_PATCH   = 17,
3947ec681f3Smrg   VGPU10_PRIMITIVE_11_CONTROL_POINT_PATCH   = 18,
3957ec681f3Smrg   VGPU10_PRIMITIVE_12_CONTROL_POINT_PATCH   = 19,
3967ec681f3Smrg   VGPU10_PRIMITIVE_13_CONTROL_POINT_PATCH   = 20,
3977ec681f3Smrg   VGPU10_PRIMITIVE_14_CONTROL_POINT_PATCH   = 21,
3987ec681f3Smrg   VGPU10_PRIMITIVE_15_CONTROL_POINT_PATCH   = 22,
3997ec681f3Smrg   VGPU10_PRIMITIVE_16_CONTROL_POINT_PATCH   = 23,
4007ec681f3Smrg   VGPU10_PRIMITIVE_17_CONTROL_POINT_PATCH   = 24,
4017ec681f3Smrg   VGPU10_PRIMITIVE_18_CONTROL_POINT_PATCH   = 25,
4027ec681f3Smrg   VGPU10_PRIMITIVE_19_CONTROL_POINT_PATCH   = 26,
4037ec681f3Smrg   VGPU10_PRIMITIVE_20_CONTROL_POINT_PATCH   = 27,
4047ec681f3Smrg   VGPU10_PRIMITIVE_21_CONTROL_POINT_PATCH   = 28,
4057ec681f3Smrg   VGPU10_PRIMITIVE_22_CONTROL_POINT_PATCH   = 29,
4067ec681f3Smrg   VGPU10_PRIMITIVE_23_CONTROL_POINT_PATCH   = 30,
4077ec681f3Smrg   VGPU10_PRIMITIVE_24_CONTROL_POINT_PATCH   = 31,
4087ec681f3Smrg   VGPU10_PRIMITIVE_25_CONTROL_POINT_PATCH   = 32,
4097ec681f3Smrg   VGPU10_PRIMITIVE_26_CONTROL_POINT_PATCH   = 33,
4107ec681f3Smrg   VGPU10_PRIMITIVE_27_CONTROL_POINT_PATCH   = 34,
4117ec681f3Smrg   VGPU10_PRIMITIVE_28_CONTROL_POINT_PATCH   = 35,
4127ec681f3Smrg   VGPU10_PRIMITIVE_29_CONTROL_POINT_PATCH   = 36,
4137ec681f3Smrg   VGPU10_PRIMITIVE_30_CONTROL_POINT_PATCH   = 37,
4147ec681f3Smrg   VGPU10_PRIMITIVE_31_CONTROL_POINT_PATCH   = 38,
4157ec681f3Smrg   VGPU10_PRIMITIVE_32_CONTROL_POINT_PATCH   = 39,
4167ec681f3Smrg   VGPU10_PRIMITIVE_MAX                      = 39
41701e04c3fSmrg} VGPU10_PRIMITIVE;
41801e04c3fSmrg
41901e04c3fSmrgtypedef enum {
42001e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_UNDEFINED          = 0,
42101e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_POINTLIST          = 1,
42201e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_LINELIST           = 2,
42301e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_LINESTRIP          = 3,
42401e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLELIST       = 4,
42501e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP      = 5,
42601e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ       = 10,
42701e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ      = 11,
42801e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ   = 12,
42901e04c3fSmrg   VGPU10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ  = 13
43001e04c3fSmrg} VGPU10_PRIMITIVE_TOPOLOGY;
43101e04c3fSmrg
43201e04c3fSmrgtypedef enum {
43301e04c3fSmrg   VGPU10_CUSTOMDATA_COMMENT                       = 0,
43401e04c3fSmrg   VGPU10_CUSTOMDATA_DEBUGINFO                     = 1,
43501e04c3fSmrg   VGPU10_CUSTOMDATA_OPAQUE                        = 2,
43601e04c3fSmrg   VGPU10_CUSTOMDATA_DCL_IMMEDIATE_CONSTANT_BUFFER = 3
43701e04c3fSmrg} VGPU10_CUSTOMDATA_CLASS;
43801e04c3fSmrg
43901e04c3fSmrgtypedef enum {
44001e04c3fSmrg   VGPU10_RESINFO_RETURN_FLOAT      = 0,
44101e04c3fSmrg   VGPU10_RESINFO_RETURN_RCPFLOAT   = 1,
44201e04c3fSmrg   VGPU10_RESINFO_RETURN_UINT       = 2
44301e04c3fSmrg} VGPU10_RESINFO_RETURN_TYPE;
44401e04c3fSmrg
44501e04c3fSmrg
44601e04c3fSmrgtypedef enum {
44701e04c3fSmrg   VGPU10_INSTRUCTION_RETURN_FLOAT  = 0,
44801e04c3fSmrg   VGPU10_INSTRUCTION_RETURN_UINT   = 1
44901e04c3fSmrg} VGPU10_INSTRUCTION_RETURN_TYPE;
45001e04c3fSmrg
4517ec681f3Smrg/* DX11 */
4527ec681f3Smrgtypedef enum {
4537ec681f3Smrg    VGPU10_TESSELLATOR_DOMAIN_UNDEFINED   = 0,
4547ec681f3Smrg    VGPU10_TESSELLATOR_DOMAIN_ISOLINE     = 1,
4557ec681f3Smrg    VGPU10_TESSELLATOR_DOMAIN_TRI         = 2,
4567ec681f3Smrg    VGPU10_TESSELLATOR_DOMAIN_QUAD        = 3,
4577ec681f3Smrg    VGPU10_TESSELLATOR_DOMAIN_MAX         = 3
4587ec681f3Smrg} VGPU10_TESSELLATOR_DOMAIN;
4597ec681f3Smrg
4607ec681f3Smrg/* DX11 */
4617ec681f3Smrgtypedef enum {
4627ec681f3Smrg    VGPU10_TESSELLATOR_PARTITIONING_UNDEFINED         = 0,
4637ec681f3Smrg    VGPU10_TESSELLATOR_PARTITIONING_INTEGER           = 1,
4647ec681f3Smrg    VGPU10_TESSELLATOR_PARTITIONING_POW2              = 2,
4657ec681f3Smrg    VGPU10_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD    = 3,
4667ec681f3Smrg    VGPU10_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN   = 4,
4677ec681f3Smrg    VGPU10_TESSELLATOR_PARTITIONING_MAX               = 4
4687ec681f3Smrg} VGPU10_TESSELLATOR_PARTITIONING;
4697ec681f3Smrg
4707ec681f3Smrg/* DX11 */
4717ec681f3Smrgtypedef enum {
4727ec681f3Smrg    VGPU10_TESSELLATOR_OUTPUT_UNDEFINED      = 0,
4737ec681f3Smrg    VGPU10_TESSELLATOR_OUTPUT_POINT          = 1,
4747ec681f3Smrg    VGPU10_TESSELLATOR_OUTPUT_LINE           = 2,
4757ec681f3Smrg    VGPU10_TESSELLATOR_OUTPUT_TRIANGLE_CW    = 3,
4767ec681f3Smrg    VGPU10_TESSELLATOR_OUTPUT_TRIANGLE_CCW   = 4,
4777ec681f3Smrg    VGPU10_TESSELLATOR_OUTPUT_MAX            = 4
4787ec681f3Smrg} VGPU10_TESSELLATOR_OUTPUT_PRIMITIVE;
4797ec681f3Smrg
48001e04c3fSmrgtypedef union {
48101e04c3fSmrg   struct {
48201e04c3fSmrg      unsigned int opcodeType          : 11; /* VGPU10_OPCODE_TYPE */
48301e04c3fSmrg      unsigned int interpolationMode   : 4;  /* VGPU10_INTERPOLATION_MODE */
48401e04c3fSmrg      unsigned int                     : 3;
48501e04c3fSmrg      unsigned int testBoolean         : 1;  /* VGPU10_INSTRUCTION_TEST_BOOLEAN */
4867ec681f3Smrg      unsigned int preciseValues       : 4;  /* DX11 VGPU10_OPERAND_4_COMPONENT_MASK_* */
4877ec681f3Smrg      unsigned int                     : 1;
48801e04c3fSmrg      unsigned int instructionLength   : 7;
48901e04c3fSmrg      unsigned int extended            : 1;
49001e04c3fSmrg   };
4917ec681f3Smrg   /* VGPU10_OPCODE_VMWARE */
4927ec681f3Smrg   struct {
4937ec681f3Smrg      unsigned int                     : 11;
4947ec681f3Smrg      unsigned int vmwareOpcodeType    : 4;  /* VGPU10_VMWARE_OPCODE_TYPE */
4957ec681f3Smrg   };
49601e04c3fSmrg   struct {
49701e04c3fSmrg      unsigned int                     : 11;
49801e04c3fSmrg      unsigned int resourceDimension   : 5;  /* VGPU10_RESOURCE_DIMENSION */
49901e04c3fSmrg      unsigned int sampleCount         : 7;
50001e04c3fSmrg   };
50101e04c3fSmrg   struct {
50201e04c3fSmrg      unsigned int                     : 11;
50301e04c3fSmrg      unsigned int samplerMode         : 4;  /* VGPU10_SAMPLER_MODE */
50401e04c3fSmrg   };
50501e04c3fSmrg   struct {
50601e04c3fSmrg      unsigned int                     : 11;
50701e04c3fSmrg      unsigned int accessPattern       : 1;  /* VGPU10_CB_ACCESS_PATTERN */
50801e04c3fSmrg   };
50901e04c3fSmrg   struct {
51001e04c3fSmrg      unsigned int                     : 11;
51101e04c3fSmrg      unsigned int primitive           : 6;  /* VGPU10_PRIMITIVE */
51201e04c3fSmrg   };
51301e04c3fSmrg   struct {
51401e04c3fSmrg      unsigned int                     : 11;
51501e04c3fSmrg      unsigned int primitiveTopology   : 6;  /* VGPU10_PRIMITIVE_TOPOLOGY */
51601e04c3fSmrg   };
51701e04c3fSmrg   struct {
51801e04c3fSmrg      unsigned int                     : 11;
51901e04c3fSmrg      unsigned int customDataClass     : 21; /* VGPU10_CUSTOMDATA_CLASS */
52001e04c3fSmrg   };
52101e04c3fSmrg   struct {
52201e04c3fSmrg      unsigned int                     : 11;
52301e04c3fSmrg      unsigned int resinfoReturnType   : 2;  /* VGPU10_RESINFO_RETURN_TYPE */
52401e04c3fSmrg      unsigned int saturate            : 1;
52501e04c3fSmrg   };
52601e04c3fSmrg   struct {
52701e04c3fSmrg      unsigned int                     : 11;
52801e04c3fSmrg      unsigned int refactoringAllowed  : 1;
5297ec681f3Smrg
5307ec681f3Smrg      /* DX11 */
5317ec681f3Smrg      unsigned int enableDoublePrecisionFloatOps   : 1;
5327ec681f3Smrg      unsigned int forceEarlyDepthStencil          : 1;
5337ec681f3Smrg      unsigned int enableRawAndStructuredBuffers   : 1;
53401e04c3fSmrg   };
53501e04c3fSmrg   struct {
53601e04c3fSmrg      unsigned int                     : 11;
53701e04c3fSmrg      unsigned int instReturnType      : 2;  /* VGPU10_INSTRUCTION_RETURN_TYPE */
53801e04c3fSmrg   };
5397ec681f3Smrg
5407ec681f3Smrg   /* DX11 */
5417ec681f3Smrg   struct {
5427ec681f3Smrg      unsigned int                        : 11;
5437ec681f3Smrg      unsigned int syncThreadsInGroup     : 1;
5447ec681f3Smrg      unsigned int syncThreadGroupShared  : 1;
5457ec681f3Smrg      unsigned int syncUAVMemoryGroup     : 1;
5467ec681f3Smrg      unsigned int syncUAVMemoryGlobal    : 1;
5477ec681f3Smrg   };
5487ec681f3Smrg   struct {
5497ec681f3Smrg      unsigned int                     : 11; /* VGPU10_OPCODE_DCL_INPUT_CONTROL_POINT_COUNT
5507ec681f3Smrg                                              * VGPU10_OPCODE_DCL_OUTPUT_CONTROL_POINT_COUNT */
5517ec681f3Smrg      unsigned int controlPointCount   : 6;
5527ec681f3Smrg   };
5537ec681f3Smrg   struct {
5547ec681f3Smrg      unsigned int                     : 11; /* VGPU10_OPCODE_DCL_TESS_DOMAIN */
5557ec681f3Smrg      unsigned int tessDomain          : 2;  /* VGPU10_TESSELLATOR_DOMAIN */
5567ec681f3Smrg   };
5577ec681f3Smrg   struct {
5587ec681f3Smrg      unsigned int                     : 11; /* VGPU10_OPCODE_DCL_TESS_PARTITIONING */
5597ec681f3Smrg      unsigned int tessPartitioning    : 3;  /* VGPU10_TESSELLATOR_PARTITIONING */
5607ec681f3Smrg   };
5617ec681f3Smrg   struct {
5627ec681f3Smrg      unsigned int                     : 11; /* VGPU10_OPCODE_DCL_TESS_OUTPUT_PRIMITIVE */
5637ec681f3Smrg      unsigned int tessOutputPrimitive : 3;  /* VGPU10_TESSELLATOR_OUTPUT_PRIMITIVE */
5647ec681f3Smrg   };
5657ec681f3Smrg   struct {
5667ec681f3Smrg      unsigned int                              : 11; /* VGPU10_OPCODE_DCL_INTERFACE */
5677ec681f3Smrg      unsigned int interfaceIndexedDynamically  : 1;
5687ec681f3Smrg   };
5697ec681f3Smrg   struct {
5707ec681f3Smrg      unsigned int                        : 11; /* VGPU10_OPCODE_DCL_UAV_* */
5717ec681f3Smrg      unsigned int uavResourceDimension   : 5;  /* VGPU10_RESOURCE_DIMENSION */
5727ec681f3Smrg      unsigned int globallyCoherent       : 1;
5737ec681f3Smrg      unsigned int                        : 6;
5747ec681f3Smrg      unsigned int uavHasCounter          : 1;
5757ec681f3Smrg   };
57601e04c3fSmrg   uint32 value;
57701e04c3fSmrg} VGPU10OpcodeToken0;
57801e04c3fSmrg
57901e04c3fSmrg
58001e04c3fSmrgtypedef enum {
58101e04c3fSmrg   VGPU10_EXTENDED_OPCODE_EMPTY = 0,
58201e04c3fSmrg   VGPU10_EXTENDED_OPCODE_SAMPLE_CONTROLS
58301e04c3fSmrg} VGPU10_EXTENDED_OPCODE_TYPE;
58401e04c3fSmrg
58501e04c3fSmrgtypedef union {
58601e04c3fSmrg   struct {
58701e04c3fSmrg      unsigned int opcodeType : 6;  /* VGPU10_EXTENDED_OPCODE_TYPE */
58801e04c3fSmrg      unsigned int            : 3;
58901e04c3fSmrg      unsigned int offsetU    : 4;  /* Two's complement. */
59001e04c3fSmrg      unsigned int offsetV    : 4;  /* Two's complement. */
59101e04c3fSmrg      unsigned int offsetW    : 4;  /* Two's complement. */
59201e04c3fSmrg      unsigned int            : 10;
59301e04c3fSmrg      unsigned int extended   : 1;
59401e04c3fSmrg   };
59501e04c3fSmrg   uint32 value;
59601e04c3fSmrg} VGPU10OpcodeToken1;
59701e04c3fSmrg
59801e04c3fSmrg
59901e04c3fSmrgtypedef enum {
60001e04c3fSmrg   VGPU10_OPERAND_0_COMPONENT = 0,
60101e04c3fSmrg   VGPU10_OPERAND_1_COMPONENT = 1,
60201e04c3fSmrg   VGPU10_OPERAND_4_COMPONENT = 2,
60301e04c3fSmrg   VGPU10_OPERAND_N_COMPONENT = 3   /* Unused for now. */
60401e04c3fSmrg} VGPU10_OPERAND_NUM_COMPONENTS;
60501e04c3fSmrg
60601e04c3fSmrgtypedef enum {
60701e04c3fSmrg   VGPU10_OPERAND_4_COMPONENT_MASK_MODE = 0,
60801e04c3fSmrg   VGPU10_OPERAND_4_COMPONENT_SWIZZLE_MODE = 1,
60901e04c3fSmrg   VGPU10_OPERAND_4_COMPONENT_SELECT_1_MODE = 2
61001e04c3fSmrg} VGPU10_OPERAND_4_COMPONENT_SELECTION_MODE;
61101e04c3fSmrg
61201e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_X    0x1
61301e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_Y    0x2
61401e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_Z    0x4
61501e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_W    0x8
61601e04c3fSmrg
61701e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XY   (VGPU10_OPERAND_4_COMPONENT_MASK_X   | VGPU10_OPERAND_4_COMPONENT_MASK_Y)
61801e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XZ   (VGPU10_OPERAND_4_COMPONENT_MASK_X   | VGPU10_OPERAND_4_COMPONENT_MASK_Z)
61901e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XW   (VGPU10_OPERAND_4_COMPONENT_MASK_X   | VGPU10_OPERAND_4_COMPONENT_MASK_W)
62001e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_YZ   (VGPU10_OPERAND_4_COMPONENT_MASK_Y   | VGPU10_OPERAND_4_COMPONENT_MASK_Z)
62101e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_YW   (VGPU10_OPERAND_4_COMPONENT_MASK_Y   | VGPU10_OPERAND_4_COMPONENT_MASK_W)
62201e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_ZW   (VGPU10_OPERAND_4_COMPONENT_MASK_Z   | VGPU10_OPERAND_4_COMPONENT_MASK_W)
62301e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XYZ  (VGPU10_OPERAND_4_COMPONENT_MASK_XY  | VGPU10_OPERAND_4_COMPONENT_MASK_Z)
62401e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XYW  (VGPU10_OPERAND_4_COMPONENT_MASK_XY  | VGPU10_OPERAND_4_COMPONENT_MASK_W)
62501e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XZW  (VGPU10_OPERAND_4_COMPONENT_MASK_XZ  | VGPU10_OPERAND_4_COMPONENT_MASK_W)
62601e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_YZW  (VGPU10_OPERAND_4_COMPONENT_MASK_YZ  | VGPU10_OPERAND_4_COMPONENT_MASK_W)
62701e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_XYZW (VGPU10_OPERAND_4_COMPONENT_MASK_XYZ | VGPU10_OPERAND_4_COMPONENT_MASK_W)
62801e04c3fSmrg#define VGPU10_OPERAND_4_COMPONENT_MASK_ALL  VGPU10_OPERAND_4_COMPONENT_MASK_XYZW
62901e04c3fSmrg
63001e04c3fSmrg#define VGPU10_REGISTER_INDEX_FROM_SEMANTIC  0xffffffff
63101e04c3fSmrg
63201e04c3fSmrgtypedef enum {
63301e04c3fSmrg   VGPU10_COMPONENT_X = 0,
63401e04c3fSmrg   VGPU10_COMPONENT_Y = 1,
63501e04c3fSmrg   VGPU10_COMPONENT_Z = 2,
63601e04c3fSmrg   VGPU10_COMPONENT_W = 3
63701e04c3fSmrg} VGPU10_COMPONENT_NAME;
63801e04c3fSmrg
63901e04c3fSmrgtypedef enum {
6407ec681f3Smrg   VGPU10_OPERAND_TYPE_TEMP                                 = 0,
6417ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT                                = 1,
6427ec681f3Smrg   VGPU10_OPERAND_TYPE_OUTPUT                               = 2,
6437ec681f3Smrg   VGPU10_OPERAND_TYPE_INDEXABLE_TEMP                       = 3,
6447ec681f3Smrg   VGPU10_OPERAND_TYPE_IMMEDIATE32                          = 4,
6457ec681f3Smrg   VGPU10_OPERAND_TYPE_IMMEDIATE64                          = 5,
6467ec681f3Smrg   VGPU10_OPERAND_TYPE_SAMPLER                              = 6,
6477ec681f3Smrg   VGPU10_OPERAND_TYPE_RESOURCE                             = 7,
6487ec681f3Smrg   VGPU10_OPERAND_TYPE_CONSTANT_BUFFER                      = 8,
6497ec681f3Smrg   VGPU10_OPERAND_TYPE_IMMEDIATE_CONSTANT_BUFFER            = 9,
6507ec681f3Smrg   VGPU10_OPERAND_TYPE_LABEL                                = 10,
6517ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_PRIMITIVEID                    = 11,
6527ec681f3Smrg   VGPU10_OPERAND_TYPE_OUTPUT_DEPTH                         = 12,
6537ec681f3Smrg   VGPU10_OPERAND_TYPE_NULL                                 = 13,
6547ec681f3Smrg   VGPU10_OPERAND_TYPE_SM40_MAX                             = 13,
6557ec681f3Smrg
6567ec681f3Smrg   /* DX10.1 */
6577ec681f3Smrg   VGPU10_OPERAND_TYPE_RASTERIZER                           = 14,
6587ec681f3Smrg   VGPU10_OPERAND_TYPE_OUTPUT_COVERAGE_MASK                 = 15,
6597ec681f3Smrg   VGPU10_OPERAND_TYPE_SM41_MAX                             = 15,
6607ec681f3Smrg
6617ec681f3Smrg   /* DX11 */
6627ec681f3Smrg   VGPU10_OPERAND_TYPE_STREAM                               = 16,
6637ec681f3Smrg   VGPU10_OPERAND_TYPE_FUNCTION_BODY                        = 17,
6647ec681f3Smrg   VGPU10_OPERAND_TYPE_FUNCTION_TABLE                       = 18,
6657ec681f3Smrg   VGPU10_OPERAND_TYPE_INTERFACE                            = 19,
6667ec681f3Smrg   VGPU10_OPERAND_TYPE_FUNCTION_INPUT                       = 20,
6677ec681f3Smrg   VGPU10_OPERAND_TYPE_FUNCTION_OUTPUT                      = 21,
6687ec681f3Smrg   VGPU10_OPERAND_TYPE_OUTPUT_CONTROL_POINT_ID              = 22,
6697ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_FORK_INSTANCE_ID               = 23,
6707ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_JOIN_INSTANCE_ID               = 24,
6717ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_CONTROL_POINT                  = 25,
6727ec681f3Smrg   VGPU10_OPERAND_TYPE_OUTPUT_CONTROL_POINT                 = 26,
6737ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_PATCH_CONSTANT                 = 27,
6747ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_DOMAIN_POINT                   = 28,
6757ec681f3Smrg   VGPU10_OPERAND_TYPE_THIS_POINTER                         = 29,
6767ec681f3Smrg   VGPU10_OPERAND_TYPE_UAV                                  = 30,
6777ec681f3Smrg   VGPU10_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY           = 31,
6787ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_THREAD_ID                      = 32,
6797ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_THREAD_GROUP_ID                = 33,
6807ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_THREAD_ID_IN_GROUP             = 34,
6817ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_COVERAGE_MASK                  = 35,
6827ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_THREAD_ID_IN_GROUP_FLATTENED   = 36,
6837ec681f3Smrg   VGPU10_OPERAND_TYPE_INPUT_GS_INSTANCE_ID                 = 37,
6847ec681f3Smrg   VGPU10_OPERAND_TYPE_OUTPUT_DEPTH_GREATER_EQUAL           = 38,
6857ec681f3Smrg   VGPU10_OPERAND_TYPE_OUTPUT_DEPTH_LESS_EQUAL              = 39,
6867ec681f3Smrg   VGPU10_OPERAND_TYPE_CYCLE_COUNTER                        = 40,
6877ec681f3Smrg   VGPU10_OPERAND_TYPE_SM50_MAX                             = 40,
6887ec681f3Smrg
6897ec681f3Smrg   VGPU10_NUM_OPERANDS
69001e04c3fSmrg} VGPU10_OPERAND_TYPE;
69101e04c3fSmrg
69201e04c3fSmrgtypedef enum {
69301e04c3fSmrg   VGPU10_OPERAND_INDEX_0D = 0,
69401e04c3fSmrg   VGPU10_OPERAND_INDEX_1D = 1,
69501e04c3fSmrg   VGPU10_OPERAND_INDEX_2D = 2,
69601e04c3fSmrg   VGPU10_OPERAND_INDEX_3D = 3
69701e04c3fSmrg} VGPU10_OPERAND_INDEX_DIMENSION;
69801e04c3fSmrg
69901e04c3fSmrgtypedef enum {
70001e04c3fSmrg   VGPU10_OPERAND_INDEX_IMMEDIATE32 = 0,
70101e04c3fSmrg   VGPU10_OPERAND_INDEX_IMMEDIATE64 = 1,
70201e04c3fSmrg   VGPU10_OPERAND_INDEX_RELATIVE = 2,
70301e04c3fSmrg   VGPU10_OPERAND_INDEX_IMMEDIATE32_PLUS_RELATIVE = 3,
70401e04c3fSmrg   VGPU10_OPERAND_INDEX_IMMEDIATE64_PLUS_RELATIVE = 4
70501e04c3fSmrg} VGPU10_OPERAND_INDEX_REPRESENTATION;
70601e04c3fSmrg
70701e04c3fSmrgtypedef union {
70801e04c3fSmrg   struct {
70901e04c3fSmrg      unsigned int numComponents          : 2;  /* VGPU10_OPERAND_NUM_COMPONENTS */
71001e04c3fSmrg      unsigned int selectionMode          : 2;  /* VGPU10_OPERAND_4_COMPONENT_SELECTION_MODE */
71101e04c3fSmrg      unsigned int mask                   : 4;  /* D3D10_SB_OPERAND_4_COMPONENT_MASK_* */
71201e04c3fSmrg      unsigned int                        : 4;
71301e04c3fSmrg      unsigned int operandType            : 8;  /* VGPU10_OPERAND_TYPE */
71401e04c3fSmrg      unsigned int indexDimension         : 2;  /* VGPU10_OPERAND_INDEX_DIMENSION */
71501e04c3fSmrg      unsigned int index0Representation   : 3;  /* VGPU10_OPERAND_INDEX_REPRESENTATION */
71601e04c3fSmrg      unsigned int index1Representation   : 3;  /* VGPU10_OPERAND_INDEX_REPRESENTATION */
71701e04c3fSmrg      unsigned int                        : 3;
71801e04c3fSmrg      unsigned int extended               : 1;
71901e04c3fSmrg   };
72001e04c3fSmrg   struct {
72101e04c3fSmrg      unsigned int                        : 4;
72201e04c3fSmrg      unsigned int swizzleX               : 2;  /* VGPU10_COMPONENT_NAME */
72301e04c3fSmrg      unsigned int swizzleY               : 2;  /* VGPU10_COMPONENT_NAME */
72401e04c3fSmrg      unsigned int swizzleZ               : 2;  /* VGPU10_COMPONENT_NAME */
72501e04c3fSmrg      unsigned int swizzleW               : 2;  /* VGPU10_COMPONENT_NAME */
72601e04c3fSmrg   };
72701e04c3fSmrg   struct {
72801e04c3fSmrg      unsigned int                        : 4;
72901e04c3fSmrg      unsigned int selectMask             : 2;  /* VGPU10_COMPONENT_NAME */
73001e04c3fSmrg   };
73101e04c3fSmrg   uint32 value;
73201e04c3fSmrg} VGPU10OperandToken0;
73301e04c3fSmrg
73401e04c3fSmrg
73501e04c3fSmrgtypedef enum {
73601e04c3fSmrg   VGPU10_EXTENDED_OPERAND_EMPTY = 0,
73701e04c3fSmrg   VGPU10_EXTENDED_OPERAND_MODIFIER = 1
73801e04c3fSmrg} VGPU10_EXTENDED_OPERAND_TYPE;
73901e04c3fSmrg
74001e04c3fSmrgtypedef enum {
74101e04c3fSmrg   VGPU10_OPERAND_MODIFIER_NONE = 0,
74201e04c3fSmrg   VGPU10_OPERAND_MODIFIER_NEG = 1,
74301e04c3fSmrg   VGPU10_OPERAND_MODIFIER_ABS = 2,
74401e04c3fSmrg   VGPU10_OPERAND_MODIFIER_ABSNEG = 3
74501e04c3fSmrg} VGPU10_OPERAND_MODIFIER;
74601e04c3fSmrg
74701e04c3fSmrgtypedef union {
74801e04c3fSmrg   struct {
74901e04c3fSmrg      unsigned int extendedOperandType : 6;  /* VGPU10_EXTENDED_OPERAND_TYPE */
75001e04c3fSmrg      unsigned int operandModifier     : 8;  /* VGPU10_OPERAND_MODIFIER */
75101e04c3fSmrg      unsigned int                     : 17;
75201e04c3fSmrg      unsigned int extended            : 1;
75301e04c3fSmrg   };
75401e04c3fSmrg   uint32 value;
75501e04c3fSmrg} VGPU10OperandToken1;
75601e04c3fSmrg
75701e04c3fSmrg
75801e04c3fSmrgtypedef enum {
75901e04c3fSmrg   VGPU10_RETURN_TYPE_MIN     = 1,
76001e04c3fSmrg   VGPU10_RETURN_TYPE_UNORM   = 1,
76101e04c3fSmrg   VGPU10_RETURN_TYPE_SNORM   = 2,
76201e04c3fSmrg   VGPU10_RETURN_TYPE_SINT    = 3,
76301e04c3fSmrg   VGPU10_RETURN_TYPE_UINT    = 4,
76401e04c3fSmrg   VGPU10_RETURN_TYPE_FLOAT   = 5,
76501e04c3fSmrg   VGPU10_RETURN_TYPE_MIXED   = 6,
76601e04c3fSmrg   VGPU10_RETURN_TYPE_MAX     = 6
76701e04c3fSmrg} VGPU10_RESOURCE_RETURN_TYPE;
76801e04c3fSmrg
76901e04c3fSmrgtypedef union {
77001e04c3fSmrg   struct {
77101e04c3fSmrg      unsigned int component0 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
77201e04c3fSmrg      unsigned int component1 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
77301e04c3fSmrg      unsigned int component2 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
77401e04c3fSmrg      unsigned int component3 : 4;  /* VGPU10_RESOURCE_RETURN_TYPE */
77501e04c3fSmrg   };
77601e04c3fSmrg   uint32 value;
77701e04c3fSmrg} VGPU10ResourceReturnTypeToken;
77801e04c3fSmrg
77901e04c3fSmrg
78001e04c3fSmrgtypedef enum {
78101e04c3fSmrg   VGPU10_NAME_MIN                        = 0,
78201e04c3fSmrg   VGPU10_NAME_UNDEFINED                  = 0,
78301e04c3fSmrg   VGPU10_NAME_POSITION                   = 1,
78401e04c3fSmrg   VGPU10_NAME_CLIP_DISTANCE              = 2,
78501e04c3fSmrg   VGPU10_NAME_CULL_DISTANCE              = 3,
78601e04c3fSmrg   VGPU10_NAME_RENDER_TARGET_ARRAY_INDEX  = 4,
78701e04c3fSmrg   VGPU10_NAME_VIEWPORT_ARRAY_INDEX       = 5,
78801e04c3fSmrg   VGPU10_NAME_VERTEX_ID                  = 6,
78901e04c3fSmrg   VGPU10_NAME_PRIMITIVE_ID               = 7,
79001e04c3fSmrg   VGPU10_NAME_INSTANCE_ID                = 8,
79101e04c3fSmrg   VGPU10_NAME_IS_FRONT_FACE              = 9,
79201e04c3fSmrg   VGPU10_NAME_SAMPLE_INDEX               = 10,
7937ec681f3Smrg   VGPU10_NAME_SM40_MAX                   = 10,
7947ec681f3Smrg
7957ec681f3Smrg   /* DX11 */
7967ec681f3Smrg   VGPU10_NAME_FINAL_QUAD_U_EQ_0_EDGE_TESSFACTOR   = 11,
7977ec681f3Smrg   VGPU10_NAME_FINAL_QUAD_V_EQ_0_EDGE_TESSFACTOR   = 12,
7987ec681f3Smrg   VGPU10_NAME_FINAL_QUAD_U_EQ_1_EDGE_TESSFACTOR   = 13,
7997ec681f3Smrg   VGPU10_NAME_FINAL_QUAD_V_EQ_1_EDGE_TESSFACTOR   = 14,
8007ec681f3Smrg   VGPU10_NAME_FINAL_QUAD_U_INSIDE_TESSFACTOR      = 15,
8017ec681f3Smrg   VGPU10_NAME_FINAL_QUAD_V_INSIDE_TESSFACTOR      = 16,
8027ec681f3Smrg   VGPU10_NAME_FINAL_TRI_U_EQ_0_EDGE_TESSFACTOR    = 17,
8037ec681f3Smrg   VGPU10_NAME_FINAL_TRI_V_EQ_0_EDGE_TESSFACTOR    = 18,
8047ec681f3Smrg   VGPU10_NAME_FINAL_TRI_W_EQ_0_EDGE_TESSFACTOR    = 19,
8057ec681f3Smrg   VGPU10_NAME_FINAL_TRI_INSIDE_TESSFACTOR         = 20,
8067ec681f3Smrg   VGPU10_NAME_FINAL_LINE_DETAIL_TESSFACTOR        = 21,
8077ec681f3Smrg   VGPU10_NAME_FINAL_LINE_DENSITY_TESSFACTOR       = 22,
8087ec681f3Smrg
8097ec681f3Smrg   VGPU10_NAME_MAX                                 = 22
81001e04c3fSmrg} VGPU10_SYSTEM_NAME;
81101e04c3fSmrg
81201e04c3fSmrgtypedef union {
81301e04c3fSmrg   struct {
81401e04c3fSmrg      unsigned int name : 16; /* VGPU10_SYSTEM_NAME */
81501e04c3fSmrg   };
81601e04c3fSmrg   uint32 value;
81701e04c3fSmrg} VGPU10NameToken;
81801e04c3fSmrg
81901e04c3fSmrg#endif
820