summaryrefslogtreecommitdiff
path: root/test/Effects11/Binary/EffectBinaryFormat.h
blob: 50c5ce3dfccf099fd4954bbfa62a616b2918928d (plain) (blame)
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
//////////////////////////////////////////////////////////////////////////////
//
//  Copyright (C) Microsoft Corporation.  All Rights Reserved.
//
//  File:       Effect.h
//  Content:    D3DX11 Effects Binary Format
//              This is the binary file interface shared between the Effects 
//              compiler and runtime.
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

namespace D3DX11Effects
{


//////////////////////////////////////////////////////////////////////////
// Version Control
//////////////////////////////////////////////////////////////////////////

#define D3D10_FXL_VERSION(_Major,_Minor) (('F' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor))

struct EVersionTag
{
    const char* m_pName;
    DWORD       m_Version;
    UINT        m_Tag;
};

// versions must be listed in ascending order
static CONST EVersionTag g_EffectVersions[] = 
{
    { "fx_4_0", D3D10_FXL_VERSION(4,0),   0xFEFF1001 },
    { "fx_4_1", D3D10_FXL_VERSION(4,1),   0xFEFF1011 },
    { "fx_5_0", D3D10_FXL_VERSION(5,0),   0xFEFF2001 },
};
#define NUM_EFFECT10_VERSIONS ( sizeof(g_EffectVersions) / sizeof(EVersionTag) )


//////////////////////////////////////////////////////////////////////////
// Reflection & Type structures
//////////////////////////////////////////////////////////////////////////

// Enumeration of the possible left-hand side values of an assignment,
// divided up categorically by the type of block they may appear in
enum ELhsType
{
    ELHS_Invalid,

    // Pass block assignment types

    ELHS_PixelShaderBlock,          // SBlock *pValue points to the block to apply
    ELHS_VertexShaderBlock,
    ELHS_GeometryShaderBlock,
    ELHS_RenderTargetView,
    ELHS_DepthStencilView,

    ELHS_RasterizerBlock,
    ELHS_DepthStencilBlock,
    ELHS_BlendBlock,

    ELHS_GenerateMips,              // This is really a call to D3D::GenerateMips

    // Various SAssignment.Value.*

    ELHS_DS_StencilRef,             // SAssignment.Value.pdValue
    ELHS_B_BlendFactor,             // D3D10_BLEND_CONFIG.BlendFactor, points to a float4
    ELHS_B_SampleMask,              // D3D10_BLEND_CONFIG.SampleMask

    ELHS_GeometryShaderSO,          // When setting SO assignments, GeometryShaderSO precedes the actual GeometryShader assn

    ELHS_ComputeShaderBlock,   
    ELHS_HullShaderBlock,
    ELHS_DomainShaderBlock,

    // Rasterizer

    ELHS_FillMode = 0x20000,
    ELHS_CullMode,
    ELHS_FrontCC,
    ELHS_DepthBias,
    ELHS_DepthBiasClamp,
    ELHS_SlopeScaledDepthBias,
    ELHS_DepthClipEnable,
    ELHS_ScissorEnable,
    ELHS_MultisampleEnable,
    ELHS_AntialiasedLineEnable,

    // Sampler

    ELHS_Filter = 0x30000,
    ELHS_AddressU,
    ELHS_AddressV,
    ELHS_AddressW,
    ELHS_MipLODBias,
    ELHS_MaxAnisotropy,
    ELHS_ComparisonFunc,
    ELHS_BorderColor,
    ELHS_MinLOD,
    ELHS_MaxLOD,
    ELHS_Texture,

    // DepthStencil

    ELHS_DepthEnable = 0x40000,
    ELHS_DepthWriteMask,
    ELHS_DepthFunc,
    ELHS_StencilEnable,
    ELHS_StencilReadMask,
    ELHS_StencilWriteMask,
    ELHS_FrontFaceStencilFailOp,
    ELHS_FrontFaceStencilDepthFailOp,
    ELHS_FrontFaceStencilPassOp,
    ELHS_FrontFaceStencilFunc,
    ELHS_BackFaceStencilFailOp,
    ELHS_BackFaceStencilDepthFailOp,
    ELHS_BackFaceStencilPassOp,
    ELHS_BackFaceStencilFunc,

    // BlendState

    ELHS_AlphaToCoverage = 0x50000,
    ELHS_BlendEnable,
    ELHS_SrcBlend,
    ELHS_DestBlend,
    ELHS_BlendOp,
    ELHS_SrcBlendAlpha,
    ELHS_DestBlendAlpha,
    ELHS_BlendOpAlpha,
    ELHS_RenderTargetWriteMask,
};



enum EBlockType
{
    EBT_Invalid,
    EBT_DepthStencil,
    EBT_Blend,
    EBT_Rasterizer,
    EBT_Sampler,
    EBT_Pass
};

enum EVarType
{
    EVT_Invalid,
    EVT_Numeric,
    EVT_Object,
    EVT_Struct,
    EVT_Interface,
};

enum EScalarType
{
    EST_Invalid,
    EST_Float,
    EST_Int,
    EST_UInt,
    EST_Bool,
    EST_Count
};

enum ENumericLayout
{
    ENL_Invalid,
    ENL_Scalar,
    ENL_Vector,
    ENL_Matrix,
    ENL_Count
};

enum EObjectType
{
    EOT_Invalid,
    EOT_String,
    EOT_Blend,
    EOT_DepthStencil,
    EOT_Rasterizer,
    EOT_PixelShader,
    EOT_VertexShader,
    EOT_GeometryShader,              // Regular geometry shader
    EOT_GeometryShaderSO,            // Geometry shader with a attached StreamOut decl
    EOT_Texture,
    EOT_Texture1D,
    EOT_Texture1DArray,
    EOT_Texture2D,
    EOT_Texture2DArray,
    EOT_Texture2DMS,
    EOT_Texture2DMSArray,
    EOT_Texture3D,
    EOT_TextureCube,
    EOT_ConstantBuffer,
    EOT_RenderTargetView,
    EOT_DepthStencilView,
    EOT_Sampler,
    EOT_Buffer,
    EOT_TextureCubeArray,
    EOT_Count,
    EOT_PixelShader5,
    EOT_VertexShader5,
    EOT_GeometryShader5,
    EOT_ComputeShader5,
    EOT_HullShader5,
    EOT_DomainShader5,
    EOT_RWTexture1D,
    EOT_RWTexture1DArray,
    EOT_RWTexture2D,
    EOT_RWTexture2DArray,
    EOT_RWTexture3D,
    EOT_RWBuffer,
    EOT_ByteAddressBuffer,
    EOT_RWByteAddressBuffer,
    EOT_StructuredBuffer,
    EOT_RWStructuredBuffer,
    EOT_RWStructuredBufferAlloc,
    EOT_RWStructuredBufferConsume,
    EOT_AppendStructuredBuffer,
    EOT_ConsumeStructuredBuffer,
};

D3DX11INLINE BOOL IsObjectTypeHelper(EVarType InVarType,
                                     EObjectType InObjType,
                                     EObjectType TargetObjType)
{
    return (InVarType == EVT_Object) && (InObjType == TargetObjType);
}

D3DX11INLINE BOOL IsSamplerHelper(EVarType InVarType,
                                  EObjectType InObjType)
{
    return (InVarType == EVT_Object) && (InObjType == EOT_Sampler);
}

D3DX11INLINE BOOL IsStateBlockObjectHelper(EVarType InVarType,
                                           EObjectType InObjType)
{
    return (InVarType == EVT_Object) && ((InObjType == EOT_Blend) || (InObjType == EOT_DepthStencil) || (InObjType == EOT_Rasterizer) || IsSamplerHelper(InVarType, InObjType));
}

D3DX11INLINE BOOL IsShaderHelper(EVarType InVarType,
                                 EObjectType InObjType)
{
    return (InVarType == EVT_Object) && ((InObjType == EOT_VertexShader) ||
                                         (InObjType == EOT_VertexShader5) ||
                                         (InObjType == EOT_HullShader5) ||
                                         (InObjType == EOT_DomainShader5) ||
                                         (InObjType == EOT_ComputeShader5) ||
                                         (InObjType == EOT_GeometryShader) ||
                                         (InObjType == EOT_GeometryShaderSO) ||
                                         (InObjType == EOT_GeometryShader5) ||
                                         (InObjType == EOT_PixelShader) ||
                                         (InObjType == EOT_PixelShader5));
}

D3DX11INLINE BOOL IsShader5Helper(EVarType InVarType,
                                  EObjectType InObjType)
{
    return (InVarType == EVT_Object) && ((InObjType == EOT_VertexShader5) ||
                                         (InObjType == EOT_HullShader5) ||
                                         (InObjType == EOT_DomainShader5) ||
                                         (InObjType == EOT_ComputeShader5) ||
                                         (InObjType == EOT_GeometryShader5) ||
                                         (InObjType == EOT_PixelShader5));
}

D3DX11INLINE BOOL IsInterfaceHelper(EVarType InVarType,
                                         EObjectType InObjType)
{
    return (InVarType == EVT_Interface);
}

D3DX11INLINE BOOL IsShaderResourceHelper(EVarType InVarType,
                                         EObjectType InObjType)
{
    return (InVarType == EVT_Object) && ((InObjType == EOT_Texture) ||
                                         (InObjType == EOT_Texture1D) || 
                                         (InObjType == EOT_Texture1DArray) ||
                                         (InObjType == EOT_Texture2D) || 
                                         (InObjType == EOT_Texture2DArray) ||
                                         (InObjType == EOT_Texture2DMS) || 
                                         (InObjType == EOT_Texture2DMSArray) ||
                                         (InObjType == EOT_Texture3D) || 
                                         (InObjType == EOT_TextureCube) ||
                                         (InObjType == EOT_TextureCubeArray) || 
                                         (InObjType == EOT_Buffer) ||
                                         (InObjType == EOT_StructuredBuffer) ||
                                         (InObjType == EOT_ByteAddressBuffer));
}

D3DX11INLINE BOOL IsUnorderedAccessViewHelper(EVarType InVarType,
                                              EObjectType InObjType)
{
    return (InVarType == EVT_Object) &&
        ((InObjType == EOT_RWTexture1D) ||
         (InObjType == EOT_RWTexture1DArray) ||
         (InObjType == EOT_RWTexture2D) ||
         (InObjType == EOT_RWTexture2DArray) ||
         (InObjType == EOT_RWTexture3D) ||
         (InObjType == EOT_RWBuffer) ||
         (InObjType == EOT_RWByteAddressBuffer) ||
         (InObjType == EOT_RWStructuredBuffer) ||
         (InObjType == EOT_RWStructuredBufferAlloc) ||
         (InObjType == EOT_RWStructuredBufferConsume) ||
         (InObjType == EOT_AppendStructuredBuffer) ||
         (InObjType == EOT_ConsumeStructuredBuffer));
}

D3DX11INLINE BOOL IsRenderTargetViewHelper(EVarType InVarType,
                                           EObjectType InObjType)
{
    return (InVarType == EVT_Object) && (InObjType == EOT_RenderTargetView);
}

D3DX11INLINE BOOL IsDepthStencilViewHelper(EVarType InVarType,
                                           EObjectType InObjType)
{
    return (InVarType == EVT_Object) && (InObjType == EOT_DepthStencilView);
}

D3DX11INLINE BOOL IsObjectAssignmentHelper(ELhsType LhsType)
{
    switch(LhsType)
    {
    case ELHS_VertexShaderBlock:
    case ELHS_HullShaderBlock:
    case ELHS_DepthStencilView:
    case ELHS_GeometryShaderBlock:
    case ELHS_PixelShaderBlock:
    case ELHS_ComputeShaderBlock:
    case ELHS_DepthStencilBlock:
    case ELHS_RasterizerBlock:
    case ELHS_BlendBlock:
    case ELHS_Texture:
    case ELHS_RenderTargetView:
    case ELHS_DomainShaderBlock:
        return TRUE;
    }
    return FALSE;
}




// Effect file format structures /////////////////////////////////////////////
// File format:
//   File header (SBinaryHeader Header)
//   Unstructured data block (BYTE[Header.cbUnstructured))
//   Structured data block
//     ConstantBuffer (SBinaryConstantBuffer CB) * Header.Effect.cCBs
//       UINT  NumAnnotations
//       Annotation data (SBinaryAnnotation) * (NumAnnotations) *this structure is variable sized
//       Variable data (SBinaryNumericVariable Var) * (CB.cVariables)
//         UINT  NumAnnotations
//         Annotation data (SBinaryAnnotation) * (NumAnnotations) *this structure is variable sized
//     Object variables (SBinaryObjectVariable Var) * (Header.cObjectVariables) *this structure is variable sized
//       UINT  NumAnnotations
//       Annotation data (SBinaryAnnotation) * (NumAnnotations) *this structure is variable sized
//     Interface variables (SBinaryInterfaceVariable Var) * (Header.cInterfaceVariables) *this structure is variable sized
//       UINT  NumAnnotations
//       Annotation data (SBinaryAnnotation) * (NumAnnotations) *this structure is variable sized
//     Groups (SBinaryGroup Group) * Header.cGroups
//       UINT  NumAnnotations
//       Annotation data (SBinaryAnnotation) * (NumAnnotations) *this structure is variable sized
//       Techniques (SBinaryTechnique Technique) * Group.cTechniques
//         UINT  NumAnnotations
//         Annotation data (SBinaryAnnotation) * (NumAnnotations) *this structure is variable sized
//         Pass (SBinaryPass Pass) * Technique.cPasses
//           UINT  NumAnnotations
//           Annotation data (SBinaryAnnotation) * (NumAnnotations) *this structure is variable sized
//           Pass assignments (SBinaryAssignment) * Pass.cAssignments

struct SBinaryHeader
{
    struct SVarCounts
    {
        UINT  cCBs;
        UINT  cNumericVariables;
        UINT  cObjectVariables;
    };

    UINT        Tag;    // should be equal to c_EffectFileTag
                        // this is used to identify ASCII vs Binary files

    SVarCounts  Effect;
    SVarCounts  Pool;
    
    UINT        cTechniques;
    UINT        cbUnstructured;

    UINT        cStrings;
    UINT        cShaderResources;

    UINT        cDepthStencilBlocks;
    UINT        cBlendStateBlocks;
    UINT        cRasterizerStateBlocks;
    UINT        cSamplers;
    UINT        cRenderTargetViews;
    UINT        cDepthStencilViews;

    UINT        cTotalShaders;
    UINT        cInlineShaders; // of the aforementioned shaders, the number that are defined inline within pass blocks

    D3DX11INLINE bool RequiresPool() const
    {
        return (Pool.cCBs != 0) ||
               (Pool.cNumericVariables != 0) ||
               (Pool.cObjectVariables != 0);
    }
};

struct SBinaryHeader5 : public SBinaryHeader
{
    UINT  cGroups;
    UINT  cUnorderedAccessViews;
    UINT  cInterfaceVariables;
    UINT  cInterfaceVariableElements;
    UINT  cClassInstanceElements;
};

// Constant buffer definition
struct SBinaryConstantBuffer
{
    // private flags
    static const UINT   c_IsTBuffer = (1 << 0);
    static const UINT   c_IsSingle = (1 << 1);

    UINT                oName;                // Offset to constant buffer name
    UINT                Size;                 // Size, in bytes
    UINT                Flags;
    UINT                cVariables;           // # of variables inside this buffer
    UINT                ExplicitBindPoint;    // Defined if the effect file specifies a bind point using the register keyword
                                              // otherwise, -1
};

struct SBinaryAnnotation
{
    UINT  oName;                // Offset to variable name
    UINT  oType;                // Offset to type information (SBinaryType)

    // For numeric annotations:
    // UINT  oDefaultValue;     // Offset to default initializer value
    //
    // For string annotations:
    // UINT  oStringOffsets[Elements]; // Elements comes from the type data at oType
};

struct SBinaryNumericVariable
{
    UINT  oName;                // Offset to variable name
    UINT  oType;                // Offset to type information (SBinaryType)
    UINT  oSemantic;            // Offset to semantic information
    UINT  Offset;               // Offset in parent constant buffer
    UINT  oDefaultValue;        // Offset to default initializer value
    UINT  Flags;                // Explicit bind point
};

struct SBinaryInterfaceVariable
{
    UINT  oName;                // Offset to variable name
    UINT  oType;                // Offset to type information (SBinaryType)
    UINT  oDefaultValue;        // Offset to default initializer array (SBinaryInterfaceInitializer[Elements])
    UINT  Flags;
};

struct SBinaryInterfaceInitializer
{
    UINT  oInstanceName;
    UINT  ArrayIndex;
};

struct SBinaryObjectVariable
{
    UINT  oName;                // Offset to variable name
    UINT  oType;                // Offset to type information (SBinaryType)
    UINT  oSemantic;            // Offset to semantic information
    UINT  ExplicitBindPoint;    // Used when a variable has been explicitly bound (register(XX)). -1 if not

    // Initializer data:
    //
    // The type structure pointed to by oType gives you Elements, 
    // VarType (must be EVT_Object), and ObjectType
    //
    // For ObjectType == EOT_Blend, EOT_DepthStencil, EOT_Rasterizer, EOT_Sampler
    // struct 
    // {
    //   UINT  cAssignments;
    //   SBinaryAssignment Assignments[cAssignments];
    // } Blocks[Elements]
    //
    // For EObjectType == EOT_Texture*, EOT_Buffer
    // <nothing>
    //
    // For EObjectType == EOT_*Shader, EOT_String
    // UINT  oData[Elements]; // offsets to a shader data block or a NULL-terminated string
    //
    // For EObjectType == EOT_GeometryShaderSO
    //   SBinaryGSSOInitializer[Elements]
    //
    // For EObjectType == EOT_*Shader5
    //   SBinaryShaderData5[Elements]
};

struct SBinaryGSSOInitializer
{
    UINT  oShader;              // Offset to shader bytecode data block
    UINT  oSODecl;              // Offset to StreamOutput decl string
};

struct SBinaryShaderData5
{
    UINT  oShader;              // Offset to shader bytecode data block
    UINT  oSODecls[4];          // Offset to StreamOutput decl strings
    UINT  cSODecls;             // Count of valid oSODecls entries.
    UINT  RasterizedStream;     // Which stream is used for rasterization
    UINT  cInterfaceBindings;   // Count of interface bindings.
    UINT  oInterfaceBindings;   // Offset to SBinaryInterfaceInitializer[cInterfaceBindings].
};

struct SBinaryType
{
    UINT        oTypeName;      // Offset to friendly type name ("float4", "VS_OUTPUT")
    EVarType    VarType;        // Numeric, Object, or Struct
    UINT        Elements;       // # of array elements (0 for non-arrays)
    UINT        TotalSize;      // Size in bytes; not necessarily Stride * Elements for arrays 
                                // because of possible gap left in final register
    UINT        Stride;         // If an array, this is the spacing between elements.
                                // For unpacked arrays, always divisible by 16-bytes (1 register).
                                // No support for packed arrays    
    UINT        PackedSize;     // Size, in bytes, of this data typed when fully packed

    struct SBinaryMember
    {
        UINT    oName;          // Offset to structure member name ("m_pFoo")
        UINT    oSemantic;      // Offset to semantic ("POSITION0")
        UINT    Offset;         // Offset, in bytes, relative to start of parent structure
        UINT    oType;          // Offset to member's type descriptor
    };

    // the data that follows depends on the VarType:
    // Numeric: SType::SNumericType
    // Object:  EObjectType
    // Struct:  
    //   struct
    //   {
    //        UINT              cMembers;
    //        SBinaryMembers    Members[cMembers];
    //   } MemberInfo
    //   struct
    //   {
    //        UINT              oBaseClassType;  // Offset to type information (SBinaryType)
    //        UINT              cInterfaces;
    //        UINT              oInterfaceTypes[cInterfaces];
    //   } SBinaryTypeInheritance
    // Interface: (nothing)
};

struct SBinaryNumericType
{
    ENumericLayout  NumericLayout   : 3;    // scalar (1x1), vector (1xN), matrix (NxN)
    EScalarType     ScalarType      : 5;    // float32, int32, int8, etc.
    UINT            Rows            : 3;    // 1 <= Rows <= 4
    UINT            Columns         : 3;    // 1 <= Columns <= 4
    UINT            IsColumnMajor   : 1;    // applies only to matrices
    UINT            IsPackedArray   : 1;    // if this is an array, indicates whether elements should be greedily packed
};

struct SBinaryTypeInheritance
{
    UINT oBaseClass;            // Offset to base class type info or 0 if no base class.
    UINT cInterfaces;

    // Followed by UINT[cInterfaces] with offsets to the type
    // info of each interface.
};

struct SBinaryGroup
{
    UINT  oName;
    UINT  cTechniques;
};

struct SBinaryTechnique
{
    UINT  oName;
    UINT  cPasses;
};

struct SBinaryPass
{
    UINT  oName;
    UINT  cAssignments;
};

enum ECompilerAssignmentType
{
    ECAT_Invalid,                   // Assignment-specific data (always in the unstructured blob)
    ECAT_Constant,                  // -N SConstant structures
    ECAT_Variable,                  // -NULL terminated string with variable name ("foo")
    ECAT_ConstIndex,                // -SConstantIndex structure
    ECAT_VariableIndex,             // -SVariableIndex structure
    ECAT_ExpressionIndex,           // -SIndexedObjectExpression structure
    ECAT_Expression,                // -Data block containing FXLVM code
    ECAT_InlineShader,              // -Data block containing shader
    ECAT_InlineShader5,             // -Data block containing shader with extended 5.0 data (SBinaryShaderData5)
};

struct SBinaryAssignment
{
    UINT  iState;                   // index into g_lvGeneral
    UINT  Index;                    // the particular index to assign to (see g_lvGeneral to find the # of valid indices)
    ECompilerAssignmentType AssignmentType;
    UINT  oInitializer;             // Offset of assignment-specific data

    //struct SConstantAssignment
    //{
    //    UINT  NumConstants;         // number of constants to follow
    //    SCompilerConstant Constants[NumConstants];
    //};

    struct SConstantIndex
    {
        UINT  oArrayName;
        UINT  Index;
    };

    struct SVariableIndex
    {
        UINT  oArrayName;
        UINT  oIndexVarName;
    };

    struct SIndexedObjectExpression
    {   
        UINT  oArrayName;
        UINT  oCode;
    };

    struct SInlineShader
    {
        UINT  oShader;
        UINT  oSODecl;
    };

    //struct SExpression or SInlineShader
    //{
    //    UINT  DataSize;
    //    BYTE Data[DataSize];
    //}

};

struct SBinaryConstant
{
    EScalarType Type;
    union
    {
        BOOL    bValue;
        INT     iValue;
        float   fValue;
    };
};


} // end namespace D3DX11Effects