コード例 #1
0
 public ShaderMember(string name, List <int> arrayDimensions, int elementCount, int startOffset, ShaderElementInfo elementInfo, int sizeOf, ShaderResourceType resType, ShaderResourceBaseType resBaseType)
 {
     Name             = name;
     ArrayDimensions  = arrayDimensions.AsReadOnly();
     ElementCount     = elementCount;
     StartOffset      = startOffset;
     ElementInfo      = elementInfo;
     SizeOf           = sizeOf;
     ResourceType     = resType;
     ResourceBaseType = resBaseType;
 }
コード例 #2
0
ファイル: Translator.cs プロジェクト: Syncaidius/SharpShader
        private ShaderMember PopulateMember(MappedField mField)
        {
            ShaderElementInfo eInfo = new ShaderElementInfo(
                dataType: mField.Type.DataType,
                dimensions: new List <int>(mField.Type.Dimensions),
                size: mField.Type.SizeOf,
                subElementCount: mField.Type.SubElementCount,
                subElementSize: mField.Type.SubElementSizeOf,
                strucType: mField.StructureType
                );

            return(new ShaderMember(
                       name: mField.Name,
                       arrayDimensions: new List <int>(mField.ArrayDimensions),
                       elementCount: mField.GetTotalArrayElements(),
                       startOffset: mField.PackOffsetBytes.HasValue ? mField.PackOffsetBytes.Value : 0,
                       elementInfo: eInfo,
                       sizeOf: mField.GetTotalSizeOf(),
                       resType: mField.ResourceType,
                       resBaseType: mField.ResourceBaseType
                       ));
        }