示例#1
0
        internal EffectParameter(   EffectParameterClass class_, 
                                    EffectParameterType type, 
                                    string name, 
                                    int rowCount, 
                                    int columnCount,
                                    string semantic, 
                                    EffectAnnotationCollection annotations,
                                    EffectParameterCollection elements,
                                    EffectParameterCollection structMembers,
                                    object data )
		{
            ParameterClass = class_;
            ParameterType = type;

            Name = name;
            Semantic = semantic;
            Annotations = annotations;

            RowCount = rowCount;
			ColumnCount = columnCount;

            Elements = elements;
            StructureMembers = structMembers;

            Data = data;
            StateKey = unchecked(NextStateKey++);
		}
 internal EffectTechnique(
     Effect effect, string name, EffectPassCollection passes, EffectAnnotationCollection annotations)
 {
     Name        = name;
     Passes      = passes;
     Annotations = annotations;
 }
示例#3
0
 internal EffectPass(string name, EffectAnnotationCollection annotations, Effect parent, uint passIndex)
 {
     Name         = name;
     Annotations  = annotations;
     parentEffect = parent;
     pass         = passIndex;
 }
示例#4
0
        internal EffectPass(    Effect effect, 
                                string name,
                                Shader vertexShader, 
                                Shader pixelShader, 
                                BlendState blendState, 
                                DepthStencilState depthStencilState, 
                                RasterizerState rasterizerState,
                                EffectAnnotationCollection annotations )
        {
            Debug.Assert(effect != null, "Got a null effect!");
            Debug.Assert(annotations != null, "Got a null annotation collection!");

            _effect = effect;

            Name = name;

            _vertexShader = vertexShader;
            _pixelShader = pixelShader;

            _blendState = blendState;
            _depthStencilState = depthStencilState;
            _rasterizerState = rasterizerState;

            Annotations = annotations;
        }
示例#5
0
		internal EffectTechnique(
			string name,
			IntPtr pointer,
			EffectPassCollection passes,
			EffectAnnotationCollection annotations
		) {
			Name = name;
			Passes = passes;
			Annotations = annotations;
			TechniquePointer = pointer;
		}
示例#6
0
 internal EffectPass(Effect effect, EffectPass cloneSource)
 {
     this._effect            = effect;
     this.Name               = cloneSource.Name;
     this._blendState        = cloneSource._blendState;
     this._depthStencilState = cloneSource._depthStencilState;
     this._rasterizerState   = cloneSource._rasterizerState;
     this.Annotations        = cloneSource.Annotations;
     this._vertexShader      = cloneSource._vertexShader;
     this._pixelShader       = cloneSource._pixelShader;
 }
示例#7
0
		internal EffectPass(
			string name,
			EffectAnnotationCollection annotations,
			Effect parent,
			uint passIndex
		) {
			Name = name;
			Annotations = annotations;
			parentEffect = parent;
			pass = passIndex;
		}
示例#8
0
文件: EffectPass.cs 项目: Zeludon/FEZ
 internal EffectPass(Effect effect, EffectPass cloneSource)
 {
   this._effect = effect;
   this.Name = cloneSource.Name;
   this._blendState = cloneSource._blendState;
   this._depthStencilState = cloneSource._depthStencilState;
   this._rasterizerState = cloneSource._rasterizerState;
   this.Annotations = cloneSource.Annotations;
   this._vertexShader = cloneSource._vertexShader;
   this._pixelShader = cloneSource._pixelShader;
 }
示例#9
0
 internal EffectPass(Effect effect, string name, Shader vertexShader, Shader pixelShader, BlendState blendState, DepthStencilState depthStencilState, RasterizerState rasterizerState, EffectAnnotationCollection annotations)
 {
     this._effect            = effect;
     this.Name               = name;
     this._vertexShader      = vertexShader;
     this._pixelShader       = pixelShader;
     this._blendState        = blendState;
     this._depthStencilState = depthStencilState;
     this._rasterizerState   = rasterizerState;
     this.Annotations        = annotations;
     this.Initialize();
 }
示例#10
0
文件: EffectPass.cs 项目: Zeludon/FEZ
 internal EffectPass(Effect effect, string name, Shader vertexShader, Shader pixelShader, BlendState blendState, DepthStencilState depthStencilState, RasterizerState rasterizerState, EffectAnnotationCollection annotations)
 {
   this._effect = effect;
   this.Name = name;
   this._vertexShader = vertexShader;
   this._pixelShader = pixelShader;
   this._blendState = blendState;
   this._depthStencilState = depthStencilState;
   this._rasterizerState = rasterizerState;
   this.Annotations = annotations;
   this.Initialize();
 }
示例#11
0
 internal EffectParameter(EffectParameterClass class_, EffectParameterType type, string name, int rowCount, int columnCount, int registerCount, string semantic, EffectAnnotationCollection annotations, EffectParameterCollection elements, EffectParameterCollection structMembers, object data)
 {
   this.ParameterClass = class_;
   this.ParameterType = type;
   this.Name = name;
   this.Semantic = semantic;
   this.Annotations = annotations;
   this.RowCount = rowCount;
   this.ColumnCount = columnCount;
   this.RegisterCount = registerCount;
   this.Elements = elements;
   this.StructureMembers = structMembers;
   this.Data = data;
   this.StateKey = EffectParameter.NextStateKey++;
 }
示例#12
0
        internal EffectPass(Effect effect, EffectPass cloneSource)
        {
            Debug.Assert(effect != null, "Got a null effect!");
            Debug.Assert(cloneSource != null, "Got a null cloneSource!");

            _effect = effect;

            // Share all the immutable types.
            Name = cloneSource.Name;
            _blendState = cloneSource._blendState;
            _depthStencilState = cloneSource._depthStencilState;
            _rasterizerState = cloneSource._rasterizerState;
            Annotations = cloneSource.Annotations;
            _vertexShader = cloneSource._vertexShader;
            _pixelShader = cloneSource._pixelShader;
        }
示例#13
0
        internal EffectParameter(
			string name,
			string semantic,
			int rowCount,
			int columnCount,
			int elementCount,
			EffectParameterClass parameterClass,
			EffectParameterType parameterType,
			EffectParameterCollection structureMembers,
			EffectAnnotationCollection annotations,
			IntPtr data
		)
        {
            Name = name;
            Semantic = semantic;
            RowCount = rowCount;
            ColumnCount = columnCount;
            if (elementCount > 0)
            {
                List<EffectParameter> elements = new List<EffectParameter>(elementCount);
                for (int i = 0; i < elementCount; i += 1)
                {
                    // FIXME: Probably incomplete? -flibit
                    elements.Add(new EffectParameter(
                        null,
                        null,
                        rowCount,
                        columnCount,
                        0,
                        ParameterClass,
                        parameterType,
                        null, // FIXME: See mojoshader_effects.c:readvalue -flibit
                        null,
                        new IntPtr(
                            data.ToInt64() + (i * rowCount * columnCount)
                        )
                    ));
                }
                Elements = new EffectParameterCollection(elements);
            }
            ParameterClass = parameterClass;
            ParameterType = parameterType;
            StructureMembers = structureMembers;
            Annotations = annotations;
            values = data;
        }
示例#14
0
        private static EffectAnnotationCollection ReadAnnotations(BinaryReader reader)
        {
            var collection = new EffectAnnotationCollection();

            var count = (int)reader.ReadByte();
            if (count == 0)
                return collection;

            // TODO: Annotations are not implemented!

            return collection;
        }
示例#15
0
 internal EffectTechnique(Effect effect, string name, EffectPassCollection passes, EffectAnnotationCollection annotations)
 {
     Name = name;
     Passes = passes;
     Annotations = annotations;
 }
示例#16
0
        internal EffectParameter(
			string name,
			string semantic,
			int rowCount,
			int columnCount,
			int elementCount,
			EffectParameterClass parameterClass,
			EffectParameterType parameterType,
			EffectParameterCollection structureMembers,
			EffectAnnotationCollection annotations,
			IntPtr data
		)
        {
            Name = name;
            Semantic = semantic;
            RowCount = rowCount;
            ColumnCount = columnCount;
            if (elementCount > 0)
            {
                int curOffset = 0;
                List<EffectParameter> elements = new List<EffectParameter>(elementCount);
                for (int i = 0; i < elementCount; i += 1)
                {
                    EffectParameterCollection elementMembers = null;
                    if (structureMembers != null)
                    {
                        List<EffectParameter> memList = new List<EffectParameter>();
                        for (int j = 0; j < structureMembers.Count; j += 1)
                        {
                            int memElems = 0;
                            if (structureMembers[j].Elements != null)
                            {
                                memElems = structureMembers[j].Elements.Count;
                            }
                            memList.Add(new EffectParameter(
                                structureMembers[j].Name,
                                structureMembers[j].Semantic,
                                structureMembers[j].RowCount,
                                structureMembers[j].ColumnCount,
                                memElems,
                                structureMembers[j].ParameterClass,
                                structureMembers[j].ParameterType,
                                null, // FIXME: Nested structs! -flibit
                                structureMembers[j].Annotations,
                                new IntPtr(data.ToInt64() + curOffset)
                            ));
                            int memSize = structureMembers[j].RowCount * structureMembers[j].ColumnCount;
                            if (memElems > 0)
                            {
                                memSize *= memElems;
                            }
                            curOffset += memSize * 4;
                        }
                        elementMembers = new EffectParameterCollection(memList);
                    }
                    // FIXME: Probably incomplete? -flibit
                    elements.Add(new EffectParameter(
                        null,
                        null,
                        rowCount,
                        columnCount,
                        0,
                        ParameterClass,
                        parameterType,
                        elementMembers,
                        null,
                        new IntPtr(
                            data.ToInt64() + (i * 4 * rowCount * columnCount)
                        )
                    ));
                }
                Elements = new EffectParameterCollection(elements);
            }
            ParameterClass = parameterClass;
            ParameterType = parameterType;
            StructureMembers = structureMembers;
            Annotations = annotations;
            values = data;
        }
示例#17
0
文件: Effect.cs 项目: tanis2000/FEZ
 private static EffectAnnotationCollection ReadAnnotations(BinaryReader reader)
 {
   EffectAnnotationCollection annotationCollection = new EffectAnnotationCollection();
   if ((int) reader.ReadByte() == 0)
     return annotationCollection;
   else
     return annotationCollection;
 }