Changeset 57947 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/disp
- Timestamp:
- Sep 29, 2015 4:53:48 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3DIf.cpp
r57875 r57947 997 997 } 998 998 999 #ifndef D3DCAPS2_CANRENDERWINDOWED 1000 #define D3DCAPS2_CANRENDERWINDOWED UINT32_C(0x00080000) 1001 #endif 1002 1003 #ifdef DEBUG 1004 /* 1005 * Check capabilities reported by wine and log any which are not good enough for a D3D feature level. 1006 */ 1007 1008 #define VBOX_D3D_CHECK_FLAGS(level, field, flags) do { \ 1009 if (((field) & (flags)) != (flags)) \ 1010 { \ 1011 LogRel(("D3D level %s %s flags: 0x%08X -> 0x%08X\n", #level, #field, (field), (flags))); \ 1012 } \ 1013 } while (0) 1014 1015 #define VBOX_D3D_CHECK_VALUE(level, field, value) do { \ 1016 if ((int64_t)(value) >= 0? (field) < (value): (field) > (value)) \ 1017 { \ 1018 LogRel(("D3D level %s %s value: %lld -> %lld\n", #level, #field, (int64_t)(field), (int64_t)(value))); \ 1019 } \ 1020 } while (0) 1021 1022 #define VBOX_D3D_CHECK_VALUE_HEX(level, field, value) do { \ 1023 if ((field) < (value)) \ 1024 { \ 1025 LogRel(("D3D level %s %s value: 0x%08X -> 0x%08X\n", #level, #field, (field), (value))); \ 1026 } \ 1027 } while (0) 1028 1029 static void vboxDispCheckCapsLevel(const D3DCAPS9 *pCaps) 1030 { 1031 /* Misc. */ 1032 VBOX_D3D_CHECK_FLAGS(misc, pCaps->Caps, D3DCAPS_READ_SCANLINE); 1033 VBOX_D3D_CHECK_FLAGS(misc, pCaps->Caps2, D3DCAPS2_CANRENDERWINDOWED | D3DCAPS2_CANSHARERESOURCE); 1034 VBOX_D3D_CHECK_FLAGS(misc, pCaps->DevCaps, D3DDEVCAPS_FLOATTLVERTEX 1035 /*| D3DDEVCAPS_HWVERTEXBUFFER | D3DDEVCAPS_HWINDEXBUFFER | D3DDEVCAPS_SUBVOLUMELOCK */); 1036 VBOX_D3D_CHECK_FLAGS(misc, pCaps->PrimitiveMiscCaps, D3DPMISCCAPS_INDEPENDENTWRITEMASKS /** @todo needs GL_EXT_draw_buffers2 */ 1037 | D3DPMISCCAPS_FOGINFVF 1038 | D3DPMISCCAPS_SEPARATEALPHABLEND 1039 | D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS); 1040 VBOX_D3D_CHECK_FLAGS(misc, pCaps->RasterCaps, D3DPRASTERCAPS_SUBPIXEL 1041 | D3DPRASTERCAPS_STIPPLE 1042 | D3DPRASTERCAPS_ZBIAS 1043 | D3DPRASTERCAPS_COLORPERSPECTIVE); 1044 VBOX_D3D_CHECK_FLAGS(misc, pCaps->TextureCaps, D3DPTEXTURECAPS_TRANSPARENCY 1045 | D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE); 1046 VBOX_D3D_CHECK_FLAGS(misc, pCaps->TextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE); /** @todo needs GL_ARB_texture_mirror_clamp_to_edge */ 1047 VBOX_D3D_CHECK_FLAGS(misc, pCaps->VolumeTextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE); /** @todo needs GL_ARB_texture_mirror_clamp_to_edge */ 1048 VBOX_D3D_CHECK_FLAGS(misc, pCaps->StencilCaps, D3DSTENCILCAPS_TWOSIDED); 1049 VBOX_D3D_CHECK_FLAGS(misc, pCaps->DeclTypes, D3DDTCAPS_FLOAT16_2 | D3DDTCAPS_FLOAT16_4); /** @todo both need GL_ARB_half_float_vertex */ 1050 VBOX_D3D_CHECK_FLAGS(misc, pCaps->VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT 1051 | D3DPTFILTERCAPS_MAGFPOINT); 1052 VBOX_D3D_CHECK_VALUE(misc, pCaps->GuardBandLeft, -8192.); 1053 VBOX_D3D_CHECK_VALUE(misc, pCaps->GuardBandTop, -8192.); 1054 VBOX_D3D_CHECK_VALUE(misc, pCaps->GuardBandRight, 8192.); 1055 VBOX_D3D_CHECK_VALUE(misc, pCaps->GuardBandBottom, 8192.); 1056 VBOX_D3D_CHECK_VALUE(misc, pCaps->VS20Caps.DynamicFlowControlDepth, 24); 1057 VBOX_D3D_CHECK_VALUE(misc, pCaps->VS20Caps.NumTemps, D3DVS20_MAX_NUMTEMPS); 1058 VBOX_D3D_CHECK_VALUE(misc, pCaps->PS20Caps.DynamicFlowControlDepth, 24); 1059 VBOX_D3D_CHECK_VALUE(misc, pCaps->PS20Caps.NumTemps, D3DVS20_MAX_NUMTEMPS); 1060 1061 /* 9_1 */ 1062 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->Caps2, D3DCAPS2_DYNAMICTEXTURES | D3DCAPS2_FULLSCREENGAMMA); 1063 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->PresentationIntervals, D3DPRESENT_INTERVAL_IMMEDIATE | D3DPRESENT_INTERVAL_ONE); 1064 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->PrimitiveMiscCaps, D3DPMISCCAPS_COLORWRITEENABLE); 1065 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->ShadeCaps, D3DPSHADECAPS_ALPHAGOURAUDBLEND | D3DPSHADECAPS_COLORGOURAUDRGB 1066 | D3DPSHADECAPS_FOGGOURAUD | D3DPSHADECAPS_SPECULARGOURAUDRGB); 1067 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->TextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR | D3DPTFILTERCAPS_MINFPOINT 1068 | D3DPTFILTERCAPS_MAGFLINEAR | D3DPTFILTERCAPS_MAGFPOINT); 1069 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->TextureCaps, D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_CUBEMAP 1070 | D3DPTEXTURECAPS_MIPMAP | D3DPTEXTURECAPS_PERSPECTIVE); 1071 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->TextureAddressCaps, D3DPTADDRESSCAPS_CLAMP | D3DPTADDRESSCAPS_INDEPENDENTUV 1072 | D3DPTADDRESSCAPS_MIRROR | D3DPTADDRESSCAPS_WRAP); 1073 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->TextureOpCaps, D3DTEXOPCAPS_DISABLE | D3DTEXOPCAPS_MODULATE 1074 | D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_SELECTARG2); 1075 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->SrcBlendCaps, D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_INVDESTCOLOR 1076 | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_ONE 1077 | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_ZERO); 1078 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->DestBlendCaps, D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_INVSRCALPHA 1079 | D3DPBLENDCAPS_INVSRCCOLOR | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_ZERO); 1080 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR | D3DPTFILTERCAPS_MAGFPOINT 1081 | D3DPTFILTERCAPS_MINFLINEAR | D3DPTFILTERCAPS_MINFPOINT); 1082 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->ZCmpCaps, D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_LESSEQUAL); 1083 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->RasterCaps, D3DPRASTERCAPS_DEPTHBIAS | D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS); 1084 VBOX_D3D_CHECK_FLAGS(9.1, pCaps->StencilCaps, D3DSTENCILCAPS_TWOSIDED); 1085 1086 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxTextureWidth, 2048); 1087 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxTextureHeight, 2048); 1088 VBOX_D3D_CHECK_VALUE(9.1, pCaps->NumSimultaneousRTs, 1); 1089 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxSimultaneousTextures, 8); 1090 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxTextureBlendStages, 8); 1091 VBOX_D3D_CHECK_VALUE_HEX(9.1, pCaps->PixelShaderVersion, D3DPS_VERSION(2,0)); 1092 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxPrimitiveCount, 65535); 1093 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxVertexIndex, 65534); 1094 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxVolumeExtent, 256); 1095 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxTextureRepeat, 128); /* Must be zero, or 128, or greater. */ 1096 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxAnisotropy, 2); 1097 VBOX_D3D_CHECK_VALUE(9.1, pCaps->MaxVertexW, 0.f); 1098 1099 /* 9_2 */ 1100 VBOX_D3D_CHECK_FLAGS(9.2, pCaps->PrimitiveMiscCaps, D3DPMISCCAPS_SEPARATEALPHABLEND); 1101 VBOX_D3D_CHECK_FLAGS(9.2, pCaps->DevCaps2, D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET); 1102 VBOX_D3D_CHECK_FLAGS(9.2, pCaps->TextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE); 1103 VBOX_D3D_CHECK_FLAGS(9.2, pCaps->VolumeTextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE); 1104 VBOX_D3D_CHECK_VALUE(9.2, pCaps->MaxTextureWidth, 2048); 1105 VBOX_D3D_CHECK_VALUE(9.2, pCaps->MaxTextureHeight, 2048); 1106 VBOX_D3D_CHECK_VALUE(9.2, pCaps->MaxTextureRepeat, 2048); /* Must be zero, or 2048, or greater. */ 1107 VBOX_D3D_CHECK_VALUE_HEX(9.2, pCaps->VertexShaderVersion, D3DVS_VERSION(2,0)); 1108 VBOX_D3D_CHECK_VALUE(9.2, pCaps->MaxAnisotropy, 16); 1109 VBOX_D3D_CHECK_VALUE(9.2, pCaps->MaxPrimitiveCount, 1048575); 1110 VBOX_D3D_CHECK_VALUE(9.2, pCaps->MaxVertexIndex, 1048575); 1111 VBOX_D3D_CHECK_VALUE(9.2, pCaps->MaxVertexW, 10000000000.f); 1112 1113 /* 9_3 */ 1114 VBOX_D3D_CHECK_FLAGS(9.3, pCaps->PS20Caps.Caps, D3DPS20CAPS_GRADIENTINSTRUCTIONS); 1115 VBOX_D3D_CHECK_FLAGS(9.3, pCaps->VS20Caps.Caps, D3DVS20CAPS_PREDICATION); 1116 VBOX_D3D_CHECK_FLAGS(9.3, pCaps->PrimitiveMiscCaps, D3DPMISCCAPS_INDEPENDENTWRITEMASKS | D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING); 1117 VBOX_D3D_CHECK_FLAGS(9.3, pCaps->TextureAddressCaps, D3DPTADDRESSCAPS_BORDER); 1118 VBOX_D3D_CHECK_VALUE(9.3, pCaps->MaxTextureWidth, 4096); 1119 VBOX_D3D_CHECK_VALUE(9.3, pCaps->MaxTextureHeight, 4096); 1120 VBOX_D3D_CHECK_VALUE(9.3, pCaps->MaxTextureRepeat, 8192); /* Must be zero, or 8192, or greater. */ 1121 VBOX_D3D_CHECK_VALUE(9.3, pCaps->NumSimultaneousRTs, 4); 1122 VBOX_D3D_CHECK_VALUE(9.3, pCaps->PS20Caps.NumInstructionSlots, 512); /* (Pixel Shader Version 2b) */ 1123 VBOX_D3D_CHECK_VALUE(9.3, pCaps->PS20Caps.NumTemps, 32); /* (Pixel Shader Version 2b) */ 1124 VBOX_D3D_CHECK_VALUE(9.3, pCaps->VS20Caps.NumTemps, 32); /* (Vertex Shader Version 2a) */ 1125 VBOX_D3D_CHECK_VALUE(9.3, pCaps->VS20Caps.StaticFlowControlDepth, 4); 1126 VBOX_D3D_CHECK_VALUE(9.3, pCaps->MaxVertexShaderConst, 256); /* (Vertex Shader Version 2a); */ 1127 VBOX_D3D_CHECK_VALUE(9.3, pCaps->MaxVertexShader30InstructionSlots, 512); 1128 VBOX_D3D_CHECK_VALUE_HEX(9.3, pCaps->VertexShaderVersion, D3DVS_VERSION(3,0)); 1129 1130 LogRel(("Capabilities check completed\n")); 1131 } 1132 1133 #undef VBOX_D3D_CHECK_FLAGS 1134 #undef VBOX_D3D_CHECK_VALUE 1135 #undef VBOX_D3D_CHECK_VALUE_HEX 1136 1137 #endif /* DEBUG */ 1138 999 1139 static HRESULT vboxWddmGetD3D9Caps(PVBOXWDDMDISP_D3D pD3D, D3DCAPS9 *pCaps) 1000 1140 { … … 1005 1145 return hr; 1006 1146 } 1147 1148 #if DEBUG 1149 vboxDispCheckCapsLevel(pCaps); 1150 #endif 1007 1151 1008 1152 /* needed for Windows Media Player to work properly */ … … 1056 1200 #endif 1057 1201 1202 pCaps->MaxVertexW = 10000000000.f; /* Required by D3D feature level 9.3. */ 1203 1204 #if DEBUG 1205 vboxDispCheckCapsLevel(pCaps); 1206 #endif 1207 1058 1208 vboxDispDumpD3DCAPS9(pCaps); 1059 1209
Note:
See TracChangeset
for help on using the changeset viewer.