public TypeFunction(SpirvTypeBase returnType, params TypeFunctionArgument[] arguments) { ReturnType = returnType; foreach (var argument in arguments) { Arguments.Add(argument); } }
public TypeFunction(SpirvTypeBase returnType, IEnumerable <TypeFunctionArgument> arguments) { ReturnType = returnType; if (arguments != null) { foreach (var argument in arguments) { Arguments.Add(argument); } } }
public TypePointer(StorageClass storageClass, SpirvTypeBase type) { StorageClass = storageClass; Type = type; }
public void SetUp(OpTypePointer op, SpirvInstructionTreeBuilder treeBuilder) { StorageClass = op.StorageClass; Type = treeBuilder.ResolveType(op.Type); SetUpDecorations(op, treeBuilder); }
public static TypeVector ResolveVector(SpirvTypeBase componentType, uint componentCount) { switch (componentType.TypeCategory) { case SpirvTypeCategory.Float: { var sprivFloat = (TypeFloat)componentType; switch (sprivFloat.FloatType) { case FloatType.Float: switch (componentCount) { case 2: return(Vec2); case 3: return(Vec3); case 4: return(Vec4); } break; case FloatType.Double: switch (componentCount) { case 2: return(Dvec2); case 3: return(Dvec3); case 4: return(Dvec4); } break; } break; } case SpirvTypeCategory.Int: { var sprivInt = (TypeInt)componentType; switch (sprivInt.IntType) { case IntType.Int: switch (componentCount) { case 2: return(Ivec2); case 3: return(Ivec3); case 4: return(Ivec4); } break; case IntType.UInt: switch (componentCount) { case 2: return(Uvec2); case 3: return(Uvec3); case 4: return(Uvec4); } break; } break; } case SpirvTypeCategory.Bool: { switch (componentCount) { case 2: return(Bvec2); case 3: return(Bvec3); case 4: return(Bvec4); } break; } } return(new TypeVector(componentType, componentCount)); }
public TypeArray(SpirvTypeBase elementType, uint length) { ElementType = elementType; Length = length; }
public void SetUp(OpTypeRuntimeArray op, SpirvInstructionTreeBuilder treeBuilder) { ElementType = treeBuilder.ResolveType(op.ElementType); SetUpDecorations(op, treeBuilder); }
public TypeStructureField(SpirvTypeBase type, string name = null) { Type = type; Name = name; }
public void SetUp(OpTypeSampledImage op, SpirvInstructionTreeBuilder treeBuilder) { ImageType = treeBuilder.ResolveType(op.ImageType); SetUpDecorations(op, treeBuilder); }
internal TypeVector(SpirvTypeBase componentType, uint componentCount) { ComponentCount = componentCount; ComponentType = componentType; VectorType = GetType(ComponentType, ComponentCount); }
public static VectorType GetType(SpirvTypeBase componentType, uint componentCount) { switch (componentType.TypeCategory) { case SpirvTypeCategory.Float: { var floatType = (TypeFloat)componentType; switch (floatType.FloatType) { case FloatType.Float: switch (componentCount) { case 2: return(VectorType.Vec2); case 3: return(VectorType.Vec3); case 4: return(VectorType.Vec4); } break; case FloatType.Double: switch (componentCount) { case 2: return(VectorType.Dvec2); case 3: return(VectorType.Dvec3); case 4: return(VectorType.Dvec4); } break; } break; } case SpirvTypeCategory.Int: { var intType = (TypeInt)componentType; switch (intType.IntType) { case IntType.Int: switch (componentCount) { case 2: return(VectorType.Ivec2); case 3: return(VectorType.Ivec3); case 4: return(VectorType.Ivec4); } break; case IntType.UInt: switch (componentCount) { case 2: return(VectorType.Uvec2); case 3: return(VectorType.Uvec3); case 4: return(VectorType.Uvec4); } break; } break; } case SpirvTypeCategory.Bool: { switch (componentCount) { case 2: return(VectorType.Bvec2); case 3: return(VectorType.Bvec3); case 4: return(VectorType.Bvec4); } break; } } return(VectorType.Unknown); }
public static TypePointer MakePointer(this SpirvTypeBase type, StorageClass storageClass) { return(new TypePointer(storageClass, type)); }