1
2 #include "nine_debug.h"
3 #include "nine_pipe.h"
4
5 #include <stdio.h>
6 #include "c11/threads.h"
7 #include "util/u_memory.h"
8 #include "util/u_math.h"
9
10 #include "nine_dump.h"
11
12 #if defined(DEBUG) || !defined(NDEBUG)
13
14 static char thread_local tls[128];
15
nine_D3DDEVTYPE_to_str(D3DDEVTYPE type)16 const char *nine_D3DDEVTYPE_to_str(D3DDEVTYPE type)
17 {
18 switch (type) {
19 case D3DDEVTYPE_HAL: return "HAL";
20 case D3DDEVTYPE_NULLREF: return "NULLREF";
21 case D3DDEVTYPE_REF: return "REF";
22 case D3DDEVTYPE_SW: return "SW";
23 default:
24 return "(D3DDEVTYPE_?)";
25 }
26 }
27
nine_D3DPOOL_to_str(D3DPOOL pool)28 const char *nine_D3DPOOL_to_str(D3DPOOL pool)
29 {
30 switch (pool) {
31 case D3DPOOL_DEFAULT: return "DEFAULT";
32 case D3DPOOL_MANAGED: return "MANAGED";
33 case D3DPOOL_SYSTEMMEM: return "SYSTEMMEM";
34 case D3DPOOL_SCRATCH: return "SCRATCH";
35 default:
36 return "(D3DPOOL_?)";
37 }
38 }
39
nine_D3DSAMP_to_str(DWORD samp)40 const char *nine_D3DSAMP_to_str(DWORD samp)
41 {
42 switch (samp) {
43 case D3DSAMP_ADDRESSU: return "ADDRESSU";
44 case D3DSAMP_ADDRESSV: return "ADDRESSV";
45 case D3DSAMP_ADDRESSW: return "ADDRESSW";
46 case D3DSAMP_BORDERCOLOR: return "BORDERCOLOR";
47 case D3DSAMP_MAGFILTER: return "MAGFILTER";
48 case D3DSAMP_MINFILTER: return "MINFILTER";
49 case D3DSAMP_MIPFILTER: return "MIPFILTER";
50 case D3DSAMP_MIPMAPLODBIAS: return "MIPMAPLODBIAS";
51 case D3DSAMP_MAXMIPLEVEL: return "MAXMIPLEVEL";
52 case D3DSAMP_MAXANISOTROPY: return "MAXANISOTROPY";
53 case D3DSAMP_SRGBTEXTURE: return "SRGBTEXTURE";
54 case D3DSAMP_ELEMENTINDEX: return "ELEMENTINDEX";
55 case D3DSAMP_DMAPOFFSET: return "DMAPOFFSET";
56 default:
57 return "(D3DSAMP_?)";
58 }
59 }
60
61 #define C2S(n,s) \
62 do { \
63 if (usage & D3DUSAGE_##n) p += snprintf(&tls[p], sizeof(tls) - p, s); \
64 } while(0)
nine_D3DUSAGE_to_str(DWORD usage)65 const char *nine_D3DUSAGE_to_str(DWORD usage)
66 {
67 int p = 0;
68 tls[0] = 0;
69 C2S(AUTOGENMIPMAP, "MIPGEN");
70 C2S(WRITEONLY, "WO");
71 C2S(DYNAMIC, "DYNAMIC");
72 C2S(DEPTHSTENCIL, "DS");
73 C2S(RENDERTARGET, "RT");
74 C2S(SOFTWAREPROCESSING, "SW");
75 C2S(DONOTCLIP, "NOCLIP");
76 C2S(POINTS, "POINTS");
77 C2S(DMAP, "DMAP");
78 C2S(NPATCHES, "NPATCHES");
79 C2S(RTPATCHES, "RTPATCHES");
80 C2S(TEXTAPI, "TEXTAPI");
81 C2S(NONSECURE, "NONSECURE");
82 C2S(RESTRICTED_CONTENT, "RESTRICTED_CONTENT");
83 C2S(RESTRICT_SHARED_RESOURCE, "RESTRICT_SHARED_RESOURCE");
84 C2S(RESTRICT_SHARED_RESOURCE_DRIVER, "RESTRICT_SHARED_RESOURCE_DRIVER");
85 return tls;
86 }
87 #undef C2S
88
89 #define C2S(n) \
90 do { \
91 if (flags & D3DPRESENTFLAG_##n) \
92 p += snprintf(&tls[p], sizeof(tls) - p, #n); \
93 } while(0)
nine_D3DPRESENTFLAG_to_str(DWORD flags)94 const char *nine_D3DPRESENTFLAG_to_str(DWORD flags)
95 {
96 int p = 0;
97 tls[0] = 0;
98 C2S(DEVICECLIP);
99 C2S(DISCARD_DEPTHSTENCIL);
100 C2S(LOCKABLE_BACKBUFFER);
101 C2S(NOAUTOROTATE);
102 C2S(UNPRUNEDMODE);
103 C2S(VIDEO);
104 C2S(OVERLAY_LIMITEDRGB);
105 C2S(OVERLAY_YCbCr_BT709);
106 C2S(OVERLAY_YCbCr_xvYCC);
107 C2S(RESTRICTED_CONTENT);
108 C2S(RESTRICT_SHARED_RESOURCE_DRIVER);
109 return tls;
110 }
111 #undef C2S
112
113 #define C2S(n) \
114 do { \
115 if (lock & D3DLOCK_##n) p += snprintf(&tls[p], sizeof(tls) - p, #n"|"); \
116 } while(0)
nine_D3DLOCK_to_str(DWORD lock)117 const char *nine_D3DLOCK_to_str(DWORD lock)
118 {
119 int p = 0;
120 tls[0] = 0;
121 C2S(DISCARD);
122 C2S(DONOTWAIT);
123 C2S(NO_DIRTY_UPDATE);
124 C2S(NOOVERWRITE);
125 C2S(NOSYSLOCK);
126 C2S(READONLY);
127 return tls;
128 }
129 #undef C2S
130
nine_D3DRTYPE_to_str(D3DRESOURCETYPE type)131 const char *nine_D3DRTYPE_to_str(D3DRESOURCETYPE type)
132 {
133 switch (type) {
134 case D3DRTYPE_SURFACE: return "SURFACE";
135 case D3DRTYPE_VOLUME: return "VOLUME";
136 case D3DRTYPE_TEXTURE: return "TEXTURE";
137 case D3DRTYPE_VOLUMETEXTURE: return "VOLUMETEXTURE";
138 case D3DRTYPE_CUBETEXTURE: return "CUBETEXTURE";
139 case D3DRTYPE_VERTEXBUFFER: return "VERTEXBUFFER";
140 case D3DRTYPE_INDEXBUFFER: return "INDEXBUFFER";
141 default:
142 return "(D3DRTYPE_?)";
143 }
144 }
145
nine_D3DQUERYTYPE_to_str(D3DQUERYTYPE type)146 const char *nine_D3DQUERYTYPE_to_str(D3DQUERYTYPE type)
147 {
148 switch (type) {
149 case D3DQUERYTYPE_VCACHE: return "VCACHE";
150 case D3DQUERYTYPE_RESOURCEMANAGER: return "RESOURCEMANAGER";
151 case D3DQUERYTYPE_VERTEXSTATS: return "VERTEXSTATS";
152 case D3DQUERYTYPE_EVENT: return "EVENT";
153 case D3DQUERYTYPE_OCCLUSION: return "OCCLUSION";
154 case D3DQUERYTYPE_TIMESTAMP: return "TIMESTAMP";
155 case D3DQUERYTYPE_TIMESTAMPDISJOINT: return "TIMESTAMPDISJOINT";
156 case D3DQUERYTYPE_TIMESTAMPFREQ: return "TIMESTAMPFREQ";
157 case D3DQUERYTYPE_PIPELINETIMINGS: return "PIPELINETIMINGS";
158 case D3DQUERYTYPE_INTERFACETIMINGS: return "INTERFACETIMINGS";
159 case D3DQUERYTYPE_VERTEXTIMINGS: return "VERTEXTIMINGS";
160 case D3DQUERYTYPE_PIXELTIMINGS: return "PIXELTIMINGS";
161 case D3DQUERYTYPE_BANDWIDTHTIMINGS: return "BANDWIDTHTIMINGS";
162 case D3DQUERYTYPE_CACHEUTILIZATION: return "CACHEUTILIZATION";
163 default:
164 return "(D3DQUERYTYPE_?)";
165 }
166 }
167
nine_D3DTSS_to_str(D3DTEXTURESTAGESTATETYPE type)168 const char *nine_D3DTSS_to_str(D3DTEXTURESTAGESTATETYPE type)
169 {
170 switch (type) {
171 case D3DTSS_COLOROP: return "COLOROP";
172 case D3DTSS_ALPHAOP: return "ALPHAOP";
173 case D3DTSS_COLORARG0: return "COLORARG0";
174 case D3DTSS_COLORARG1: return "COLORARG1";
175 case D3DTSS_COLORARG2: return "COLORARG2";
176 case D3DTSS_ALPHAARG0: return "ALPHAARG0";
177 case D3DTSS_ALPHAARG1: return "ALPHAARG1";
178 case D3DTSS_ALPHAARG2: return "ALPHAARG2";
179 case D3DTSS_RESULTARG: return "RESULTARG";
180 case D3DTSS_BUMPENVMAT00: return "BUMPENVMAT00";
181 case D3DTSS_BUMPENVMAT01: return "BUMPENVMAT01";
182 case D3DTSS_BUMPENVMAT10: return "BUMPENVMAT10";
183 case D3DTSS_BUMPENVMAT11: return "BUMPENVMAT11";
184 case D3DTSS_BUMPENVLSCALE: return "BUMPENVLSCALE";
185 case D3DTSS_BUMPENVLOFFSET: return "BUMPENVLOFFSET";
186 case D3DTSS_TEXCOORDINDEX: return "TEXCOORDINDEX";
187 case D3DTSS_TEXTURETRANSFORMFLAGS: return "TEXTURETRANSFORMFLAGS";
188 case D3DTSS_CONSTANT: return "CONSTANT";
189 default:
190 return "(D3DTSS_?)";
191 }
192 }
193
194 #define D3DTOP_TO_STR_CASE(n) case D3DTOP_##n: return #n
nine_D3DTOP_to_str(D3DTEXTUREOP top)195 const char *nine_D3DTOP_to_str(D3DTEXTUREOP top)
196 {
197 switch (top) {
198 D3DTOP_TO_STR_CASE(DISABLE);
199 D3DTOP_TO_STR_CASE(SELECTARG1);
200 D3DTOP_TO_STR_CASE(SELECTARG2);
201 D3DTOP_TO_STR_CASE(MODULATE);
202 D3DTOP_TO_STR_CASE(MODULATE2X);
203 D3DTOP_TO_STR_CASE(MODULATE4X);
204 D3DTOP_TO_STR_CASE(ADD);
205 D3DTOP_TO_STR_CASE(ADDSIGNED);
206 D3DTOP_TO_STR_CASE(ADDSIGNED2X);
207 D3DTOP_TO_STR_CASE(SUBTRACT);
208 D3DTOP_TO_STR_CASE(ADDSMOOTH);
209 D3DTOP_TO_STR_CASE(BLENDDIFFUSEALPHA);
210 D3DTOP_TO_STR_CASE(BLENDTEXTUREALPHA);
211 D3DTOP_TO_STR_CASE(BLENDFACTORALPHA);
212 D3DTOP_TO_STR_CASE(BLENDTEXTUREALPHAPM);
213 D3DTOP_TO_STR_CASE(BLENDCURRENTALPHA);
214 D3DTOP_TO_STR_CASE(PREMODULATE);
215 D3DTOP_TO_STR_CASE(MODULATEALPHA_ADDCOLOR);
216 D3DTOP_TO_STR_CASE(MODULATECOLOR_ADDALPHA);
217 D3DTOP_TO_STR_CASE(MODULATEINVALPHA_ADDCOLOR);
218 D3DTOP_TO_STR_CASE(MODULATEINVCOLOR_ADDALPHA);
219 D3DTOP_TO_STR_CASE(BUMPENVMAP);
220 D3DTOP_TO_STR_CASE(BUMPENVMAPLUMINANCE);
221 D3DTOP_TO_STR_CASE(DOTPRODUCT3);
222 D3DTOP_TO_STR_CASE(MULTIPLYADD);
223 D3DTOP_TO_STR_CASE(LERP);
224 default:
225 return "(D3DTOP_?)";
226 }
227 }
228
229 static const char *
nine_D3DLIGHTTYPE_to_str(D3DLIGHTTYPE type)230 nine_D3DLIGHTTYPE_to_str(D3DLIGHTTYPE type)
231 {
232 switch (type) {
233 case D3DLIGHT_POINT: return "POINT";
234 case D3DLIGHT_SPOT: return "SPOT";
235 case D3DLIGHT_DIRECTIONAL: return "DIRECTIONAL";
236 default:
237 return "(D3DLIGHT_?)";
238 }
239 }
240
241 static const char *
nine_D3DTA_to_str(DWORD value)242 nine_D3DTA_to_str(DWORD value)
243 {
244 switch (value & D3DTA_SELECTMASK) {
245 case D3DTA_DIFFUSE: return "DIFFUSE";
246 case D3DTA_CURRENT: return "CURRENT";
247 case D3DTA_TEXTURE: return "TEXTURE";
248 case D3DTA_TFACTOR: return "TFACTOR";
249 case D3DTA_SPECULAR: return "SPECULAR";
250 case D3DTA_TEMP: return "TEMP";
251 case D3DTA_CONSTANT: return "CONSTANT";
252 default:
253 return "(D3DTA_?)";
254 }
255 }
256
257 static const char *
nine_D3DTSS_TCI_to_str(DWORD value)258 nine_D3DTSS_TCI_to_str(DWORD value)
259 {
260 switch (value & 0xf0000) {
261 case D3DTSS_TCI_PASSTHRU: return "PASSTHRU";
262 case D3DTSS_TCI_CAMERASPACENORMAL: return "CAMERASPACENORMAL";
263 case D3DTSS_TCI_CAMERASPACEPOSITION: return "CAMERASPACEPOSITION";
264 case D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR:
265 return "CAMERASPACEREFLECTIONVECTOR";
266 case D3DTSS_TCI_SPHEREMAP: return "SPHEREMAP";
267 default:
268 return "(D3DTSS_TCI_?)";
269 }
270 }
271
272 static const char *
nine_D3DTTFF_to_str(DWORD value)273 nine_D3DTTFF_to_str(DWORD value)
274 {
275 switch (value) {
276 case D3DTTFF_DISABLE: return "DISABLE";
277 case D3DTTFF_COUNT1: return "COUNT1";
278 case D3DTTFF_COUNT2: return "COUNT2";
279 case D3DTTFF_COUNT3: return "COUNT3";
280 case D3DTTFF_COUNT4: return "COUNT4";
281 case D3DTTFF_PROJECTED: return "PROJECTED";
282 default:
283 return "(D3DTTFF_?)";
284 }
285 }
286
287 void
nine_dump_D3DLIGHT9(unsigned ch,const D3DLIGHT9 * lit)288 nine_dump_D3DLIGHT9(unsigned ch, const D3DLIGHT9 *lit)
289 {
290 DBG_FLAG(ch, "D3DLIGHT9(%p):\n"
291 "Type: %s\n"
292 "Diffuse: (%f %f %f %f)\n"
293 "Specular: (%f %f %f %f)\n"
294 "Ambient: (%f %f %f %f)\n"
295 "Position: (%f %f %f)\n"
296 "Direction: (%f %f %f)\n"
297 "Range: %f\n"
298 "Falloff: %f\n"
299 "Attenuation: %f + %f * d + %f * d^2\n"
300 "Theta: %f deg\n"
301 "Phi: %f deg\n", lit,
302 nine_D3DLIGHTTYPE_to_str(lit->Type),
303 lit->Diffuse.r,lit->Diffuse.r,lit->Diffuse.g,lit->Diffuse.a,
304 lit->Specular.r,lit->Specular.r,lit->Specular.g,lit->Specular.a,
305 lit->Ambient.r,lit->Ambient.r,lit->Ambient.g,lit->Ambient.a,
306 lit->Position.x,lit->Position.y,lit->Position.z,
307 lit->Direction.x,lit->Direction.y,lit->Direction.z,
308 lit->Range,lit->Falloff,
309 lit->Attenuation0,lit->Attenuation1,lit->Attenuation2,
310 lit->Theta * 360.0f / M_PI,lit->Phi * 360.0f / M_PI);
311 }
312
313 void
nine_dump_D3DMATERIAL9(unsigned ch,const D3DMATERIAL9 * mat)314 nine_dump_D3DMATERIAL9(unsigned ch, const D3DMATERIAL9 *mat)
315 {
316 DBG_FLAG(ch, "D3DMATERIAL9(%p):\n"
317 "Diffuse: (%f %f %f %f)\n"
318 "Specular: (%f %f %f %f)\n"
319 "Ambient: (%f %f %f %f)\n"
320 "Emissive: (%f %f %f %f)\n"
321 "Power: %f\n", mat,
322 mat->Diffuse.r,mat->Diffuse.r,mat->Diffuse.g,mat->Diffuse.a,
323 mat->Specular.r,mat->Specular.r,mat->Specular.g,mat->Specular.a,
324 mat->Ambient.r,mat->Ambient.r,mat->Ambient.g,mat->Ambient.a,
325 mat->Emissive.r,mat->Emissive.r,mat->Emissive.g,mat->Emissive.a,
326 mat->Power);
327 }
328
329 void
nine_dump_D3DTSS_value(unsigned ch,D3DTEXTURESTAGESTATETYPE type,DWORD value)330 nine_dump_D3DTSS_value(unsigned ch, D3DTEXTURESTAGESTATETYPE type, DWORD value)
331 {
332 float rgba[4];
333
334 switch (type) {
335 case D3DTSS_COLOROP:
336 case D3DTSS_ALPHAOP:
337 DBG_FLAG(ch, "D3DTSS_%s = %s\n",
338 nine_D3DTSS_to_str(type), nine_D3DTOP_to_str(value));
339 break;
340 case D3DTSS_COLORARG0:
341 case D3DTSS_COLORARG1:
342 case D3DTSS_COLORARG2:
343 case D3DTSS_ALPHAARG0:
344 case D3DTSS_ALPHAARG1:
345 case D3DTSS_ALPHAARG2:
346 case D3DTSS_RESULTARG:
347 DBG_FLAG(ch, "D3DTSS_%s = %s%s%s\n",
348 nine_D3DTSS_to_str(type),
349 (value & D3DTA_COMPLEMENT) ? "COMPLEMENT " : "",
350 (value & D3DTA_ALPHAREPLICATE) ? "ALPHAREPLICATE " : "",
351 nine_D3DTA_to_str(value));
352 break;
353 case D3DTSS_BUMPENVMAT00:
354 case D3DTSS_BUMPENVMAT01:
355 case D3DTSS_BUMPENVMAT10:
356 case D3DTSS_BUMPENVMAT11:
357 case D3DTSS_BUMPENVLSCALE:
358 case D3DTSS_BUMPENVLOFFSET:
359 DBG_FLAG(ch, "D3DTSS_%s = %f\n",
360 nine_D3DTSS_to_str(type), asfloat(value));
361 break;
362 case D3DTSS_TEXCOORDINDEX:
363 DBG_FLAG(ch, "D3DTSS_TEXCOORDINDEX = %s %u\n",
364 nine_D3DTSS_TCI_to_str(value),
365 value & 0xffff);
366 break;
367 case D3DTSS_TEXTURETRANSFORMFLAGS:
368 DBG_FLAG(ch, "D3DTSS_TEXTURETRANSFORMFLAGS = %s\n",
369 nine_D3DTTFF_to_str(value));
370 break;
371 case D3DTSS_CONSTANT:
372 d3dcolor_to_rgba(rgba, value);
373 DBG_FLAG(ch, "D3DTSS_CONSTANT = %f %f %f %F\n",
374 rgba[0],rgba[1],rgba[2],rgba[3]);
375 break;
376 default:
377 DBG_FLAG(ch, "D3DTSS_? = 0x%08x\n", value);
378 break;
379 }
380 }
381
382 void
nine_dump_D3DADAPTER_IDENTIFIER9(unsigned ch,const D3DADAPTER_IDENTIFIER9 * id)383 nine_dump_D3DADAPTER_IDENTIFIER9(unsigned ch, const D3DADAPTER_IDENTIFIER9 *id)
384 {
385 DBG_FLAG(ch, "D3DADAPTER_IDENTIFIER9(%p):\n"
386 "Driver: %s\n"
387 "Description: %s\n"
388 "DeviceName: %s\n"
389 "DriverVersion: %08x.%08x\n"
390 "VendorId: %x\n"
391 "DeviceId: %x\n"
392 "SubSysId: %x\n"
393 "Revision: %u\n"
394 "GUID: %08x.%04x.%04x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x\n"
395 "WHQLLevel: %u\n", id, id->Driver, id->Description,
396 id->DeviceName,
397 id->DriverVersionLowPart, id->DriverVersionHighPart,
398 id->VendorId, id->DeviceId, id->SubSysId,
399 id->Revision,
400 id->DeviceIdentifier.Data1,
401 id->DeviceIdentifier.Data2,
402 id->DeviceIdentifier.Data3,
403 id->DeviceIdentifier.Data4[0],
404 id->DeviceIdentifier.Data4[1],
405 id->DeviceIdentifier.Data4[2],
406 id->DeviceIdentifier.Data4[3],
407 id->DeviceIdentifier.Data4[4],
408 id->DeviceIdentifier.Data4[5],
409 id->DeviceIdentifier.Data4[6],
410 id->DeviceIdentifier.Data4[7],
411 id->WHQLLevel);
412 }
413
414 #define C2S(args...) p += snprintf(&s[p],c-p,args)
415
416 #define CAP_CASE(m,p,n) \
417 do { \
418 if (caps->m & p##_##n) \
419 C2S(" "#n); \
420 else \
421 C2S(" ("#n")"); \
422 } while(0)
423
424 void
nine_dump_D3DCAPS9(unsigned ch,const D3DCAPS9 * caps)425 nine_dump_D3DCAPS9(unsigned ch, const D3DCAPS9 *caps)
426 {
427 const int c = 1 << 17;
428 int p = 0;
429 char *s = (char *)MALLOC(c);
430
431 if (!s) {
432 DBG_FLAG(ch, "D3DCAPS9(%p): (out of memory)\n", caps);
433 return;
434 }
435
436 C2S("DeviceType: %s\n", nine_D3DDEVTYPE_to_str(caps->DeviceType));
437
438 C2S("AdapterOrdinal: %u\nCaps:", caps->AdapterOrdinal);
439 if (caps->Caps & 0x20000)
440 C2S(" READ_SCANLINE");
441 if (caps->Caps & ~0x20000)
442 C2S(" %x", caps->Caps & ~0x20000);
443
444 C2S("\nCaps2:");
445 CAP_CASE(Caps2, D3DCAPS2, CANAUTOGENMIPMAP);
446 CAP_CASE(Caps2, D3DCAPS2, CANCALIBRATEGAMMA);
447 CAP_CASE(Caps2, D3DCAPS2, CANSHARERESOURCE);
448 CAP_CASE(Caps2, D3DCAPS2, CANMANAGERESOURCE);
449 CAP_CASE(Caps2, D3DCAPS2, DYNAMICTEXTURES);
450 CAP_CASE(Caps2, D3DCAPS2, FULLSCREENGAMMA);
451
452 C2S("\nCaps3:");
453 CAP_CASE(Caps3, D3DCAPS3, ALPHA_FULLSCREEN_FLIP_OR_DISCARD);
454 CAP_CASE(Caps3, D3DCAPS3, COPY_TO_VIDMEM);
455 CAP_CASE(Caps3, D3DCAPS3, COPY_TO_SYSTEMMEM);
456 CAP_CASE(Caps3, D3DCAPS3, DXVAHD);
457 CAP_CASE(Caps3, D3DCAPS3, LINEAR_TO_SRGB_PRESENTATION);
458
459 C2S("\nPresentationIntervals:");
460 CAP_CASE(PresentationIntervals, D3DPRESENT_INTERVAL, ONE);
461 CAP_CASE(PresentationIntervals, D3DPRESENT_INTERVAL, TWO);
462 CAP_CASE(PresentationIntervals, D3DPRESENT_INTERVAL, THREE);
463 CAP_CASE(PresentationIntervals, D3DPRESENT_INTERVAL, FOUR);
464 CAP_CASE(PresentationIntervals, D3DPRESENT_INTERVAL, IMMEDIATE);
465
466 C2S("\nCursorCaps:");
467 CAP_CASE(CursorCaps, D3DCURSORCAPS, COLOR);
468 CAP_CASE(CursorCaps, D3DCURSORCAPS, LOWRES);
469
470 C2S("\nDevCaps:");
471 CAP_CASE(DevCaps, D3DDEVCAPS, CANBLTSYSTONONLOCAL);
472 CAP_CASE(DevCaps, D3DDEVCAPS, CANRENDERAFTERFLIP);
473 CAP_CASE(DevCaps, D3DDEVCAPS, DRAWPRIMITIVES2);
474 CAP_CASE(DevCaps, D3DDEVCAPS, DRAWPRIMITIVES2EX);
475 CAP_CASE(DevCaps, D3DDEVCAPS, DRAWPRIMTLVERTEX);
476 CAP_CASE(DevCaps, D3DDEVCAPS, EXECUTESYSTEMMEMORY);
477 CAP_CASE(DevCaps, D3DDEVCAPS, EXECUTEVIDEOMEMORY);
478 CAP_CASE(DevCaps, D3DDEVCAPS, HWRASTERIZATION);
479 CAP_CASE(DevCaps, D3DDEVCAPS, HWTRANSFORMANDLIGHT);
480 CAP_CASE(DevCaps, D3DDEVCAPS, NPATCHES);
481 CAP_CASE(DevCaps, D3DDEVCAPS, PUREDEVICE);
482 CAP_CASE(DevCaps, D3DDEVCAPS, QUINTICRTPATCHES);
483 CAP_CASE(DevCaps, D3DDEVCAPS, RTPATCHES);
484 CAP_CASE(DevCaps, D3DDEVCAPS, RTPATCHHANDLEZERO);
485 CAP_CASE(DevCaps, D3DDEVCAPS, SEPARATETEXTUREMEMORIES);
486 CAP_CASE(DevCaps, D3DDEVCAPS, TEXTURENONLOCALVIDMEM);
487 CAP_CASE(DevCaps, D3DDEVCAPS, TEXTURESYSTEMMEMORY);
488 CAP_CASE(DevCaps, D3DDEVCAPS, TEXTUREVIDEOMEMORY);
489 CAP_CASE(DevCaps, D3DDEVCAPS, TLVERTEXSYSTEMMEMORY);
490 CAP_CASE(DevCaps, D3DDEVCAPS, TLVERTEXVIDEOMEMORY);
491
492 C2S("\nPrimitiveMiscCaps:");
493 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, MASKZ);
494 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, CULLNONE);
495 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, CULLCW);
496 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, CULLCCW);
497 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, COLORWRITEENABLE);
498 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, CLIPPLANESCALEDPOINTS);
499 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, CLIPTLVERTS);
500 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, TSSARGTEMP);
501 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, BLENDOP);
502 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, NULLREFERENCE);
503 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, INDEPENDENTWRITEMASKS);
504 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, PERSTAGECONSTANT);
505 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, POSTBLENDSRGBCONVERT);
506 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, FOGANDSPECULARALPHA);
507 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, SEPARATEALPHABLEND);
508 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, MRTINDEPENDENTBITDEPTHS);
509 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, MRTPOSTPIXELSHADERBLENDING);
510 CAP_CASE(PrimitiveMiscCaps, D3DPMISCCAPS, FOGVERTEXCLAMPED);
511
512 C2S("\nRasterCaps:");
513 CAP_CASE(RasterCaps, D3DPRASTERCAPS, ANISOTROPY);
514 CAP_CASE(RasterCaps, D3DPRASTERCAPS, COLORPERSPECTIVE);
515 CAP_CASE(RasterCaps, D3DPRASTERCAPS, DITHER);
516 CAP_CASE(RasterCaps, D3DPRASTERCAPS, DEPTHBIAS);
517 CAP_CASE(RasterCaps, D3DPRASTERCAPS, FOGRANGE);
518 CAP_CASE(RasterCaps, D3DPRASTERCAPS, FOGTABLE);
519 CAP_CASE(RasterCaps, D3DPRASTERCAPS, FOGVERTEX);
520 CAP_CASE(RasterCaps, D3DPRASTERCAPS, MIPMAPLODBIAS);
521 CAP_CASE(RasterCaps, D3DPRASTERCAPS, MULTISAMPLE_TOGGLE);
522 CAP_CASE(RasterCaps, D3DPRASTERCAPS, SCISSORTEST);
523 CAP_CASE(RasterCaps, D3DPRASTERCAPS, SLOPESCALEDEPTHBIAS);
524 CAP_CASE(RasterCaps, D3DPRASTERCAPS, WBUFFER);
525 CAP_CASE(RasterCaps, D3DPRASTERCAPS, WFOG);
526 CAP_CASE(RasterCaps, D3DPRASTERCAPS, ZBUFFERLESSHSR);
527 CAP_CASE(RasterCaps, D3DPRASTERCAPS, ZFOG);
528 CAP_CASE(RasterCaps, D3DPRASTERCAPS, ZTEST);
529
530 C2S("\nZCmpCaps:");
531 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, ALWAYS);
532 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, EQUAL);
533 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, GREATER);
534 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, GREATEREQUAL);
535 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, LESS);
536 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, LESSEQUAL);
537 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, NEVER);
538 CAP_CASE(ZCmpCaps, D3DPCMPCAPS, NOTEQUAL);
539
540 C2S("\nSrcBlendCaps");
541 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, BLENDFACTOR);
542 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, BOTHINVSRCALPHA);
543 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, BOTHSRCALPHA);
544 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, DESTALPHA);
545 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, DESTCOLOR);
546 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, INVDESTALPHA);
547 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, INVDESTCOLOR);
548 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, INVSRCALPHA);
549 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, INVSRCCOLOR);
550 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, INVSRCCOLOR2);
551 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, ONE);
552 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, SRCALPHA);
553 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, SRCALPHASAT);
554 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, SRCCOLOR);
555 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, SRCCOLOR2);
556 CAP_CASE(SrcBlendCaps, D3DPBLENDCAPS, ZERO);
557
558 C2S("\nDestBlendCaps");
559 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, BLENDFACTOR);
560 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, BOTHINVSRCALPHA);
561 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, BOTHSRCALPHA);
562 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, DESTALPHA);
563 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, DESTCOLOR);
564 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, INVDESTALPHA);
565 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, INVDESTCOLOR);
566 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, INVSRCALPHA);
567 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, INVSRCCOLOR);
568 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, INVSRCCOLOR2);
569 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, ONE);
570 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, SRCALPHA);
571 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, SRCALPHASAT);
572 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, SRCCOLOR);
573 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, SRCCOLOR2);
574 CAP_CASE(DestBlendCaps, D3DPBLENDCAPS, ZERO);
575
576 C2S("\nAlphaCmpCaps:");
577 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, ALWAYS);
578 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, EQUAL);
579 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, GREATER);
580 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, GREATEREQUAL);
581 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, LESS);
582 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, LESSEQUAL);
583 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, NEVER);
584 CAP_CASE(AlphaCmpCaps, D3DPCMPCAPS, NOTEQUAL);
585
586 C2S("\nShadeCaps:");
587 CAP_CASE(ShadeCaps, D3DPSHADECAPS, ALPHAGOURAUDBLEND);
588 CAP_CASE(ShadeCaps, D3DPSHADECAPS, COLORGOURAUDRGB);
589 CAP_CASE(ShadeCaps, D3DPSHADECAPS, FOGGOURAUD);
590 CAP_CASE(ShadeCaps, D3DPSHADECAPS, SPECULARGOURAUDRGB);
591
592 C2S("\nTextureCaps:");
593 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, ALPHA);
594 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, ALPHAPALETTE);
595 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, CUBEMAP);
596 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, CUBEMAP_POW2);
597 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, MIPCUBEMAP);
598 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, MIPMAP);
599 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, MIPVOLUMEMAP);
600 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, NONPOW2CONDITIONAL);
601 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, NOPROJECTEDBUMPENV);
602 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, PERSPECTIVE);
603 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, POW2);
604 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, PROJECTED);
605 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, SQUAREONLY);
606 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, TEXREPEATNOTSCALEDBYSIZE);
607 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, VOLUMEMAP);
608 CAP_CASE(TextureCaps, D3DPTEXTURECAPS, VOLUMEMAP_POW2);
609
610 C2S("\nTextureFilterCaps:");
611 /* CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, CONVOLUTIONMONO); */
612 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MAGFPOINT);
613 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MAGFLINEAR);
614 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MAGFANISOTROPIC);
615 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MAGFPYRAMIDALQUAD);
616 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MAGFGAUSSIANQUAD);
617 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MINFPOINT);
618 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MINFLINEAR);
619 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MINFANISOTROPIC);
620 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MINFPYRAMIDALQUAD);
621 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MINFGAUSSIANQUAD);
622 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MIPFPOINT);
623 CAP_CASE(TextureFilterCaps, D3DPTFILTERCAPS, MIPFLINEAR);
624
625 C2S("\nCubeTextureFilterCaps:");
626 /* CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, CONVOLUTIONMONO); */
627 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MAGFPOINT);
628 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MAGFLINEAR);
629 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MAGFANISOTROPIC);
630 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MAGFPYRAMIDALQUAD);
631 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MAGFGAUSSIANQUAD);
632 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MINFPOINT);
633 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MINFLINEAR);
634 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MINFANISOTROPIC);
635 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MINFPYRAMIDALQUAD);
636 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MINFGAUSSIANQUAD);
637 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MIPFPOINT);
638 CAP_CASE(CubeTextureFilterCaps, D3DPTFILTERCAPS, MIPFLINEAR);
639
640 C2S("\nVolumeTextureFilterCaps:");
641 /* CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, CONVOLUTIONMONO); */
642 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MAGFPOINT);
643 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MAGFLINEAR);
644 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MAGFANISOTROPIC);
645 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MAGFPYRAMIDALQUAD);
646 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MAGFGAUSSIANQUAD);
647 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MINFPOINT);
648 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MINFLINEAR);
649 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MINFANISOTROPIC);
650 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MINFPYRAMIDALQUAD);
651 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MINFGAUSSIANQUAD);
652 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MIPFPOINT);
653 CAP_CASE(VolumeTextureFilterCaps, D3DPTFILTERCAPS, MIPFLINEAR);
654
655 C2S("\nTextureAddressCaps:");
656 CAP_CASE(TextureAddressCaps, D3DPTADDRESSCAPS, BORDER);
657 CAP_CASE(TextureAddressCaps, D3DPTADDRESSCAPS, CLAMP);
658 CAP_CASE(TextureAddressCaps, D3DPTADDRESSCAPS, INDEPENDENTUV);
659 CAP_CASE(TextureAddressCaps, D3DPTADDRESSCAPS, MIRROR);
660 CAP_CASE(TextureAddressCaps, D3DPTADDRESSCAPS, MIRRORONCE);
661 CAP_CASE(TextureAddressCaps, D3DPTADDRESSCAPS, WRAP);
662
663 C2S("\nVolumeTextureAddressCaps:");
664 CAP_CASE(VolumeTextureAddressCaps, D3DPTADDRESSCAPS, BORDER);
665 CAP_CASE(VolumeTextureAddressCaps, D3DPTADDRESSCAPS, CLAMP);
666 CAP_CASE(VolumeTextureAddressCaps, D3DPTADDRESSCAPS, INDEPENDENTUV);
667 CAP_CASE(VolumeTextureAddressCaps, D3DPTADDRESSCAPS, MIRROR);
668 CAP_CASE(VolumeTextureAddressCaps, D3DPTADDRESSCAPS, MIRRORONCE);
669 CAP_CASE(VolumeTextureAddressCaps, D3DPTADDRESSCAPS, WRAP);
670
671 C2S("\nLineCaps:");
672 CAP_CASE(LineCaps, D3DLINECAPS, ALPHACMP);
673 CAP_CASE(LineCaps, D3DLINECAPS, ANTIALIAS);
674 CAP_CASE(LineCaps, D3DLINECAPS, BLEND);
675 CAP_CASE(LineCaps, D3DLINECAPS, FOG);
676 CAP_CASE(LineCaps, D3DLINECAPS, TEXTURE);
677 CAP_CASE(LineCaps, D3DLINECAPS, ZTEST);
678
679 C2S("\nMaxTextureWidth: %u", caps->MaxTextureWidth);
680 C2S("\nMaxTextureHeight: %u", caps->MaxTextureHeight);
681 C2S("\nMaxVolumeExtent: %u", caps->MaxVolumeExtent);
682 C2S("\nMaxTextureRepeat: %u", caps->MaxTextureRepeat);
683 C2S("\nMaxTextureAspectRatio: %u", caps->MaxTextureAspectRatio);
684 C2S("\nMaxAnisotropy: %u", caps->MaxAnisotropy);
685 C2S("\nMaxVertexW: %f", caps->MaxVertexW);
686
687 C2S("\nGuardBandLef,Top,Right,Bottom: %f %f %f %f",
688 caps->GuardBandLeft, caps->GuardBandTop,
689 caps->GuardBandRight, caps->GuardBandBottom);
690
691 C2S("\nExtentsAdjust: %f", caps->ExtentsAdjust);
692
693 C2S("\nStencilCaps:");
694 CAP_CASE(StencilCaps, D3DSTENCILCAPS, KEEP);
695 CAP_CASE(StencilCaps, D3DSTENCILCAPS, ZERO);
696 CAP_CASE(StencilCaps, D3DSTENCILCAPS, REPLACE);
697 CAP_CASE(StencilCaps, D3DSTENCILCAPS, INCRSAT);
698 CAP_CASE(StencilCaps, D3DSTENCILCAPS, DECRSAT);
699 CAP_CASE(StencilCaps, D3DSTENCILCAPS, INVERT);
700 CAP_CASE(StencilCaps, D3DSTENCILCAPS, INCR);
701 CAP_CASE(StencilCaps, D3DSTENCILCAPS, DECR);
702 CAP_CASE(StencilCaps, D3DSTENCILCAPS, TWOSIDED);
703
704 C2S("\nFVFCaps:");
705 CAP_CASE(FVFCaps, D3DFVFCAPS, DONOTSTRIPELEMENTS);
706 CAP_CASE(FVFCaps, D3DFVFCAPS, PSIZE);
707 CAP_CASE(FVFCaps, D3DFVFCAPS, TEXCOORDCOUNTMASK);
708
709 C2S("\nTextureOpCaps:");
710 CAP_CASE(TextureOpCaps, D3DTEXOPCAPS, ADD);
711 CAP_CASE(TextureOpCaps, D3DTEXOPCAPS, ADDSIGNED);
712 C2S(" ...");
713
714 C2S("\nMaxTextureBlendStages: %u", caps->MaxTextureBlendStages);
715 C2S("\nMaxSimultaneousTextures: %u", caps->MaxTextureBlendStages);
716
717 C2S("\nVertexProcessingCaps:");
718 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, DIRECTIONALLIGHTS);
719 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, LOCALVIEWER);
720 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, MATERIALSOURCE7);
721 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, NO_TEXGEN_NONLOCALVIEWER);
722 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, POSITIONALLIGHTS);
723 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, TEXGEN);
724 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, TEXGEN_SPHEREMAP);
725 CAP_CASE(VertexProcessingCaps, D3DVTXPCAPS, TWEENING);
726
727 C2S("\nMaxActiveLights: %u", caps->MaxActiveLights);
728 C2S("\nMaxUserClipPlanes: %u", caps->MaxUserClipPlanes);
729 C2S("\nMaxVertexBlendMatrices: %u", caps->MaxVertexBlendMatrices);
730 C2S("\nMaxVertexBlendMatrixIndex: %u", caps->MaxVertexBlendMatrixIndex);
731 C2S("\nMaxPointSize: %f", caps->MaxPointSize);
732 C2S("\nMaxPrimitiveCount: 0x%x", caps->MaxPrimitiveCount);
733 C2S("\nMaxVertexIndex: 0x%x", caps->MaxVertexIndex);
734 C2S("\nMaxStreams: %u", caps->MaxStreams);
735 C2S("\nMaxStreamStride: 0x%x", caps->MaxStreamStride);
736
737 C2S("\nVertexShaderVersion: %08x", caps->VertexShaderVersion);
738 C2S("\nMaxVertexShaderConst: %u", caps->MaxVertexShaderConst);
739 C2S("\nPixelShaderVersion: %08x", caps->PixelShaderVersion);
740 C2S("\nPixelShader1xMaxValue: %f", caps->PixelShader1xMaxValue);
741
742 DBG_FLAG(ch, "D3DCAPS9(%p) part 1:\n%s\n", caps, s);
743 p = 0;
744
745 C2S("DevCaps2:");
746 CAP_CASE(DevCaps2, D3DDEVCAPS2, ADAPTIVETESSRTPATCH);
747 CAP_CASE(DevCaps2, D3DDEVCAPS2, ADAPTIVETESSNPATCH);
748 CAP_CASE(DevCaps2, D3DDEVCAPS2, CAN_STRETCHRECT_FROM_TEXTURES);
749 CAP_CASE(DevCaps2, D3DDEVCAPS2, DMAPNPATCH);
750 CAP_CASE(DevCaps2, D3DDEVCAPS2, PRESAMPLEDDMAPNPATCH);
751 CAP_CASE(DevCaps2, D3DDEVCAPS2, STREAMOFFSET);
752 CAP_CASE(DevCaps2, D3DDEVCAPS2, VERTEXELEMENTSCANSHARESTREAMOFFSET);
753
754 C2S("\nMasterAdapterOrdinal: %u", caps->MasterAdapterOrdinal);
755 C2S("\nAdapterOrdinalInGroup: %u", caps->AdapterOrdinalInGroup);
756 C2S("\nNumberOfAdaptersInGroup: %u", caps->NumberOfAdaptersInGroup);
757
758 C2S("\nDeclTypes:");
759 CAP_CASE(DeclTypes, D3DDTCAPS, UBYTE4);
760 CAP_CASE(DeclTypes, D3DDTCAPS, UBYTE4N);
761 CAP_CASE(DeclTypes, D3DDTCAPS, SHORT2N);
762 CAP_CASE(DeclTypes, D3DDTCAPS, SHORT4N);
763 CAP_CASE(DeclTypes, D3DDTCAPS, USHORT2N);
764 CAP_CASE(DeclTypes, D3DDTCAPS, USHORT4N);
765 CAP_CASE(DeclTypes, D3DDTCAPS, UDEC3);
766 CAP_CASE(DeclTypes, D3DDTCAPS, DEC3N);
767 CAP_CASE(DeclTypes, D3DDTCAPS, FLOAT16_2);
768 CAP_CASE(DeclTypes, D3DDTCAPS, FLOAT16_4);
769
770 C2S("\nNumSimultaneousRTs: %u", caps->NumSimultaneousRTs);
771
772 C2S("\nStretchRectFilterCaps:");
773 CAP_CASE(StretchRectFilterCaps, D3DPTFILTERCAPS, MINFPOINT);
774 CAP_CASE(StretchRectFilterCaps, D3DPTFILTERCAPS, MINFLINEAR);
775 CAP_CASE(StretchRectFilterCaps, D3DPTFILTERCAPS, MAGFPOINT);
776 CAP_CASE(StretchRectFilterCaps, D3DPTFILTERCAPS, MAGFLINEAR);
777
778 C2S("\nVS20Caps.Caps: Predication=%s", caps->VS20Caps.Caps ? "yes" : "no");
779 C2S("\nVS20Caps.DynamicFlowControlDepth: %u", caps->VS20Caps.DynamicFlowControlDepth);
780 C2S("\nVS20Caps.NumTemps: %u", caps->VS20Caps.NumTemps);
781 C2S("\nVS20Caps.StaticFlowControlDepth: %u", caps->VS20Caps.StaticFlowControlDepth);
782
783 C2S("\nPS20Caps.Caps: Predication=%s", caps->VS20Caps.Caps ? "yes" : "no");
784 C2S("\nPS20Caps.DynamicFlowControlDepth: %u", caps->PS20Caps.DynamicFlowControlDepth);
785 C2S("\nPS20Caps.NumTemps: %u", caps->PS20Caps.NumTemps);
786 C2S("\nPS20Caps.StaticFlowControlDepth: %u", caps->PS20Caps.StaticFlowControlDepth);
787 C2S("\nPS20Caps.NumInstructionSlots: %u", caps->PS20Caps.NumInstructionSlots);
788
789 C2S("\nVertexTextureFilterCaps");
790 /* CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, CONVOLUTIONMONO); */
791 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MAGFPOINT);
792 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MAGFLINEAR);
793 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MAGFANISOTROPIC);
794 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MAGFPYRAMIDALQUAD);
795 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MAGFGAUSSIANQUAD);
796 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MINFPOINT);
797 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MINFLINEAR);
798 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MINFANISOTROPIC);
799 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MINFPYRAMIDALQUAD);
800 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MINFGAUSSIANQUAD);
801 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MIPFPOINT);
802 CAP_CASE(VertexTextureFilterCaps, D3DPTFILTERCAPS, MIPFLINEAR);
803
804 C2S("\nMaxVShaderInstructionsExecuted: %u", caps->MaxVShaderInstructionsExecuted);
805 C2S("\nMaxPShaderInstructionsExecuted: %u", caps->MaxPShaderInstructionsExecuted);
806 C2S("\nMaxVertexShader30InstructionSlots: %u >= 512", caps->MaxVertexShader30InstructionSlots);
807 C2S("\nMaxPixelShader30InstructionSlots: %u >= 512", caps->MaxPixelShader30InstructionSlots);
808
809 DBG_FLAG(ch, "D3DCAPS9(%p) part 2:\n%s\n", caps, s);
810
811 FREE(s);
812 }
813
814 #endif /* DEBUG || !NDEBUG */
815