Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ProfileCapabilities.cs
Go to the documentation of this file.
1using System;
4
6
7internal class ProfileCapabilities
8{
10
11 internal uint VertexShaderVersion;
12
13 internal uint PixelShaderVersion;
14
15 internal bool OcclusionQuery;
16
17 internal bool GetBackBufferData;
18
19 internal bool SeparateAlphaBlend;
20
21 internal bool DestBlendSrcAlphaSat;
22
23 internal bool MinMaxSrcDestBlend;
24
25 internal int MaxPrimitiveCount;
26
27 internal bool IndexElementSize32;
28
29 internal int MaxVertexStreams;
30
31 internal int MaxStreamStride;
32
33 internal int MaxVertexBufferSize;
34
35 internal int MaxIndexBufferSize;
36
37 internal int MaxTextureSize;
38
39 internal int MaxCubeSize;
40
41 internal int MaxVolumeExtent;
42
44
45 internal int MaxSamplers;
46
47 internal int MaxVertexSamplers;
48
49 internal int MaxRenderTargets;
50
51 internal bool NonPow2Unconditional;
52
53 internal bool NonPow2Cube;
54
55 internal bool NonPow2Volume;
56
58
60
62
64
66
68
70
72
73 internal static readonly ProfileCapabilities Reach = new ProfileCapabilities
74 {
78 OcclusionQuery = false,
79 GetBackBufferData = false,
80 SeparateAlphaBlend = false,
82 MinMaxSrcDestBlend = false,
83 MaxPrimitiveCount = 65535,
84 IndexElementSize32 = false,
86 MaxStreamStride = 255,
87 MaxVertexBufferSize = 67108863,
88 MaxIndexBufferSize = 67108863,
89 MaxTextureSize = 2048,
90 MaxCubeSize = 512,
93 MaxSamplers = 16,
97 NonPow2Cube = false,
98 NonPow2Volume = false,
100 {
101 SurfaceFormat.Color,
102 SurfaceFormat.Bgr565,
103 SurfaceFormat.Bgra5551,
104 SurfaceFormat.Bgra4444,
105 SurfaceFormat.Dxt1,
106 SurfaceFormat.Dxt3,
107 SurfaceFormat.Dxt5,
108 SurfaceFormat.NormalizedByte2,
109 SurfaceFormat.NormalizedByte4
110 },
112 {
113 SurfaceFormat.Color,
114 SurfaceFormat.Bgr565,
115 SurfaceFormat.Bgra5551,
116 SurfaceFormat.Bgra4444,
117 SurfaceFormat.Dxt1,
118 SurfaceFormat.Dxt3,
119 SurfaceFormat.Dxt5
120 },
122 {
123 DepthFormat.Depth16,
124 DepthFormat.Depth24,
125 DepthFormat.Depth24Stencil8
126 },
128 {
130 VertexElementFormat.Single,
131 VertexElementFormat.Vector2,
132 VertexElementFormat.Vector3,
133 VertexElementFormat.Vector4,
135 VertexElementFormat.Short2,
136 VertexElementFormat.Short4,
137 VertexElementFormat.NormalizedShort2,
138 VertexElementFormat.NormalizedShort4
139 }
140 };
141
142 internal static readonly ProfileCapabilities HiDef = new ProfileCapabilities
143 {
147 OcclusionQuery = true,
148 GetBackBufferData = true,
149 SeparateAlphaBlend = true,
151 MinMaxSrcDestBlend = false,
152 MaxPrimitiveCount = 1048575,
153 IndexElementSize32 = true,
154 MaxVertexStreams = 16,
155 MaxStreamStride = 255,
156 MaxVertexBufferSize = 67108863,
157 MaxIndexBufferSize = 67108863,
158 MaxTextureSize = 4096,
159 MaxCubeSize = 4096,
160 MaxVolumeExtent = 256,
162 MaxSamplers = 16,
166 NonPow2Cube = true,
167 NonPow2Volume = true,
169 {
170 SurfaceFormat.Color,
171 SurfaceFormat.Bgr565,
172 SurfaceFormat.Bgra5551,
173 SurfaceFormat.Bgra4444,
174 SurfaceFormat.Dxt1,
175 SurfaceFormat.Dxt3,
176 SurfaceFormat.Dxt5,
177 SurfaceFormat.NormalizedByte2,
178 SurfaceFormat.NormalizedByte4,
179 SurfaceFormat.Rgba1010102,
180 SurfaceFormat.Rg32,
181 SurfaceFormat.Rgba64,
182 SurfaceFormat.Alpha8,
183 SurfaceFormat.Single,
184 SurfaceFormat.Vector2,
185 SurfaceFormat.Vector4,
186 SurfaceFormat.HalfSingle,
187 SurfaceFormat.HalfVector2,
188 SurfaceFormat.HalfVector4,
189 SurfaceFormat.HdrBlendable
190 },
192 {
193 SurfaceFormat.Color,
194 SurfaceFormat.Bgr565,
195 SurfaceFormat.Bgra5551,
196 SurfaceFormat.Bgra4444,
197 SurfaceFormat.Dxt1,
198 SurfaceFormat.Dxt3,
199 SurfaceFormat.Dxt5,
200 SurfaceFormat.Rgba1010102,
201 SurfaceFormat.Rg32,
202 SurfaceFormat.Rgba64,
203 SurfaceFormat.Alpha8,
204 SurfaceFormat.Single,
205 SurfaceFormat.Vector2,
206 SurfaceFormat.Vector4,
207 SurfaceFormat.HalfSingle,
208 SurfaceFormat.HalfVector2,
209 SurfaceFormat.HalfVector4,
210 SurfaceFormat.HdrBlendable
211 },
213 {
214 SurfaceFormat.Color,
215 SurfaceFormat.Bgr565,
216 SurfaceFormat.Bgra5551,
217 SurfaceFormat.Bgra4444,
218 SurfaceFormat.Rgba1010102,
219 SurfaceFormat.Rg32,
220 SurfaceFormat.Rgba64,
221 SurfaceFormat.Alpha8,
222 SurfaceFormat.Single,
223 SurfaceFormat.Vector2,
224 SurfaceFormat.Vector4,
225 SurfaceFormat.HalfSingle,
226 SurfaceFormat.HalfVector2,
227 SurfaceFormat.HalfVector4,
228 SurfaceFormat.HdrBlendable
229 },
231 {
232 SurfaceFormat.Single,
233 SurfaceFormat.Vector2,
234 SurfaceFormat.Vector4,
235 SurfaceFormat.HalfSingle,
236 SurfaceFormat.HalfVector2,
237 SurfaceFormat.HalfVector4,
238 SurfaceFormat.HdrBlendable
239 },
241 {
242 SurfaceFormat.Single,
243 SurfaceFormat.Vector2,
244 SurfaceFormat.Vector4,
245 SurfaceFormat.HalfSingle,
246 SurfaceFormat.HalfVector2,
247 SurfaceFormat.HalfVector4,
248 SurfaceFormat.HdrBlendable
249 },
251 {
252 SurfaceFormat.Single,
253 SurfaceFormat.Vector2,
254 SurfaceFormat.Vector4,
255 SurfaceFormat.HalfSingle,
256 SurfaceFormat.HalfVector2,
257 SurfaceFormat.HalfVector4
258 },
260 {
261 DepthFormat.Depth16,
262 DepthFormat.Depth24,
263 DepthFormat.Depth24Stencil8
264 },
266 {
268 VertexElementFormat.Single,
269 VertexElementFormat.Vector2,
270 VertexElementFormat.Vector3,
271 VertexElementFormat.Vector4,
273 VertexElementFormat.Short2,
274 VertexElementFormat.Short4,
275 VertexElementFormat.NormalizedShort2,
276 VertexElementFormat.NormalizedShort4,
277 VertexElementFormat.HalfVector2,
278 VertexElementFormat.HalfVector4
279 }
280 };
281
283 {
284 return graphicsProfile switch
285 {
286 GraphicsProfile.Reach => Reach,
287 GraphicsProfile.HiDef => HiDef,
288 _ => throw new ArgumentOutOfRangeException("graphicsProfile"),
289 };
290 }
291
292 internal void ThrowNotSupportedException(string message)
293 {
294 throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, message, new object[1] { Profile }));
295 }
296
297 internal void ThrowNotSupportedException(string message, object arg1)
298 {
299 throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, message, new object[2] { Profile, arg1 }));
300 }
301
302 internal void ThrowNotSupportedException(string message, object arg1, object arg2)
303 {
304 throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, message, new object[3] { Profile, arg1, arg2 }));
305 }
306}
void ThrowNotSupportedException(string message, object arg1)
void ThrowNotSupportedException(string message, object arg1, object arg2)
static ProfileCapabilities GetInstance(GraphicsProfile graphicsProfile)
static CultureInfo CurrentCulture