From a8242b4f63517825afb026ca7ff4fce6c68409f2 Mon Sep 17 00:00:00 2001 From: chuikingshek Date: Wed, 6 Aug 2025 10:57:35 +0800 Subject: [PATCH 1/2] Unicode: remove tchar.h, bring the project code base to Unicode --- CMakeLists.txt | 2 + ddraw.cpp | 886 ++++++++++---------- dxg.cpp | 1213 +++++++++++++-------------- dxgi.cpp | 2114 ++++++++++++++++++++++++------------------------ dxprint.cpp | 60 +- dxview.cpp | 263 +++--- dxview.h | 72 +- dxview.rc | 2 +- 8 files changed, 2326 insertions(+), 2286 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c83139..4d67f2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,8 @@ add_executable(${PROJECT_NAME} WIN32 resource.h dxview.rc) +target_compile_options(${PROJECT_NAME} PRIVATE $<$:/utf-8>) +target_compile_definitions(${PROJECT_NAME} PRIVATE _UNICODE UNICODE) target_link_libraries(${PROJECT_NAME} PRIVATE dxguid.lib comctl32.lib version.lib) find_package(directx-headers CONFIG QUIET) diff --git a/ddraw.cpp b/ddraw.cpp index bd56888..f753fdc 100644 --- a/ddraw.cpp +++ b/ddraw.cpp @@ -13,7 +13,7 @@ #include #include -extern HRESULT Int2Str(_Out_writes_bytes_(nDestLen) LPTSTR pszDest, UINT nDestLen, DWORD i); +extern HRESULT Int2Str(_Out_writes_bytes_(nDestLen) LPWSTR pszDest, UINT nDestLen, DWORD i); namespace { @@ -43,63 +43,63 @@ namespace //----------------------------------------------------------------------------- CAPDEF OtherInfoDefs[] = { - DDVALDEF("dwVidMemTotal", dwVidMemTotal), - DDVALDEF("dwVidMemFree", dwVidMemFree), - DDHEXDEF("dwAlphaBltConstBitDepths", dwAlphaBltConstBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaBltConstBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaBltConstBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaBltConstBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaBltConstBitDepths, DDBD_32), - DDHEXDEF("dwAlphaBltPixelBitDepths", dwAlphaBltPixelBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaBltPixelBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaBltPixelBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaBltPixelBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaBltPixelBitDepths, DDBD_32), - DDHEXDEF("dwAlphaBltSurfaceBitDepths", dwAlphaBltSurfaceBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaBltSurfaceBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaBltSurfaceBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaBltSurfaceBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaBltSurfaceBitDepths, DDBD_32), - DDHEXDEF("dwAlphaOverlayConstBitDepths", dwAlphaOverlayConstBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaOverlayConstBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaOverlayConstBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaOverlayConstBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaOverlayConstBitDepths, DDBD_32), - DDHEXDEF("dwAlphaOverlayPixelBitDepths", dwAlphaOverlayPixelBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaOverlayPixelBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaOverlayPixelBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaOverlayPixelBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaOverlayPixelBitDepths, DDBD_32), - DDHEXDEF("dwAlphaOverlaySurfaceBitDepths", dwAlphaOverlaySurfaceBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaOverlaySurfaceBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaOverlaySurfaceBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaOverlaySurfaceBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaOverlaySurfaceBitDepths, DDBD_32), - DDHEXDEF("dwZBufferBitDepths", dwZBufferBitDepths), - DDCAPDEF(" DDBD_8", dwZBufferBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwZBufferBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwZBufferBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwZBufferBitDepths, DDBD_32), - DDVALDEF("dwMaxVisibleOverlays", dwMaxVisibleOverlays), - DDVALDEF("dwCurrVisibleOverlays", dwCurrVisibleOverlays), - DDVALDEF("dwNumFourCCCodes", dwNumFourCCCodes), - DDVALDEF("dwAlignBoundarySrc", dwAlignBoundarySrc), - DDVALDEF("dwAlignSizeSrc", dwAlignSizeSrc), - DDVALDEF("dwAlignBoundaryDest", dwAlignBoundaryDest), - DDVALDEF("dwAlignSizeDest", dwAlignSizeDest), - DDVALDEF("dwAlignStrideAlign", dwAlignStrideAlign), - DDVALDEF("dwMinOverlayStretch", dwMinOverlayStretch), - DDVALDEF("dwMaxOverlayStretch", dwMaxOverlayStretch), - DDVALDEF("dwMinLiveVideoStretch", dwMinLiveVideoStretch), - DDVALDEF("dwMaxLiveVideoStretch", dwMaxLiveVideoStretch), - DDVALDEF("dwMinHwCodecStretch", dwMinHwCodecStretch), - DDVALDEF("dwMaxHwCodecStretch", dwMaxHwCodecStretch), + DDVALDEF(L"dwVidMemTotal", dwVidMemTotal), + DDVALDEF(L"dwVidMemFree", dwVidMemFree), + DDHEXDEF(L"dwAlphaBltConstBitDepths", dwAlphaBltConstBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaBltConstBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaBltConstBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaBltConstBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaBltConstBitDepths, DDBD_32), + DDHEXDEF(L"dwAlphaBltPixelBitDepths", dwAlphaBltPixelBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaBltPixelBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaBltPixelBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaBltPixelBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaBltPixelBitDepths, DDBD_32), + DDHEXDEF(L"dwAlphaBltSurfaceBitDepths", dwAlphaBltSurfaceBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaBltSurfaceBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaBltSurfaceBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaBltSurfaceBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaBltSurfaceBitDepths, DDBD_32), + DDHEXDEF(L"dwAlphaOverlayConstBitDepths", dwAlphaOverlayConstBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaOverlayConstBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaOverlayConstBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaOverlayConstBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaOverlayConstBitDepths, DDBD_32), + DDHEXDEF(L"dwAlphaOverlayPixelBitDepths", dwAlphaOverlayPixelBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaOverlayPixelBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaOverlayPixelBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaOverlayPixelBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaOverlayPixelBitDepths, DDBD_32), + DDHEXDEF(L"dwAlphaOverlaySurfaceBitDepths", dwAlphaOverlaySurfaceBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaOverlaySurfaceBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaOverlaySurfaceBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaOverlaySurfaceBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaOverlaySurfaceBitDepths, DDBD_32), + DDHEXDEF(L"dwZBufferBitDepths", dwZBufferBitDepths), + DDCAPDEF(L" DDBD_8", dwZBufferBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwZBufferBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwZBufferBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwZBufferBitDepths, DDBD_32), + DDVALDEF(L"dwMaxVisibleOverlays", dwMaxVisibleOverlays), + DDVALDEF(L"dwCurrVisibleOverlays", dwCurrVisibleOverlays), + DDVALDEF(L"dwNumFourCCCodes", dwNumFourCCCodes), + DDVALDEF(L"dwAlignBoundarySrc", dwAlignBoundarySrc), + DDVALDEF(L"dwAlignSizeSrc", dwAlignSizeSrc), + DDVALDEF(L"dwAlignBoundaryDest", dwAlignBoundaryDest), + DDVALDEF(L"dwAlignSizeDest", dwAlignSizeDest), + DDVALDEF(L"dwAlignStrideAlign", dwAlignStrideAlign), + DDVALDEF(L"dwMinOverlayStretch", dwMinOverlayStretch), + DDVALDEF(L"dwMaxOverlayStretch", dwMaxOverlayStretch), + DDVALDEF(L"dwMinLiveVideoStretch", dwMinLiveVideoStretch), + DDVALDEF(L"dwMaxLiveVideoStretch", dwMaxLiveVideoStretch), + DDVALDEF(L"dwMinHwCodecStretch", dwMinHwCodecStretch), + DDVALDEF(L"dwMaxHwCodecStretch", dwMaxHwCodecStretch), //DDHEXDEF("dwCaps", dwCaps), - DDVALDEF("dwMaxVideoPorts", dwMaxVideoPorts), - DDVALDEF("dwCurrVideoPorts", dwCurrVideoPorts), + DDVALDEF(L"dwMaxVideoPorts", dwMaxVideoPorts), + DDVALDEF(L"dwCurrVideoPorts", dwCurrVideoPorts), //DDVALDEF("dwSVBCaps2", dwSVBCaps2), - { "", 0, 0 } + { L"", 0, 0 } }; @@ -108,77 +108,77 @@ namespace #define GEN_BLTCAPS(dwCaps) \ - DDCAPDEF("DDCAPS_BLT", dwCaps, DDCAPS_BLT), \ - DDCAPDEF("DDCAPS_BLTCOLORFILL", dwCaps, DDCAPS_BLTCOLORFILL), \ - DDCAPDEF("DDCAPS_BLTDEPTHFILL", dwCaps, DDCAPS_BLTDEPTHFILL), \ - DDCAPDEF("DDCAPS_BLTFOURCC", dwCaps, DDCAPS_BLTFOURCC), \ - DDCAPDEF("DDCAPS_BLTSTRETCH", dwCaps, DDCAPS_BLTSTRETCH), \ - DDCAPDEF("DDCAPS_BLTQUEUE", dwCaps, DDCAPS_BLTQUEUE), \ - DDCAPDEF("DDCAPS_COLORKEY", dwCaps, DDCAPS_COLORKEY), \ - DDCAPDEF("DDCAPS_ALPHA", dwCaps, DDCAPS_ALPHA), \ - DDCAPDEF("DDCAPS_CKEYHWASSIST", dwCaps, DDCAPS_COLORKEYHWASSIST), \ - DDCAPDEF("DDCAPS_CANCLIP", dwCaps, DDCAPS_CANCLIP), \ - DDCAPDEF("DDCAPS_CANCLIPSTRETCHED", dwCaps, DDCAPS_CANCLIPSTRETCHED), \ - DDCAPDEF("DDCAPS_CANBLTSYSMEM", dwCaps, DDCAPS_CANBLTSYSMEM), \ - DDCAPDEF("DDCAPS_ZBLTS", dwCaps, DDCAPS_ZBLTS), + DDCAPDEF(L"DDCAPS_BLT", dwCaps, DDCAPS_BLT), \ + DDCAPDEF(L"DDCAPS_BLTCOLORFILL", dwCaps, DDCAPS_BLTCOLORFILL), \ + DDCAPDEF(L"DDCAPS_BLTDEPTHFILL", dwCaps, DDCAPS_BLTDEPTHFILL), \ + DDCAPDEF(L"DDCAPS_BLTFOURCC", dwCaps, DDCAPS_BLTFOURCC), \ + DDCAPDEF(L"DDCAPS_BLTSTRETCH", dwCaps, DDCAPS_BLTSTRETCH), \ + DDCAPDEF(L"DDCAPS_BLTQUEUE", dwCaps, DDCAPS_BLTQUEUE), \ + DDCAPDEF(L"DDCAPS_COLORKEY", dwCaps, DDCAPS_COLORKEY), \ + DDCAPDEF(L"DDCAPS_ALPHA", dwCaps, DDCAPS_ALPHA), \ + DDCAPDEF(L"DDCAPS_CKEYHWASSIST", dwCaps, DDCAPS_COLORKEYHWASSIST), \ + DDCAPDEF(L"DDCAPS_CANCLIP", dwCaps, DDCAPS_CANCLIP), \ + DDCAPDEF(L"DDCAPS_CANCLIPSTRETCHED", dwCaps, DDCAPS_CANCLIPSTRETCHED), \ + DDCAPDEF(L"DDCAPS_CANBLTSYSMEM", dwCaps, DDCAPS_CANBLTSYSMEM), \ + DDCAPDEF(L"DDCAPS_ZBLTS", dwCaps, DDCAPS_ZBLTS), #define GEN_BLTCAPS2(dwCaps2) \ - DDCAPDEF("DDCAPS2_CANDROPZ16BIT", dwCaps2,DDCAPS2_CANDROPZ16BIT), \ - DDCAPDEF("DDCAPS2_NOPAGELOCKREQUIRED", dwCaps2,DDCAPS2_NOPAGELOCKREQUIRED), \ - DDCAPDEF("DDCAPS2_CANFLIPODDEVEN", dwCaps2,DDCAPS2_CANFLIPODDEVEN), \ - DDCAPDEF("DDCAPS2_CANBOBHARDWARE", dwCaps2,DDCAPS2_CANBOBHARDWARE), \ - DDCAPDEF("DDCAPS2_WIDESURFACES", dwCaps2,DDCAPS2_WIDESURFACES), + DDCAPDEF(L"DDCAPS2_CANDROPZ16BIT", dwCaps2,DDCAPS2_CANDROPZ16BIT), \ + DDCAPDEF(L"DDCAPS2_NOPAGELOCKREQUIRED", dwCaps2,DDCAPS2_NOPAGELOCKREQUIRED), \ + DDCAPDEF(L"DDCAPS2_CANFLIPODDEVEN", dwCaps2,DDCAPS2_CANFLIPODDEVEN), \ + DDCAPDEF(L"DDCAPS2_CANBOBHARDWARE", dwCaps2,DDCAPS2_CANBOBHARDWARE), \ + DDCAPDEF(L"DDCAPS2_WIDESURFACES", dwCaps2,DDCAPS2_WIDESURFACES), //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF GenCaps[] = { // GEN_CAPS(dwCaps) - DDCAPDEF("DDCAPS_3D", dwCaps, DDCAPS_3D), - DDCAPDEF("DDCAPS_ALIGNBOUNDARYDEST", dwCaps, DDCAPS_ALIGNBOUNDARYDEST), - DDCAPDEF("DDCAPS_ALIGNSIZEDEST", dwCaps, DDCAPS_ALIGNSIZEDEST), - DDCAPDEF("DDCAPS_ALIGNBOUNDARYSRC", dwCaps, DDCAPS_ALIGNBOUNDARYSRC), - DDCAPDEF("DDCAPS_ALIGNSIZESRC", dwCaps, DDCAPS_ALIGNSIZESRC), - DDCAPDEF("DDCAPS_ALIGNSTRIDE", dwCaps, DDCAPS_ALIGNSTRIDE), - DDCAPDEF("DDCAPS_GDI", dwCaps, DDCAPS_GDI), - DDCAPDEF("DDCAPS_OVERLAY", dwCaps, DDCAPS_OVERLAY), - DDCAPDEF("DDCAPS_OVERLAYCANTCLIP", dwCaps, DDCAPS_OVERLAYCANTCLIP), - DDCAPDEF("DDCAPS_OVERLAYFOURCC", dwCaps, DDCAPS_OVERLAYFOURCC), - DDCAPDEF("DDCAPS_OVERLAYSTRETCH", dwCaps, DDCAPS_OVERLAYSTRETCH), - DDCAPDEF("DDCAPS_PALETTE", dwCaps, DDCAPS_PALETTE), - DDCAPDEF("DDCAPS_PALETTEVSYNC", dwCaps, DDCAPS_PALETTEVSYNC), - DDCAPDEF("DDCAPS_READSCANLINE", dwCaps, DDCAPS_READSCANLINE), - DDCAPDEF("DDCAPS_VBI", dwCaps, DDCAPS_VBI), - DDCAPDEF("DDCAPS_ZOVERLAYS", dwCaps, DDCAPS_ZOVERLAYS), - DDCAPDEF("DDCAPS_NOHARDWARE", dwCaps, DDCAPS_NOHARDWARE), - DDCAPDEF("DDCAPS_BANKSWITCHED", dwCaps, DDCAPS_BANKSWITCHED), + DDCAPDEF(L"DDCAPS_3D", dwCaps, DDCAPS_3D), + DDCAPDEF(L"DDCAPS_ALIGNBOUNDARYDEST", dwCaps, DDCAPS_ALIGNBOUNDARYDEST), + DDCAPDEF(L"DDCAPS_ALIGNSIZEDEST", dwCaps, DDCAPS_ALIGNSIZEDEST), + DDCAPDEF(L"DDCAPS_ALIGNBOUNDARYSRC", dwCaps, DDCAPS_ALIGNBOUNDARYSRC), + DDCAPDEF(L"DDCAPS_ALIGNSIZESRC", dwCaps, DDCAPS_ALIGNSIZESRC), + DDCAPDEF(L"DDCAPS_ALIGNSTRIDE", dwCaps, DDCAPS_ALIGNSTRIDE), + DDCAPDEF(L"DDCAPS_GDI", dwCaps, DDCAPS_GDI), + DDCAPDEF(L"DDCAPS_OVERLAY", dwCaps, DDCAPS_OVERLAY), + DDCAPDEF(L"DDCAPS_OVERLAYCANTCLIP", dwCaps, DDCAPS_OVERLAYCANTCLIP), + DDCAPDEF(L"DDCAPS_OVERLAYFOURCC", dwCaps, DDCAPS_OVERLAYFOURCC), + DDCAPDEF(L"DDCAPS_OVERLAYSTRETCH", dwCaps, DDCAPS_OVERLAYSTRETCH), + DDCAPDEF(L"DDCAPS_PALETTE", dwCaps, DDCAPS_PALETTE), + DDCAPDEF(L"DDCAPS_PALETTEVSYNC", dwCaps, DDCAPS_PALETTEVSYNC), + DDCAPDEF(L"DDCAPS_READSCANLINE", dwCaps, DDCAPS_READSCANLINE), + DDCAPDEF(L"DDCAPS_VBI", dwCaps, DDCAPS_VBI), + DDCAPDEF(L"DDCAPS_ZOVERLAYS", dwCaps, DDCAPS_ZOVERLAYS), + DDCAPDEF(L"DDCAPS_NOHARDWARE", dwCaps, DDCAPS_NOHARDWARE), + DDCAPDEF(L"DDCAPS_BANKSWITCHED", dwCaps, DDCAPS_BANKSWITCHED), // GEN_CAPS2(dwCaps2) - DDCAPDEF("DDCAPS2_CERTIFIED", dwCaps2,DDCAPS2_CERTIFIED), - DDCAPDEF("DDCAPS2_NO2DDURING3DSCENE", dwCaps2,DDCAPS2_NO2DDURING3DSCENE), - DDCAPDEF("DDCAPS2_VIDEOPORT", dwCaps2,DDCAPS2_VIDEOPORT), - DDCAPDEF("DDCAPS2_AUTOFLIPOVERLAY", dwCaps2,DDCAPS2_AUTOFLIPOVERLAY), - DDCAPDEF("DDCAPS2_CANBOBINTERLEAVED", dwCaps2,DDCAPS2_CANBOBINTERLEAVED), - DDCAPDEF("DDCAPS2_CANBOBNONINTERLEAVED", dwCaps2,DDCAPS2_CANBOBNONINTERLEAVED), - DDCAPDEF("DDCAPS2_COLORCONTROLOVERLAY", dwCaps2,DDCAPS2_COLORCONTROLOVERLAY), - DDCAPDEF("DDCAPS2_COLORCONTROLPRIMARY", dwCaps2,DDCAPS2_COLORCONTROLPRIMARY), - DDCAPDEF("DDCAPS2_NONLOCALVIDMEM", dwCaps2,DDCAPS2_NONLOCALVIDMEM), - DDCAPDEF("DDCAPS2_NONLOCALVIDMEMCAPS", dwCaps2,DDCAPS2_NONLOCALVIDMEMCAPS), - DDCAPDEF("DDCAPS2_WIDESURFACES", dwCaps2,DDCAPS2_WIDESURFACES), - DDCAPDEF("DDCAPS2_NOPAGELOCKREQUIRED", dwCaps2,DDCAPS2_NOPAGELOCKREQUIRED), - DDCAPDEF("DDCAPS2_CANRENDERWINDOWED", dwCaps2,DDCAPS2_CANRENDERWINDOWED), - DDCAPDEF("DDCAPS2_COPYFOURCC", dwCaps2,DDCAPS2_COPYFOURCC), - DDCAPDEF("DDCAPS2_PRIMARYGAMMA", dwCaps2,DDCAPS2_PRIMARYGAMMA), - DDCAPDEF("DDCAPS2_CANCALIBRATEGAMMA", dwCaps2,DDCAPS2_CANCALIBRATEGAMMA), - DDCAPDEF("DDCAPS2_FLIPINTERVAL", dwCaps2,DDCAPS2_FLIPINTERVAL), - DDCAPDEF("DDCAPS2_FLIPNOVSYNC", dwCaps2,DDCAPS2_FLIPNOVSYNC), - DDCAPDEF("DDCAPS2_CANMANAGETEXTURE", dwCaps2,DDCAPS2_CANMANAGETEXTURE), - DDCAPDEF("DDCAPS2_TEXMANINNONLOCALVIDMEM", dwCaps2,DDCAPS2_TEXMANINNONLOCALVIDMEM), - DDCAPDEF("DDCAPS2_STEREO", dwCaps2,DDCAPS2_STEREO), - DDCAPDEFex("DDCAPS2_CANSHARERESOURCE", dwCaps2,DDCAPS2_CANSHARERESOURCE), - - { "", 0, 0 } + DDCAPDEF(L"DDCAPS2_CERTIFIED", dwCaps2,DDCAPS2_CERTIFIED), + DDCAPDEF(L"DDCAPS2_NO2DDURING3DSCENE", dwCaps2,DDCAPS2_NO2DDURING3DSCENE), + DDCAPDEF(L"DDCAPS2_VIDEOPORT", dwCaps2,DDCAPS2_VIDEOPORT), + DDCAPDEF(L"DDCAPS2_AUTOFLIPOVERLAY", dwCaps2,DDCAPS2_AUTOFLIPOVERLAY), + DDCAPDEF(L"DDCAPS2_CANBOBINTERLEAVED", dwCaps2,DDCAPS2_CANBOBINTERLEAVED), + DDCAPDEF(L"DDCAPS2_CANBOBNONINTERLEAVED", dwCaps2,DDCAPS2_CANBOBNONINTERLEAVED), + DDCAPDEF(L"DDCAPS2_COLORCONTROLOVERLAY", dwCaps2,DDCAPS2_COLORCONTROLOVERLAY), + DDCAPDEF(L"DDCAPS2_COLORCONTROLPRIMARY", dwCaps2,DDCAPS2_COLORCONTROLPRIMARY), + DDCAPDEF(L"DDCAPS2_NONLOCALVIDMEM", dwCaps2,DDCAPS2_NONLOCALVIDMEM), + DDCAPDEF(L"DDCAPS2_NONLOCALVIDMEMCAPS", dwCaps2,DDCAPS2_NONLOCALVIDMEMCAPS), + DDCAPDEF(L"DDCAPS2_WIDESURFACES", dwCaps2,DDCAPS2_WIDESURFACES), + DDCAPDEF(L"DDCAPS2_NOPAGELOCKREQUIRED", dwCaps2,DDCAPS2_NOPAGELOCKREQUIRED), + DDCAPDEF(L"DDCAPS2_CANRENDERWINDOWED", dwCaps2,DDCAPS2_CANRENDERWINDOWED), + DDCAPDEF(L"DDCAPS2_COPYFOURCC", dwCaps2,DDCAPS2_COPYFOURCC), + DDCAPDEF(L"DDCAPS2_PRIMARYGAMMA", dwCaps2,DDCAPS2_PRIMARYGAMMA), + DDCAPDEF(L"DDCAPS2_CANCALIBRATEGAMMA", dwCaps2,DDCAPS2_CANCALIBRATEGAMMA), + DDCAPDEF(L"DDCAPS2_FLIPINTERVAL", dwCaps2,DDCAPS2_FLIPINTERVAL), + DDCAPDEF(L"DDCAPS2_FLIPNOVSYNC", dwCaps2,DDCAPS2_FLIPNOVSYNC), + DDCAPDEF(L"DDCAPS2_CANMANAGETEXTURE", dwCaps2,DDCAPS2_CANMANAGETEXTURE), + DDCAPDEF(L"DDCAPS2_TEXMANINNONLOCALVIDMEM", dwCaps2,DDCAPS2_TEXMANINNONLOCALVIDMEM), + DDCAPDEF(L"DDCAPS2_STEREO", dwCaps2,DDCAPS2_STEREO), + DDCAPDEFex(L"DDCAPS2_CANSHARERESOURCE", dwCaps2,DDCAPS2_CANSHARERESOURCE), + + { L"", 0, 0 } }; @@ -191,152 +191,152 @@ namespace { GEN_BLTCAPS(dwCaps) GEN_BLTCAPS2(dwCaps2) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SVBCapsDefs[] = { GEN_BLTCAPS(dwSVBCaps) GEN_BLTCAPS2(dwSVBCaps2) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF VSBCapsDefs[] = { GEN_BLTCAPS(dwVSBCaps) // GEN_BLTCAPS2(dwVSBCaps2) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SSBCapsDefs[] = { GEN_BLTCAPS(dwSSBCaps) // GEN_BLTCAPS2(dwSSBCaps2) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF NLVBCapsDefs[] = { GEN_BLTCAPS(dwNLVBCaps) GEN_BLTCAPS2(dwNLVBCaps2) - { "", 0, 0 } + { L"", 0, 0 } }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- #define GEN_CKCAPS(dwCKeyCaps) \ - DDCAPDEF("DDCKEYCAPS_DESTBLT", dwCKeyCaps, DDCKEYCAPS_DESTBLT), \ - DDCAPDEF("DDCKEYCAPS_DESTBLTCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTBLTCLRSPACE), \ - DDCAPDEF("DDCKEYCAPS_DESTBLTCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTBLTCLRSPACEYUV), \ - DDCAPDEF("DDCKEYCAPS_DESTBLTYUV", dwCKeyCaps, DDCKEYCAPS_DESTBLTYUV), \ - DDCAPDEF("DDCKEYCAPS_DESTOVERLAY", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAY), \ - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACE), \ - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV), \ - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYONEACTIVE), \ - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYYUV), \ - DDCAPDEF("DDCKEYCAPS_NOCOSTOVERLAY", dwCKeyCaps, DDCKEYCAPS_NOCOSTOVERLAY), \ - DDCAPDEF("DDCKEYCAPS_SRCBLT", dwCKeyCaps, DDCKEYCAPS_SRCBLT), \ - DDCAPDEF("DDCKEYCAPS_SRCBLTCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCBLTCLRSPACE), \ - DDCAPDEF("DDCKEYCAPS_SRCBLTCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCBLTCLRSPACEYUV), \ - DDCAPDEF("DDCKEYCAPS_SRCBLTYUV", dwCKeyCaps, DDCKEYCAPS_SRCBLTYUV), \ - DDCAPDEF("DDCKEYCAPS_SRCOVERLAY", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAY), \ - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACE), \ - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV), \ - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYONEACTIVE), \ - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYYUV), + DDCAPDEF(L"DDCKEYCAPS_DESTBLT", dwCKeyCaps, DDCKEYCAPS_DESTBLT), \ + DDCAPDEF(L"DDCKEYCAPS_DESTBLTCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTBLTCLRSPACE), \ + DDCAPDEF(L"DDCKEYCAPS_DESTBLTCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTBLTCLRSPACEYUV), \ + DDCAPDEF(L"DDCKEYCAPS_DESTBLTYUV", dwCKeyCaps, DDCKEYCAPS_DESTBLTYUV), \ + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAY", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAY), \ + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACE), \ + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV), \ + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYONEACTIVE), \ + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYYUV), \ + DDCAPDEF(L"DDCKEYCAPS_NOCOSTOVERLAY", dwCKeyCaps, DDCKEYCAPS_NOCOSTOVERLAY), \ + DDCAPDEF(L"DDCKEYCAPS_SRCBLT", dwCKeyCaps, DDCKEYCAPS_SRCBLT), \ + DDCAPDEF(L"DDCKEYCAPS_SRCBLTCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCBLTCLRSPACE), \ + DDCAPDEF(L"DDCKEYCAPS_SRCBLTCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCBLTCLRSPACEYUV), \ + DDCAPDEF(L"DDCKEYCAPS_SRCBLTYUV", dwCKeyCaps, DDCKEYCAPS_SRCBLTYUV), \ + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAY", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAY), \ + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACE), \ + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV), \ + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYONEACTIVE), \ + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYYUV), CAPDEF CKeyCapsDefs[] = { GEN_CKCAPS(dwCKeyCaps) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SVBCKeyCapsDefs[] = { GEN_CKCAPS(dwSVBCKeyCaps) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SSBCKeyCapsDefs[] = { GEN_CKCAPS(dwSSBCKeyCaps) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF NLVBCKeyCapsDefs[] = { GEN_CKCAPS(dwNLVBCKeyCaps) - { "", 0, 0 } + { L"", 0, 0 } }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- #define GEN_FXCAPS(dwFXCaps) \ - DDCAPDEF("DDFXCAPS_BLTALPHA", dwFXCaps, DDFXCAPS_BLTALPHA), \ - DDCAPDEF("DDFXCAPS_BLTARITHSTRETCHY", dwFXCaps, DDFXCAPS_BLTARITHSTRETCHY), \ - DDCAPDEF("DDFXCAPS_BLTARITHSTRETCHYN", dwFXCaps, DDFXCAPS_BLTARITHSTRETCHYN), \ - DDCAPDEF("DDFXCAPS_BLTFILTER", dwFXCaps, DDFXCAPS_BLTFILTER), \ - DDCAPDEF("DDFXCAPS_BLTMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_BLTMIRRORLEFTRIGHT), \ - DDCAPDEF("DDFXCAPS_BLTMIRRORUPDOWN", dwFXCaps, DDFXCAPS_BLTMIRRORUPDOWN), \ - DDCAPDEF("DDFXCAPS_BLTROTATION", dwFXCaps, DDFXCAPS_BLTROTATION), \ - DDCAPDEF("DDFXCAPS_BLTROTATION90", dwFXCaps, DDFXCAPS_BLTROTATION90), \ - DDCAPDEF("DDFXCAPS_BLTSHRINKX", dwFXCaps, DDFXCAPS_BLTSHRINKX), \ - DDCAPDEF("DDFXCAPS_BLTSHRINKXN", dwFXCaps, DDFXCAPS_BLTSHRINKXN), \ - DDCAPDEF("DDFXCAPS_BLTSHRINKY", dwFXCaps, DDFXCAPS_BLTSHRINKY), \ - DDCAPDEF("DDFXCAPS_BLTSHRINKYN", dwFXCaps, DDFXCAPS_BLTSHRINKYN), \ - DDCAPDEF("DDFXCAPS_BLTSTRETCHX", dwFXCaps, DDFXCAPS_BLTSTRETCHX), \ - DDCAPDEF("DDFXCAPS_BLTSTRETCHXN", dwFXCaps, DDFXCAPS_BLTSTRETCHXN), \ - DDCAPDEF("DDFXCAPS_BLTSTRETCHY", dwFXCaps, DDFXCAPS_BLTSTRETCHY), \ - DDCAPDEF("DDFXCAPS_BLTSTRETCHYN", dwFXCaps, DDFXCAPS_BLTSTRETCHYN), \ - DDCAPDEF("DDFXCAPS_OVERLAYALPHA", dwFXCaps, DDFXCAPS_OVERLAYALPHA), \ - DDCAPDEF("DDFXCAPS_OVERLAYARITHSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHY), \ - DDCAPDEF("DDFXCAPS_OVERLAYARITHSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHYN), \ - DDCAPDEF("DDFXCAPS_OVERLAYFILTER", dwFXCaps, DDFXCAPS_OVERLAYFILTER), \ - DDCAPDEF("DDFXCAPS_OVERLAYMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_OVERLAYMIRRORLEFTRIGHT), \ - DDCAPDEF("DDFXCAPS_OVERLAYMIRRORUPDOWN", dwFXCaps, DDFXCAPS_OVERLAYMIRRORUPDOWN), \ - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKX", dwFXCaps, DDFXCAPS_OVERLAYSHRINKX), \ - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKXN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKXN), \ - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKY", dwFXCaps, DDFXCAPS_OVERLAYSHRINKY), \ - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKYN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKYN), \ - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHX", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHX), \ - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHXN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHXN), \ - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHY), \ - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHYN), + DDCAPDEF(L"DDFXCAPS_BLTALPHA", dwFXCaps, DDFXCAPS_BLTALPHA), \ + DDCAPDEF(L"DDFXCAPS_BLTARITHSTRETCHY", dwFXCaps, DDFXCAPS_BLTARITHSTRETCHY), \ + DDCAPDEF(L"DDFXCAPS_BLTARITHSTRETCHYN", dwFXCaps, DDFXCAPS_BLTARITHSTRETCHYN), \ + DDCAPDEF(L"DDFXCAPS_BLTFILTER", dwFXCaps, DDFXCAPS_BLTFILTER), \ + DDCAPDEF(L"DDFXCAPS_BLTMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_BLTMIRRORLEFTRIGHT), \ + DDCAPDEF(L"DDFXCAPS_BLTMIRRORUPDOWN", dwFXCaps, DDFXCAPS_BLTMIRRORUPDOWN), \ + DDCAPDEF(L"DDFXCAPS_BLTROTATION", dwFXCaps, DDFXCAPS_BLTROTATION), \ + DDCAPDEF(L"DDFXCAPS_BLTROTATION90", dwFXCaps, DDFXCAPS_BLTROTATION90), \ + DDCAPDEF(L"DDFXCAPS_BLTSHRINKX", dwFXCaps, DDFXCAPS_BLTSHRINKX), \ + DDCAPDEF(L"DDFXCAPS_BLTSHRINKXN", dwFXCaps, DDFXCAPS_BLTSHRINKXN), \ + DDCAPDEF(L"DDFXCAPS_BLTSHRINKY", dwFXCaps, DDFXCAPS_BLTSHRINKY), \ + DDCAPDEF(L"DDFXCAPS_BLTSHRINKYN", dwFXCaps, DDFXCAPS_BLTSHRINKYN), \ + DDCAPDEF(L"DDFXCAPS_BLTSTRETCHX", dwFXCaps, DDFXCAPS_BLTSTRETCHX), \ + DDCAPDEF(L"DDFXCAPS_BLTSTRETCHXN", dwFXCaps, DDFXCAPS_BLTSTRETCHXN), \ + DDCAPDEF(L"DDFXCAPS_BLTSTRETCHY", dwFXCaps, DDFXCAPS_BLTSTRETCHY), \ + DDCAPDEF(L"DDFXCAPS_BLTSTRETCHYN", dwFXCaps, DDFXCAPS_BLTSTRETCHYN), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYALPHA", dwFXCaps, DDFXCAPS_OVERLAYALPHA), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYARITHSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHY), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYARITHSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHYN), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYFILTER", dwFXCaps, DDFXCAPS_OVERLAYFILTER), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_OVERLAYMIRRORLEFTRIGHT), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYMIRRORUPDOWN", dwFXCaps, DDFXCAPS_OVERLAYMIRRORUPDOWN), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKX", dwFXCaps, DDFXCAPS_OVERLAYSHRINKX), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKXN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKXN), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKY", dwFXCaps, DDFXCAPS_OVERLAYSHRINKY), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKYN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKYN), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHX", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHX), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHXN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHXN), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHY), \ + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHYN), CAPDEF FXCapsDefs[] = { GEN_FXCAPS(dwFXCaps) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SVBFXCapsDefs[] = { GEN_FXCAPS(dwSVBFXCaps) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SSBFXCapsDefs[] = { GEN_FXCAPS(dwSSBFXCaps) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF NLVBFXCapsDefs[] = { GEN_FXCAPS(dwNLVBFXCaps) - { "", 0, 0 } + { L"", 0, 0 } }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- #define GEN_FXALPHACAPS(dwFXAlphaCaps) \ - DDCAPDEF("DDFXALPHACAPS_BLTALPHAEDGEBLEND", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHAEDGEBLEND), \ - DDCAPDEF("DDFXALPHACAPS_BLTALPHAPIXELS", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHAPIXELS), \ - DDCAPDEF("DDFXALPHACAPS_BLTALPHAPIXELSNEG", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHAPIXELSNEG), \ - DDCAPDEF("DDFXALPHACAPS_BLTALPHASURFACES", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHASURFACES), \ - DDCAPDEF("DDFXALPHACAPS_BLTALPHASURFACESNEG", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHASURFACESNEG), \ - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND),\ - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHAPIXELS", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELS), \ - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG),\ - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHASURFACES", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACES), \ - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHASURFACESNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACESNEG), + DDCAPDEF(L"DDFXALPHACAPS_BLTALPHAEDGEBLEND", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHAEDGEBLEND), \ + DDCAPDEF(L"DDFXALPHACAPS_BLTALPHAPIXELS", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHAPIXELS), \ + DDCAPDEF(L"DDFXALPHACAPS_BLTALPHAPIXELSNEG", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHAPIXELSNEG), \ + DDCAPDEF(L"DDFXALPHACAPS_BLTALPHASURFACES", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHASURFACES), \ + DDCAPDEF(L"DDFXALPHACAPS_BLTALPHASURFACESNEG", dwFXAlphaCaps, DDFXALPHACAPS_BLTALPHASURFACESNEG), \ + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND),\ + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHAPIXELS", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELS), \ + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG),\ + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHASURFACES", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACES), \ + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHASURFACESNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACESNEG), CAPDEF FXAlphaCapsDefs[] = { GEN_FXALPHACAPS(dwFXAlphaCaps) - { "", 0, 0 } + { L"", 0, 0 } }; @@ -344,17 +344,17 @@ namespace //----------------------------------------------------------------------------- CAPDEF PalCapsDefs[] = { - DDCAPDEF("DDPCAPS_1BIT", dwPalCaps, DDPCAPS_1BIT), - DDCAPDEF("DDPCAPS_2BIT", dwPalCaps, DDPCAPS_2BIT), - DDCAPDEF("DDPCAPS_4BIT", dwPalCaps, DDPCAPS_4BIT), - DDCAPDEF("DDPCAPS_8BITENTRIES", dwPalCaps, DDPCAPS_8BITENTRIES), - DDCAPDEF("DDPCAPS_8BIT", dwPalCaps, DDPCAPS_8BIT), - DDCAPDEF("DDPCAPS_ALLOW256", dwPalCaps, DDPCAPS_ALLOW256), - DDCAPDEF("DDPCAPS_ALPHA", dwPalCaps, DDPCAPS_ALPHA), - DDCAPDEF("DDPCAPS_PRIMARYSURFACE", dwPalCaps, DDPCAPS_PRIMARYSURFACE), - DDCAPDEF("DDPCAPS_PRIMARYSURFACELEFT",dwPalCaps, DDPCAPS_PRIMARYSURFACELEFT), - DDCAPDEF("DDPCAPS_VSYNC", dwPalCaps, DDPCAPS_VSYNC), - { "", 0, 0} + DDCAPDEF(L"DDPCAPS_1BIT", dwPalCaps, DDPCAPS_1BIT), + DDCAPDEF(L"DDPCAPS_2BIT", dwPalCaps, DDPCAPS_2BIT), + DDCAPDEF(L"DDPCAPS_4BIT", dwPalCaps, DDPCAPS_4BIT), + DDCAPDEF(L"DDPCAPS_8BITENTRIES", dwPalCaps, DDPCAPS_8BITENTRIES), + DDCAPDEF(L"DDPCAPS_8BIT", dwPalCaps, DDPCAPS_8BIT), + DDCAPDEF(L"DDPCAPS_ALLOW256", dwPalCaps, DDPCAPS_ALLOW256), + DDCAPDEF(L"DDPCAPS_ALPHA", dwPalCaps, DDPCAPS_ALPHA), + DDCAPDEF(L"DDPCAPS_PRIMARYSURFACE", dwPalCaps, DDPCAPS_PRIMARYSURFACE), + DDCAPDEF(L"DDPCAPS_PRIMARYSURFACELEFT",dwPalCaps, DDPCAPS_PRIMARYSURFACELEFT), + DDCAPDEF(L"DDPCAPS_VSYNC", dwPalCaps, DDPCAPS_VSYNC), + { L"", 0, 0} }; @@ -362,45 +362,45 @@ namespace //----------------------------------------------------------------------------- CAPDEF SurfCapsDefs[] = { - DDCAPDEF("DDSCAPS_3DDEVICE", ddsCaps.dwCaps, DDSCAPS_3DDEVICE), - DDCAPDEF("DDSCAPS_ALPHA", ddsCaps.dwCaps, DDSCAPS_ALPHA), - DDCAPDEF("DDSCAPS_BACKBUFFER", ddsCaps.dwCaps, DDSCAPS_BACKBUFFER), - DDCAPDEF("DDSCAPS_COMPLEX", ddsCaps.dwCaps, DDSCAPS_COMPLEX), - DDCAPDEF("DDSCAPS_FLIP", ddsCaps.dwCaps, DDSCAPS_FLIP), - DDCAPDEF("DDSCAPS_FRONTBUFFER", ddsCaps.dwCaps, DDSCAPS_FRONTBUFFER), - DDCAPDEF("DDSCAPS_HWCODEC", ddsCaps.dwCaps, DDSCAPS_HWCODEC), - DDCAPDEF("DDSCAPS_LIVEVIDEO", ddsCaps.dwCaps, DDSCAPS_LIVEVIDEO), - DDCAPDEF("DDSCAPS_MIPMAP", ddsCaps.dwCaps, DDSCAPS_MIPMAP), - DDCAPDEF("DDSCAPS_MODEX", ddsCaps.dwCaps, DDSCAPS_MODEX), - DDCAPDEF("DDSCAPS_OFFSCREENPLAIN", ddsCaps.dwCaps, DDSCAPS_OFFSCREENPLAIN), - DDCAPDEF("DDSCAPS_OVERLAY", ddsCaps.dwCaps, DDSCAPS_OVERLAY), - DDCAPDEF("DDSCAPS_OWNDC", ddsCaps.dwCaps, DDSCAPS_OWNDC), - DDCAPDEF("DDSCAPS_PALETTE", ddsCaps.dwCaps, DDSCAPS_PALETTE), - DDCAPDEF("DDSCAPS_PRIMARYSURFACE", ddsCaps.dwCaps, DDSCAPS_PRIMARYSURFACE), - DDCAPDEF("DDSCAPS_SYSTEMMEMORY", ddsCaps.dwCaps, DDSCAPS_SYSTEMMEMORY), - DDCAPDEF("DDSCAPS_TEXTURE", ddsCaps.dwCaps, DDSCAPS_TEXTURE), - DDCAPDEF("DDSCAPS_VIDEOMEMORY", ddsCaps.dwCaps, DDSCAPS_VIDEOMEMORY), - DDCAPDEF("DDSCAPS_VIDEOPORT", ddsCaps.dwCaps, DDSCAPS_VIDEOPORT), - DDCAPDEF("DDSCAPS_VISIBLE", ddsCaps.dwCaps, DDSCAPS_VISIBLE), - DDCAPDEF("DDSCAPS_WRITEONLY", ddsCaps.dwCaps, DDSCAPS_WRITEONLY), - DDCAPDEF("DDSCAPS_ZBUFFER", ddsCaps.dwCaps, DDSCAPS_ZBUFFER), - DDCAPDEF("DDSCAPS_ALLOCONLOAD", ddsCaps.dwCaps, DDSCAPS_ALLOCONLOAD), - DDCAPDEF("DDSCAPS_LOCALVIDMEM", ddsCaps.dwCaps, DDSCAPS_LOCALVIDMEM), - DDCAPDEF("DDSCAPS_NONLOCALVIDMEM", ddsCaps.dwCaps, DDSCAPS_NONLOCALVIDMEM), - DDCAPDEF("DDSCAPS_STANDARDVGAMODE", ddsCaps.dwCaps, DDSCAPS_STANDARDVGAMODE), - DDCAPDEF("DDSCAPS_OPTIMIZED", ddsCaps.dwCaps, DDSCAPS_OPTIMIZED), - DDCAPDEF("DDSCAPS2_HARDWAREDEINTERLACE", ddsCaps.dwCaps2, DDSCAPS2_HARDWAREDEINTERLACE), - DDCAPDEF("DDSCAPS2_HINTDYNAMIC", ddsCaps.dwCaps2, DDSCAPS2_HINTDYNAMIC), - DDCAPDEF("DDSCAPS2_HINTSTATIC", ddsCaps.dwCaps2, DDSCAPS2_HINTSTATIC), - DDCAPDEF("DDSCAPS2_TEXTUREMANAGE", ddsCaps.dwCaps2, DDSCAPS2_TEXTUREMANAGE), - DDCAPDEF("DDSCAPS2_OPAQUE", ddsCaps.dwCaps2, DDSCAPS2_OPAQUE), - DDCAPDEF("DDSCAPS2_HINTANTIALIASING", ddsCaps.dwCaps2, DDSCAPS2_HINTANTIALIASING), - DDCAPDEF("DDSCAPS2_CUBEMAP", ddsCaps.dwCaps2, DDSCAPS2_CUBEMAP), - DDCAPDEF("DDSCAPS2_MIPMAPSUBLEVEL", ddsCaps.dwCaps2, DDSCAPS2_MIPMAPSUBLEVEL), - DDCAPDEF("DDSCAPS2_D3DTEXTUREMANAGE", ddsCaps.dwCaps2, DDSCAPS2_D3DTEXTUREMANAGE), - DDCAPDEF("DDSCAPS2_DONOTPERSIST", ddsCaps.dwCaps2, DDSCAPS2_DONOTPERSIST), - DDCAPDEF("DDSCAPS2_STEREOSURFACELEFT", ddsCaps.dwCaps2, DDSCAPS2_STEREOSURFACELEFT), - { "", 0, 0} + DDCAPDEF(L"DDSCAPS_3DDEVICE", ddsCaps.dwCaps, DDSCAPS_3DDEVICE), + DDCAPDEF(L"DDSCAPS_ALPHA", ddsCaps.dwCaps, DDSCAPS_ALPHA), + DDCAPDEF(L"DDSCAPS_BACKBUFFER", ddsCaps.dwCaps, DDSCAPS_BACKBUFFER), + DDCAPDEF(L"DDSCAPS_COMPLEX", ddsCaps.dwCaps, DDSCAPS_COMPLEX), + DDCAPDEF(L"DDSCAPS_FLIP", ddsCaps.dwCaps, DDSCAPS_FLIP), + DDCAPDEF(L"DDSCAPS_FRONTBUFFER", ddsCaps.dwCaps, DDSCAPS_FRONTBUFFER), + DDCAPDEF(L"DDSCAPS_HWCODEC", ddsCaps.dwCaps, DDSCAPS_HWCODEC), + DDCAPDEF(L"DDSCAPS_LIVEVIDEO", ddsCaps.dwCaps, DDSCAPS_LIVEVIDEO), + DDCAPDEF(L"DDSCAPS_MIPMAP", ddsCaps.dwCaps, DDSCAPS_MIPMAP), + DDCAPDEF(L"DDSCAPS_MODEX", ddsCaps.dwCaps, DDSCAPS_MODEX), + DDCAPDEF(L"DDSCAPS_OFFSCREENPLAIN", ddsCaps.dwCaps, DDSCAPS_OFFSCREENPLAIN), + DDCAPDEF(L"DDSCAPS_OVERLAY", ddsCaps.dwCaps, DDSCAPS_OVERLAY), + DDCAPDEF(L"DDSCAPS_OWNDC", ddsCaps.dwCaps, DDSCAPS_OWNDC), + DDCAPDEF(L"DDSCAPS_PALETTE", ddsCaps.dwCaps, DDSCAPS_PALETTE), + DDCAPDEF(L"DDSCAPS_PRIMARYSURFACE", ddsCaps.dwCaps, DDSCAPS_PRIMARYSURFACE), + DDCAPDEF(L"DDSCAPS_SYSTEMMEMORY", ddsCaps.dwCaps, DDSCAPS_SYSTEMMEMORY), + DDCAPDEF(L"DDSCAPS_TEXTURE", ddsCaps.dwCaps, DDSCAPS_TEXTURE), + DDCAPDEF(L"DDSCAPS_VIDEOMEMORY", ddsCaps.dwCaps, DDSCAPS_VIDEOMEMORY), + DDCAPDEF(L"DDSCAPS_VIDEOPORT", ddsCaps.dwCaps, DDSCAPS_VIDEOPORT), + DDCAPDEF(L"DDSCAPS_VISIBLE", ddsCaps.dwCaps, DDSCAPS_VISIBLE), + DDCAPDEF(L"DDSCAPS_WRITEONLY", ddsCaps.dwCaps, DDSCAPS_WRITEONLY), + DDCAPDEF(L"DDSCAPS_ZBUFFER", ddsCaps.dwCaps, DDSCAPS_ZBUFFER), + DDCAPDEF(L"DDSCAPS_ALLOCONLOAD", ddsCaps.dwCaps, DDSCAPS_ALLOCONLOAD), + DDCAPDEF(L"DDSCAPS_LOCALVIDMEM", ddsCaps.dwCaps, DDSCAPS_LOCALVIDMEM), + DDCAPDEF(L"DDSCAPS_NONLOCALVIDMEM", ddsCaps.dwCaps, DDSCAPS_NONLOCALVIDMEM), + DDCAPDEF(L"DDSCAPS_STANDARDVGAMODE", ddsCaps.dwCaps, DDSCAPS_STANDARDVGAMODE), + DDCAPDEF(L"DDSCAPS_OPTIMIZED", ddsCaps.dwCaps, DDSCAPS_OPTIMIZED), + DDCAPDEF(L"DDSCAPS2_HARDWAREDEINTERLACE", ddsCaps.dwCaps2, DDSCAPS2_HARDWAREDEINTERLACE), + DDCAPDEF(L"DDSCAPS2_HINTDYNAMIC", ddsCaps.dwCaps2, DDSCAPS2_HINTDYNAMIC), + DDCAPDEF(L"DDSCAPS2_HINTSTATIC", ddsCaps.dwCaps2, DDSCAPS2_HINTSTATIC), + DDCAPDEF(L"DDSCAPS2_TEXTUREMANAGE", ddsCaps.dwCaps2, DDSCAPS2_TEXTUREMANAGE), + DDCAPDEF(L"DDSCAPS2_OPAQUE", ddsCaps.dwCaps2, DDSCAPS2_OPAQUE), + DDCAPDEF(L"DDSCAPS2_HINTANTIALIASING", ddsCaps.dwCaps2, DDSCAPS2_HINTANTIALIASING), + DDCAPDEF(L"DDSCAPS2_CUBEMAP", ddsCaps.dwCaps2, DDSCAPS2_CUBEMAP), + DDCAPDEF(L"DDSCAPS2_MIPMAPSUBLEVEL", ddsCaps.dwCaps2, DDSCAPS2_MIPMAPSUBLEVEL), + DDCAPDEF(L"DDSCAPS2_D3DTEXTUREMANAGE", ddsCaps.dwCaps2, DDSCAPS2_D3DTEXTUREMANAGE), + DDCAPDEF(L"DDSCAPS2_DONOTPERSIST", ddsCaps.dwCaps2, DDSCAPS2_DONOTPERSIST), + DDCAPDEF(L"DDSCAPS2_STEREOSURFACELEFT", ddsCaps.dwCaps2, DDSCAPS2_STEREOSURFACELEFT), + { L"", 0, 0} }; @@ -408,54 +408,54 @@ namespace //----------------------------------------------------------------------------- CAPDEF SVisionCapsDefs[] = { - DDCAPDEF("DDSVCAPS_STEREOSEQUENTIAL", dwSVCaps, DDSVCAPS_STEREOSEQUENTIAL), - { "", 0, 0} + DDCAPDEF(L"DDSVCAPS_STEREOSEQUENTIAL", dwSVCaps, DDSVCAPS_STEREOSEQUENTIAL), + { L"", 0, 0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- #define GEN_ROPS(dwRops) \ - ROPDEF("SRCCOPY", dwRops, SRCCOPY), \ - ROPDEF("SRCPAINT", dwRops, SRCPAINT), \ - ROPDEF("SRCAND", dwRops, SRCAND), \ - ROPDEF("SRCINVERT", dwRops, SRCINVERT), \ - ROPDEF("SRCERASE", dwRops, SRCERASE), \ - ROPDEF("NOTSRCCOPY", dwRops, NOTSRCCOPY), \ - ROPDEF("NOTSRCERASE",dwRops, NOTSRCERASE), \ - ROPDEF("MERGECOPY", dwRops, MERGECOPY), \ - ROPDEF("MERGEPAINT", dwRops, MERGEPAINT), \ - ROPDEF("PATCOPY", dwRops, PATCOPY), \ - ROPDEF("PATPAINT", dwRops, PATPAINT), \ - ROPDEF("PATINVERT", dwRops, PATINVERT), \ - ROPDEF("DSTINVERT", dwRops, DSTINVERT), \ - ROPDEF("BLACKNESS", dwRops, BLACKNESS), \ - ROPDEF("WHITENESS", dwRops, WHITENESS), + ROPDEF(L"SRCCOPY", dwRops, SRCCOPY), \ + ROPDEF(L"SRCPAINT", dwRops, SRCPAINT), \ + ROPDEF(L"SRCAND", dwRops, SRCAND), \ + ROPDEF(L"SRCINVERT", dwRops, SRCINVERT), \ + ROPDEF(L"SRCERASE", dwRops, SRCERASE), \ + ROPDEF(L"NOTSRCCOPY", dwRops, NOTSRCCOPY), \ + ROPDEF(L"NOTSRCERASE",dwRops, NOTSRCERASE), \ + ROPDEF(L"MERGECOPY", dwRops, MERGECOPY), \ + ROPDEF(L"MERGEPAINT", dwRops, MERGEPAINT), \ + ROPDEF(L"PATCOPY", dwRops, PATCOPY), \ + ROPDEF(L"PATPAINT", dwRops, PATPAINT), \ + ROPDEF(L"PATINVERT", dwRops, PATINVERT), \ + ROPDEF(L"DSTINVERT", dwRops, DSTINVERT), \ + ROPDEF(L"BLACKNESS", dwRops, BLACKNESS), \ + ROPDEF(L"WHITENESS", dwRops, WHITENESS), CAPDEF ROPCapsDefs[] = { GEN_ROPS(dwRops) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF VSBROPCapsDefs[] = { GEN_ROPS(dwVSBRops) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SVBROPCapsDefs[] = { GEN_ROPS(dwSVBRops) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF SSBROPCapsDefs[] = { GEN_ROPS(dwSSBRops) - { "", 0, 0 } + { L"", 0, 0 } }; CAPDEF NLVBROPCapsDefs[] = { GEN_ROPS(dwNLVBRops) - { "", 0, 0 } + { L"", 0, 0 } }; @@ -463,76 +463,76 @@ namespace //----------------------------------------------------------------------------- CAPDEF OverlayCapsDefs[] = { - DDCAPDEF("DDCAPS_OVERLAY", dwCaps, DDCAPS_OVERLAY), - - DDCAPDEF("DDCAPS_ALIGNBOUNDARYDEST", dwCaps, DDCAPS_ALIGNBOUNDARYDEST), - DDVALDEF(" dwAlignBoundaryDest", dwAlignBoundaryDest), - DDCAPDEF("DDCAPS_ALIGNSIZEDEST", dwCaps, DDCAPS_ALIGNSIZEDEST), - DDVALDEF(" dwAlignSizeDest", dwAlignSizeDest), - DDCAPDEF("DDCAPS_ALIGNBOUNDARYSRC", dwCaps, DDCAPS_ALIGNBOUNDARYSRC), - DDVALDEF(" dwAlignBoundarySrc", dwAlignBoundarySrc), - DDCAPDEF("DDCAPS_ALIGNSIZESRC", dwCaps, DDCAPS_ALIGNSIZESRC), - DDVALDEF(" dwAlignSizeSrc", dwAlignSizeSrc), - DDCAPDEF("DDCAPS_ALIGNSTRIDE", dwCaps, DDCAPS_ALIGNSTRIDE), - DDVALDEF(" dwAlignStrideAlign", dwAlignStrideAlign), - - DDCAPDEF("DDCAPS_OVERLAYCANTCLIP", dwCaps, DDCAPS_OVERLAYCANTCLIP), - DDCAPDEF("DDCAPS_OVERLAYFOURCC", dwCaps, DDCAPS_OVERLAYFOURCC), - DDCAPDEF("DDCAPS_OVERLAYSTRETCH", dwCaps, DDCAPS_OVERLAYSTRETCH), - DDCAPDEF("DDCAPS_ZOVERLAYS", dwCaps, DDCAPS_ZOVERLAYS), - DDCAPDEF("DDCAPS2_AUTOFLIPOVERLAY", dwCaps2,DDCAPS2_AUTOFLIPOVERLAY), - DDCAPDEF("DDCAPS2_CANBOBINTERLEAVED", dwCaps2,DDCAPS2_CANBOBINTERLEAVED), - DDCAPDEF("DDCAPS2_CANBOBNONINTERLEAVED", dwCaps2,DDCAPS2_CANBOBNONINTERLEAVED), - DDCAPDEF("DDCAPS2_COLORCONTROLOVERLAY", dwCaps2,DDCAPS2_COLORCONTROLOVERLAY), - DDCAPDEF("DDCKEYCAPS_DESTOVERLAY", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAY), - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACE), - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV), - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYONEACTIVE), - DDCAPDEF("DDCKEYCAPS_DESTOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYYUV), - DDCAPDEF("DDCKEYCAPS_SRCOVERLAY", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAY), - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACE), - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV), - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYONEACTIVE), - DDCAPDEF("DDCKEYCAPS_SRCOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYYUV), - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND), - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHAPIXELS", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELS), - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG), - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHASURFACES", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACES), - DDCAPDEF("DDFXALPHACAPS_OVERLAYALPHASURFACESNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACESNEG), - DDCAPDEF("DDFXCAPS_OVERLAYALPHA", dwFXCaps, DDFXCAPS_OVERLAYALPHA), - DDCAPDEF("DDFXCAPS_OVERLAYARITHSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHY), - DDCAPDEF("DDFXCAPS_OVERLAYARITHSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHYN), - DDCAPDEF("DDFXCAPS_OVERLAYFILTER", dwFXCaps, DDFXCAPS_OVERLAYFILTER), - DDCAPDEF("DDFXCAPS_OVERLAYMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_OVERLAYMIRRORLEFTRIGHT), - DDCAPDEF("DDFXCAPS_OVERLAYMIRRORUPDOWN", dwFXCaps, DDFXCAPS_OVERLAYMIRRORUPDOWN), - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKX", dwFXCaps, DDFXCAPS_OVERLAYSHRINKX), - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKXN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKXN), - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKY", dwFXCaps, DDFXCAPS_OVERLAYSHRINKY), - DDCAPDEF("DDFXCAPS_OVERLAYSHRINKYN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKYN), - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHX", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHX), - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHXN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHXN), - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHY), - DDCAPDEF("DDFXCAPS_OVERLAYSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHYN), - DDHEXDEF("dwAlphaOverlayConstBitDepths", dwAlphaOverlayConstBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaOverlayConstBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaOverlayConstBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaOverlayConstBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaOverlayConstBitDepths, DDBD_32), - DDHEXDEF("dwAlphaOverlayPixelBitDepths", dwAlphaOverlayPixelBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaOverlayPixelBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaOverlayPixelBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaOverlayPixelBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaOverlayPixelBitDepths, DDBD_32), - DDHEXDEF("dwAlphaOverlaySurfaceBitDepths", dwAlphaOverlaySurfaceBitDepths), - DDCAPDEF(" DDBD_8", dwAlphaOverlaySurfaceBitDepths, DDBD_8), - DDCAPDEF(" DDBD_16", dwAlphaOverlaySurfaceBitDepths, DDBD_16), - DDCAPDEF(" DDBD_24", dwAlphaOverlaySurfaceBitDepths, DDBD_24), - DDCAPDEF(" DDBD_32", dwAlphaOverlaySurfaceBitDepths, DDBD_32), - DDVALDEF("dwMaxVisibleOverlays", dwMaxVisibleOverlays), - DDVALDEF("dwCurrVisibleOverlays", dwCurrVisibleOverlays), - DDVALDEF("dwMinOverlayStretch", dwMinOverlayStretch), - DDVALDEF("dwMaxOverlayStretch", dwMaxOverlayStretch), - { "", 0, 0} + DDCAPDEF(L"DDCAPS_OVERLAY", dwCaps, DDCAPS_OVERLAY), + + DDCAPDEF(L"DDCAPS_ALIGNBOUNDARYDEST", dwCaps, DDCAPS_ALIGNBOUNDARYDEST), + DDVALDEF(L" dwAlignBoundaryDest", dwAlignBoundaryDest), + DDCAPDEF(L"DDCAPS_ALIGNSIZEDEST", dwCaps, DDCAPS_ALIGNSIZEDEST), + DDVALDEF(L" dwAlignSizeDest", dwAlignSizeDest), + DDCAPDEF(L"DDCAPS_ALIGNBOUNDARYSRC", dwCaps, DDCAPS_ALIGNBOUNDARYSRC), + DDVALDEF(L" dwAlignBoundarySrc", dwAlignBoundarySrc), + DDCAPDEF(L"DDCAPS_ALIGNSIZESRC", dwCaps, DDCAPS_ALIGNSIZESRC), + DDVALDEF(L" dwAlignSizeSrc", dwAlignSizeSrc), + DDCAPDEF(L"DDCAPS_ALIGNSTRIDE", dwCaps, DDCAPS_ALIGNSTRIDE), + DDVALDEF(L" dwAlignStrideAlign", dwAlignStrideAlign), + + DDCAPDEF(L"DDCAPS_OVERLAYCANTCLIP", dwCaps, DDCAPS_OVERLAYCANTCLIP), + DDCAPDEF(L"DDCAPS_OVERLAYFOURCC", dwCaps, DDCAPS_OVERLAYFOURCC), + DDCAPDEF(L"DDCAPS_OVERLAYSTRETCH", dwCaps, DDCAPS_OVERLAYSTRETCH), + DDCAPDEF(L"DDCAPS_ZOVERLAYS", dwCaps, DDCAPS_ZOVERLAYS), + DDCAPDEF(L"DDCAPS2_AUTOFLIPOVERLAY", dwCaps2,DDCAPS2_AUTOFLIPOVERLAY), + DDCAPDEF(L"DDCAPS2_CANBOBINTERLEAVED", dwCaps2,DDCAPS2_CANBOBINTERLEAVED), + DDCAPDEF(L"DDCAPS2_CANBOBNONINTERLEAVED", dwCaps2,DDCAPS2_CANBOBNONINTERLEAVED), + DDCAPDEF(L"DDCAPS2_COLORCONTROLOVERLAY", dwCaps2,DDCAPS2_COLORCONTROLOVERLAY), + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAY", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAY), + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACE), + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV), + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYONEACTIVE), + DDCAPDEF(L"DDCKEYCAPS_DESTOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYYUV), + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAY", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAY), + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACE), + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV), + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYONEACTIVE), + DDCAPDEF(L"DDCKEYCAPS_SRCOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYYUV), + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND), + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHAPIXELS", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELS), + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG), + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHASURFACES", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACES), + DDCAPDEF(L"DDFXALPHACAPS_OVERLAYALPHASURFACESNEG", dwFXAlphaCaps, DDFXALPHACAPS_OVERLAYALPHASURFACESNEG), + DDCAPDEF(L"DDFXCAPS_OVERLAYALPHA", dwFXCaps, DDFXCAPS_OVERLAYALPHA), + DDCAPDEF(L"DDFXCAPS_OVERLAYARITHSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHY), + DDCAPDEF(L"DDFXCAPS_OVERLAYARITHSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHYN), + DDCAPDEF(L"DDFXCAPS_OVERLAYFILTER", dwFXCaps, DDFXCAPS_OVERLAYFILTER), + DDCAPDEF(L"DDFXCAPS_OVERLAYMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_OVERLAYMIRRORLEFTRIGHT), + DDCAPDEF(L"DDFXCAPS_OVERLAYMIRRORUPDOWN", dwFXCaps, DDFXCAPS_OVERLAYMIRRORUPDOWN), + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKX", dwFXCaps, DDFXCAPS_OVERLAYSHRINKX), + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKXN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKXN), + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKY", dwFXCaps, DDFXCAPS_OVERLAYSHRINKY), + DDCAPDEF(L"DDFXCAPS_OVERLAYSHRINKYN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKYN), + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHX", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHX), + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHXN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHXN), + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHY), + DDCAPDEF(L"DDFXCAPS_OVERLAYSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHYN), + DDHEXDEF(L"dwAlphaOverlayConstBitDepths", dwAlphaOverlayConstBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaOverlayConstBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaOverlayConstBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaOverlayConstBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaOverlayConstBitDepths, DDBD_32), + DDHEXDEF(L"dwAlphaOverlayPixelBitDepths", dwAlphaOverlayPixelBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaOverlayPixelBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaOverlayPixelBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaOverlayPixelBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaOverlayPixelBitDepths, DDBD_32), + DDHEXDEF(L"dwAlphaOverlaySurfaceBitDepths", dwAlphaOverlaySurfaceBitDepths), + DDCAPDEF(L" DDBD_8", dwAlphaOverlaySurfaceBitDepths, DDBD_8), + DDCAPDEF(L" DDBD_16", dwAlphaOverlaySurfaceBitDepths, DDBD_16), + DDCAPDEF(L" DDBD_24", dwAlphaOverlaySurfaceBitDepths, DDBD_24), + DDCAPDEF(L" DDBD_32", dwAlphaOverlaySurfaceBitDepths, DDBD_32), + DDVALDEF(L"dwMaxVisibleOverlays", dwMaxVisibleOverlays), + DDVALDEF(L"dwCurrVisibleOverlays", dwCurrVisibleOverlays), + DDVALDEF(L"dwMinOverlayStretch", dwMinOverlayStretch), + DDVALDEF(L"dwMaxOverlayStretch", dwMaxOverlayStretch), + { L"", 0, 0} }; @@ -540,16 +540,16 @@ namespace //----------------------------------------------------------------------------- CAPDEF VideoPortCapsDefs[] = { - DDCAPDEF("DDCAPS2_VIDEOPORT", dwCaps2,DDCAPS2_VIDEOPORT), - DDCAPDEF("DDSCAPS_VIDEOPORT", ddsCaps.dwCaps, DDSCAPS_VIDEOPORT), - DDCAPDEF("DDSCAPS_LIVEVIDEO", ddsCaps.dwCaps, DDSCAPS_LIVEVIDEO), - DDCAPDEF("DDSCAPS2_HARDWAREDEINTERLACE", dwCaps2,DDSCAPS2_HARDWAREDEINTERLACE), - DDCAPDEF("DDSCAPS2_AUTOFLIPOVERLAY", dwCaps2,DDCAPS2_AUTOFLIPOVERLAY), - DDVALDEF("dwMinLiveVideoStretch", dwMinLiveVideoStretch), - DDVALDEF("dwMaxLiveVideoStretch", dwMaxLiveVideoStretch), - DDVALDEF("dwMaxVideoPorts", dwMaxVideoPorts), - DDVALDEF("dwCurrVideoPorts", dwCurrVideoPorts), - { "", 0, 0} + DDCAPDEF(L"DDCAPS2_VIDEOPORT", dwCaps2,DDCAPS2_VIDEOPORT), + DDCAPDEF(L"DDSCAPS_VIDEOPORT", ddsCaps.dwCaps, DDSCAPS_VIDEOPORT), + DDCAPDEF(L"DDSCAPS_LIVEVIDEO", ddsCaps.dwCaps, DDSCAPS_LIVEVIDEO), + DDCAPDEF(L"DDSCAPS2_HARDWAREDEINTERLACE", dwCaps2,DDSCAPS2_HARDWAREDEINTERLACE), + DDCAPDEF(L"DDSCAPS2_AUTOFLIPOVERLAY", dwCaps2,DDCAPS2_AUTOFLIPOVERLAY), + DDVALDEF(L"dwMinLiveVideoStretch", dwMinLiveVideoStretch), + DDVALDEF(L"dwMaxLiveVideoStretch", dwMaxLiveVideoStretch), + DDVALDEF(L"dwMaxVideoPorts", dwMaxVideoPorts), + DDVALDEF(L"dwCurrVideoPorts", dwCurrVideoPorts), + { L"", 0, 0} }; @@ -557,61 +557,61 @@ namespace //----------------------------------------------------------------------------- CAPDEFS DDCapDefs[] = { - {"", nullptr, (LPARAM)0, }, - {"Memory", DDDisplayVidMem, (LPARAM)0, }, - - {"+Caps", nullptr, (LPARAM)0, }, - {"General", DDDisplayCaps, (LPARAM)GenCaps, }, - {"FX Alpha Caps", DDDisplayCaps, (LPARAM)FXAlphaCapsDefs, }, - {"Palette Caps", DDDisplayCaps, (LPARAM)PalCapsDefs, }, - {"Overlay Caps", DDDisplayCaps, (LPARAM)OverlayCapsDefs, }, - {"Surface Caps", DDDisplayCaps, (LPARAM)SurfCapsDefs, }, - {"Stereo Vision Caps", DDDisplayCaps, (LPARAM)SVisionCapsDefs, }, - {"Video Port Caps", DDDisplayCaps, (LPARAM)VideoPortCapsDefs, }, - - {"+BLT Caps", nullptr, (LPARAM)0, }, - - {"+Video - Video", nullptr, (LPARAM)0, }, - {"General", DDDisplayCaps, (LPARAM)CapsDefs, }, - {"Color Key", DDDisplayCaps, (LPARAM)CKeyCapsDefs, }, - {"FX", DDDisplayCaps, (LPARAM)FXCapsDefs, }, - {"ROPS", DDDisplayCaps, (LPARAM)ROPCapsDefs, }, - {"-", nullptr, (LPARAM)0, }, - - {"+System - Video", nullptr, (LPARAM)0, }, - {"General", DDDisplayCaps, (LPARAM)SVBCapsDefs, }, - {"Color Key", DDDisplayCaps, (LPARAM)SVBCKeyCapsDefs, }, - {"FX", DDDisplayCaps, (LPARAM)SVBFXCapsDefs, }, - {"ROPS", DDDisplayCaps, (LPARAM)SVBROPCapsDefs, }, - {"-", nullptr, (LPARAM)0, }, - - {"+Video - System", nullptr, (LPARAM)0, }, - {"General", DDDisplayCaps, (LPARAM)VSBCapsDefs, }, - {"Color Key", DDDisplayCaps, (LPARAM)SSBCKeyCapsDefs, }, - {"FX", DDDisplayCaps, (LPARAM)SSBFXCapsDefs, }, - {"ROPS", DDDisplayCaps, (LPARAM)VSBROPCapsDefs, }, - {"-", nullptr, (LPARAM)0, }, - - {"+System - System", nullptr, (LPARAM)0, }, - {"General", DDDisplayCaps, (LPARAM)SSBCapsDefs, }, - {"Color Key", DDDisplayCaps, (LPARAM)SSBCKeyCapsDefs, }, - {"FX", DDDisplayCaps, (LPARAM)SSBFXCapsDefs, }, - {"ROPS", DDDisplayCaps, (LPARAM)SSBROPCapsDefs, }, - {"-", nullptr, (LPARAM)0, }, - - {"+NonLocal - Video", nullptr, (LPARAM)0, }, - {"General", DDDisplayCaps, (LPARAM)NLVBCapsDefs, }, - {"Color Key", DDDisplayCaps, (LPARAM)NLVBCKeyCapsDefs, }, - {"FX", DDDisplayCaps, (LPARAM)NLVBFXCapsDefs, }, - {"ROPS", DDDisplayCaps, (LPARAM)NLVBROPCapsDefs, }, - {"-", nullptr, (LPARAM)0, }, - - {"-", nullptr, (LPARAM)0, }, - {"-", nullptr, (LPARAM)0, }, - - {"Video Modes", DDDisplayVideoModes,(LPARAM)0, }, - {"FourCC Formats", DDDisplayFourCCFormat,(LPARAM)0, }, - {"Other", DDDisplayCaps, (LPARAM)OtherInfoDefs, }, + {L"", nullptr, (LPARAM)0, }, + {L"Memory", DDDisplayVidMem, (LPARAM)0, }, + + {L"+Caps", nullptr, (LPARAM)0, }, + {L"General", DDDisplayCaps, (LPARAM)GenCaps, }, + {L"FX Alpha Caps", DDDisplayCaps, (LPARAM)FXAlphaCapsDefs, }, + {L"Palette Caps", DDDisplayCaps, (LPARAM)PalCapsDefs, }, + {L"Overlay Caps", DDDisplayCaps, (LPARAM)OverlayCapsDefs, }, + {L"Surface Caps", DDDisplayCaps, (LPARAM)SurfCapsDefs, }, + {L"Stereo Vision Caps", DDDisplayCaps, (LPARAM)SVisionCapsDefs, }, + {L"Video Port Caps", DDDisplayCaps, (LPARAM)VideoPortCapsDefs, }, + + {L"+BLT Caps", nullptr, (LPARAM)0, }, + + {L"+Video - Video", nullptr, (LPARAM)0, }, + {L"General", DDDisplayCaps, (LPARAM)CapsDefs, }, + {L"Color Key", DDDisplayCaps, (LPARAM)CKeyCapsDefs, }, + {L"FX", DDDisplayCaps, (LPARAM)FXCapsDefs, }, + {L"ROPS", DDDisplayCaps, (LPARAM)ROPCapsDefs, }, + {L"-", nullptr, (LPARAM)0, }, + + {L"+System - Video", nullptr, (LPARAM)0, }, + {L"General", DDDisplayCaps, (LPARAM)SVBCapsDefs, }, + {L"Color Key", DDDisplayCaps, (LPARAM)SVBCKeyCapsDefs, }, + {L"FX", DDDisplayCaps, (LPARAM)SVBFXCapsDefs, }, + {L"ROPS", DDDisplayCaps, (LPARAM)SVBROPCapsDefs, }, + {L"-", nullptr, (LPARAM)0, }, + + {L"+Video - System", nullptr, (LPARAM)0, }, + {L"General", DDDisplayCaps, (LPARAM)VSBCapsDefs, }, + {L"Color Key", DDDisplayCaps, (LPARAM)SSBCKeyCapsDefs, }, + {L"FX", DDDisplayCaps, (LPARAM)SSBFXCapsDefs, }, + {L"ROPS", DDDisplayCaps, (LPARAM)VSBROPCapsDefs, }, + {L"-", nullptr, (LPARAM)0, }, + + {L"+System - System", nullptr, (LPARAM)0, }, + {L"General", DDDisplayCaps, (LPARAM)SSBCapsDefs, }, + {L"Color Key", DDDisplayCaps, (LPARAM)SSBCKeyCapsDefs, }, + {L"FX", DDDisplayCaps, (LPARAM)SSBFXCapsDefs, }, + {L"ROPS", DDDisplayCaps, (LPARAM)SSBROPCapsDefs, }, + {L"-", nullptr, (LPARAM)0, }, + + {L"+NonLocal - Video", nullptr, (LPARAM)0, }, + {L"General", DDDisplayCaps, (LPARAM)NLVBCapsDefs, }, + {L"Color Key", DDDisplayCaps, (LPARAM)NLVBCKeyCapsDefs, }, + {L"FX", DDDisplayCaps, (LPARAM)NLVBFXCapsDefs, }, + {L"ROPS", DDDisplayCaps, (LPARAM)NLVBROPCapsDefs, }, + {L"-", nullptr, (LPARAM)0, }, + + {L"-", nullptr, (LPARAM)0, }, + {L"-", nullptr, (LPARAM)0, }, + + {L"Video Modes", DDDisplayVideoModes,(LPARAM)0, }, + {L"FourCC Formats", DDDisplayFourCCFormat,(LPARAM)0, }, + {L"Other", DDDisplayCaps, (LPARAM)OtherInfoDefs, }, { nullptr, 0, 0 } }; @@ -693,46 +693,46 @@ namespace if (pPrintInfo) { - PrintValueLine("dwTotalVidMem", dwTotalVidMem, pPrintInfo); - PrintValueLine("dwFreeVidMem", dwFreeVidMem, pPrintInfo); - PrintValueLine("dwTotalLocMem", dwTotalLocMem, pPrintInfo); - PrintValueLine("dwFreeLocMem", dwFreeLocMem, pPrintInfo); - PrintValueLine("dwTotalAGPMem", dwTotalAGPMem, pPrintInfo); - PrintValueLine("dwFreeAGPMem", dwFreeAGPMem, pPrintInfo); - PrintValueLine("dwTotalTexMem", dwTotalTexMem, pPrintInfo); - PrintValueLine("dwFreeTexMem", dwFreeTexMem, pPrintInfo); + PrintValueLine(L"dwTotalVidMem", dwTotalVidMem, pPrintInfo); + PrintValueLine(L"dwFreeVidMem", dwFreeVidMem, pPrintInfo); + PrintValueLine(L"dwTotalLocMem", dwTotalLocMem, pPrintInfo); + PrintValueLine(L"dwFreeLocMem", dwFreeLocMem, pPrintInfo); + PrintValueLine(L"dwTotalAGPMem", dwTotalAGPMem, pPrintInfo); + PrintValueLine(L"dwFreeAGPMem", dwFreeAGPMem, pPrintInfo); + PrintValueLine(L"dwTotalTexMem", dwTotalTexMem, pPrintInfo); + PrintValueLine(L"dwFreeTexMem", dwFreeTexMem, pPrintInfo); } else { - CHAR strBuff[64]; + WCHAR strBuff[64]; - LVAddColumn(g_hwndLV, 0, "Type", 24); - LVAddColumn(g_hwndLV, 1, "Total", 10); - LVAddColumn(g_hwndLV, 2, "Free", 10); + LVAddColumn(g_hwndLV, 0, L"Type", 24); + LVAddColumn(g_hwndLV, 1, L"Total", 10); + LVAddColumn(g_hwndLV, 2, L"Free", 10); - LVAddText(g_hwndLV, 0, "Video"); + LVAddText(g_hwndLV, 0, L"Video"); Int2Str(strBuff, 64, dwTotalVidMem); - LVAddText(g_hwndLV, 1, "%s", strBuff); + LVAddText(g_hwndLV, 1, L"%s", strBuff); Int2Str(strBuff, 64, dwFreeVidMem); - LVAddText(g_hwndLV, 2, "%s", strBuff); + LVAddText(g_hwndLV, 2, L"%s", strBuff); - LVAddText(g_hwndLV, 0, "Video (local)"); + LVAddText(g_hwndLV, 0, L"Video (local)"); Int2Str(strBuff, 64, dwTotalLocMem); - LVAddText(g_hwndLV, 1, "%s", strBuff); + LVAddText(g_hwndLV, 1, L"%s", strBuff); Int2Str(strBuff, 64, dwFreeLocMem); - LVAddText(g_hwndLV, 2, "%s", strBuff); + LVAddText(g_hwndLV, 2, L"%s", strBuff); - LVAddText(g_hwndLV, 0, "Video (non-local)"); + LVAddText(g_hwndLV, 0, L"Video (non-local)"); Int2Str(strBuff, 64, dwTotalAGPMem); - LVAddText(g_hwndLV, 1, "%s", strBuff); + LVAddText(g_hwndLV, 1, L"%s", strBuff); Int2Str(strBuff, 64, dwFreeAGPMem); - LVAddText(g_hwndLV, 2, "%s", strBuff); + LVAddText(g_hwndLV, 2, L"%s", strBuff); - LVAddText(g_hwndLV, 0, "Texture"); + LVAddText(g_hwndLV, 0, L"Texture"); Int2Str(strBuff, 64, dwTotalTexMem); - LVAddText(g_hwndLV, 1, "%s", strBuff); + LVAddText(g_hwndLV, 1, L"%s", strBuff); Int2Str(strBuff, 64, dwFreeTexMem); - LVAddText(g_hwndLV, 2, "%s", strBuff); + LVAddText(g_hwndLV, 2, L"%s", strBuff); } } @@ -794,8 +794,8 @@ namespace // Add columns if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Codes", 24); - LVAddColumn(g_hwndLV, 1, "", 24); + LVAddColumn(g_hwndLV, 0, L"Codes", 24); + LVAddColumn(g_hwndLV, 1, L"", 24); } // Assume all FourCC values are ascii strings @@ -803,10 +803,15 @@ namespace { CHAR strText[5] = {}; memcpy(strText, &FourCC[dwCount], 4); + WCHAR szText[5] = {}; + szText[0] = strText[0]; + szText[1] = strText[1]; + szText[2] = strText[2]; + szText[3] = strText[3]; if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "%s", strText); + LVAddText(g_hwndLV, 0, L"%s", szText); } else { @@ -814,7 +819,7 @@ namespace int yLine = (pPrintInfo->dwCurrLine * pPrintInfo->dwLineHeight); // Print Code - if (FAILED(PrintLine(xCode, yLine, strText, 4, pPrintInfo))) + if (FAILED(PrintLine(xCode, yLine, szText, 4, pPrintInfo))) return E_FAIL; if (FAILED(PrintNextLine(pPrintInfo))) @@ -833,19 +838,19 @@ namespace { if (pddsd->ddsCaps.dwCaps & DDSCAPS_STANDARDVGAMODE) { - LVAddText(g_hwndLV, 0, "%dx%dx%d (StandardVGA)", + LVAddText(g_hwndLV, 0, L"%dx%dx%d (StandardVGA)", pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); } else if (pddsd->ddsCaps.dwCaps & DDSCAPS_MODEX) { - LVAddText(g_hwndLV, 0, "%dx%dx%d (ModeX)", + LVAddText(g_hwndLV, 0, L"%dx%dx%d (ModeX)", pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); } else { - LVAddText(g_hwndLV, 0, "%dx%dx%d ", + LVAddText(g_hwndLV, 0, L"%dx%dx%d ", pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); } @@ -857,7 +862,7 @@ namespace //----------------------------------------------------------------------------- HRESULT CALLBACK EnumDisplayModesCallbackPrint(DDSURFACEDESC2* pddsd, VOID* Context) { - TCHAR szBuff[80]; + WCHAR szBuff[80]; DWORD cchLen; auto lpInfo = reinterpret_cast(Context); int xMode, yLine; @@ -870,18 +875,18 @@ namespace if (pddsd->ddsCaps.dwCaps & DDSCAPS_STANDARDVGAMODE) { - sprintf_s(szBuff, sizeof(szBuff), TEXT("%ux%ux%u (StandardVGA)"), pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); + swprintf_s(szBuff, 80, L"%ux%ux%u (StandardVGA)", pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); } else if (pddsd->ddsCaps.dwCaps & DDSCAPS_MODEX) { - sprintf_s(szBuff, sizeof(szBuff), TEXT("%ux%ux%u (ModeX)"), pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); + swprintf_s(szBuff, 80, L"%ux%ux%u (ModeX)", pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); } else { - sprintf_s(szBuff, sizeof(szBuff), TEXT("%ux%ux%u "), pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); + swprintf_s(szBuff, 80, L"%ux%ux%u ", pddsd->dwWidth, pddsd->dwHeight, pddsd->ddpfPixelFormat.dwRGBBitCount); } // Print Mode Info - cchLen = static_cast(_tcslen(szBuff)); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(xMode, yLine, szBuff, cchLen, lpInfo))) return DDENUMRET_CANCEL; // Advance to next line @@ -901,8 +906,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Mode", 24); - LVAddColumn(g_hwndLV, 1, "", 24); + LVAddColumn(g_hwndLV, 0, L"Mode", 24); + LVAddColumn(g_hwndLV, 1, L"", 24); } // lParam1 is the GUID for the driver we should open @@ -941,7 +946,7 @@ namespace _In_opt_ LPSTR lpDriverName, _In_opt_ VOID* lpContext, _In_opt_ HMONITOR) { HTREEITEM hParent = (HTREEITEM)lpContext; - TCHAR szText[256]; + char szText[256]; if (pid != (GUID*)-2) if (HIWORD(pid) != 0) @@ -954,12 +959,13 @@ namespace // Add subnode to treeview if (lpDriverName && *lpDriverName) - sprintf_s(szText, sizeof(szText), "%s (%s)", lpDriverDesc, lpDriverName); + sprintf_s(szText, 256, "%s (%s)", lpDriverDesc, lpDriverName); else - strcpy_s(szText, sizeof(szText), lpDriverDesc); - szText[255] = TEXT('\0'); + strcpy_s(szText, 256, lpDriverDesc); + szText[255] = '\0'; - DDCapDefs[0].strName = szText; + WideString strText(szText); + DDCapDefs[0].strName = strText.c_str(); AddCapsToTV(hParent, DDCapDefs, (LPARAM)pid); return(DDENUMRET_OK); @@ -971,7 +977,7 @@ namespace //----------------------------------------------------------------------------- VOID DD_Init() { - g_hInstDDraw = LoadLibraryEx("ddraw.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); + g_hInstDDraw = LoadLibraryEx(L"ddraw.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_hInstDDraw) { g_directDrawCreateEx = reinterpret_cast(GetProcAddress(g_hInstDDraw, "DirectDrawCreateEx")); @@ -991,7 +997,7 @@ VOID DD_FillTree(HWND hwndTV) HTREEITEM hTree; // Add DirectDraw devices - hTree = TVAddNode(TVI_ROOT, "DirectDraw Devices", TRUE, IDI_DIRECTX, + hTree = TVAddNode(TVI_ROOT, L"DirectDraw Devices", TRUE, IDI_DIRECTX, nullptr, 0, 0); // Add Display Driver node(s) and capability nodes to treeview diff --git a/dxg.cpp b/dxg.cpp index 5647573..bf2218d 100644 --- a/dxg.cpp +++ b/dxg.cpp @@ -178,56 +178,56 @@ namespace //----------------------------------------------------------------------------- CAPDEF DXGGenCaps[] = { - CAPSVALDEF("DeviceType", DeviceType), - CAPSVALDEF("AdapterOrdinal", AdapterOrdinal), + CAPSVALDEF(L"DeviceType", DeviceType), + CAPSVALDEF(L"AdapterOrdinal", AdapterOrdinal), - CAPSVALDEF("MaxTextureWidth", MaxTextureWidth), - CAPSVALDEF("MaxTextureHeight", MaxTextureHeight), - CAPSVALDEF("MaxVolumeExtent", MaxVolumeExtent), + CAPSVALDEF(L"MaxTextureWidth", MaxTextureWidth), + CAPSVALDEF(L"MaxTextureHeight", MaxTextureHeight), + CAPSVALDEF(L"MaxVolumeExtent", MaxVolumeExtent), - CAPSVALDEF("MaxTextureRepeat", MaxTextureRepeat), - CAPSVALDEF("MaxTextureAspectRatio", MaxTextureAspectRatio), - CAPSVALDEF("MaxAnisotropy", MaxAnisotropy), - CAPSFLOATDEF("MaxVertexW", MaxVertexW), + CAPSVALDEF(L"MaxTextureRepeat", MaxTextureRepeat), + CAPSVALDEF(L"MaxTextureAspectRatio", MaxTextureAspectRatio), + CAPSVALDEF(L"MaxAnisotropy", MaxAnisotropy), + CAPSFLOATDEF(L"MaxVertexW", MaxVertexW), - CAPSFLOATDEF("GuardBandLeft", GuardBandLeft), - CAPSFLOATDEF("GuardBandTop", GuardBandTop), - CAPSFLOATDEF("GuardBandRight", GuardBandRight), - CAPSFLOATDEF("GuardBandBottom", GuardBandBottom), + CAPSFLOATDEF(L"GuardBandLeft", GuardBandLeft), + CAPSFLOATDEF(L"GuardBandTop", GuardBandTop), + CAPSFLOATDEF(L"GuardBandRight", GuardBandRight), + CAPSFLOATDEF(L"GuardBandBottom", GuardBandBottom), - CAPSFLOATDEF("ExtentsAdjust", ExtentsAdjust), + CAPSFLOATDEF(L"ExtentsAdjust", ExtentsAdjust), - CAPSVALDEF("MaxTextureBlendStages", MaxTextureBlendStages), - CAPSVALDEF("MaxSimultaneousTextures", MaxSimultaneousTextures), + CAPSVALDEF(L"MaxTextureBlendStages", MaxTextureBlendStages), + CAPSVALDEF(L"MaxSimultaneousTextures", MaxSimultaneousTextures), - CAPSVALDEF("MaxActiveLights", MaxActiveLights), - CAPSVALDEF("MaxUserClipPlanes", MaxUserClipPlanes), - CAPSVALDEF("MaxVertexBlendMatrices", MaxVertexBlendMatrices), - CAPSVALDEF("MaxVertexBlendMatrixIndex", MaxVertexBlendMatrixIndex), + CAPSVALDEF(L"MaxActiveLights", MaxActiveLights), + CAPSVALDEF(L"MaxUserClipPlanes", MaxUserClipPlanes), + CAPSVALDEF(L"MaxVertexBlendMatrices", MaxVertexBlendMatrices), + CAPSVALDEF(L"MaxVertexBlendMatrixIndex", MaxVertexBlendMatrixIndex), - CAPSFLOATDEF("MaxPointSize", MaxPointSize), + CAPSFLOATDEF(L"MaxPointSize", MaxPointSize), - CAPSVALDEF("MaxPrimitiveCount", MaxPrimitiveCount), - CAPSVALDEF("MaxVertexIndex", MaxVertexIndex), - CAPSVALDEF("MaxStreams", MaxStreams), - CAPSVALDEF("MaxStreamStride", MaxStreamStride), + CAPSVALDEF(L"MaxPrimitiveCount", MaxPrimitiveCount), + CAPSVALDEF(L"MaxVertexIndex", MaxVertexIndex), + CAPSVALDEF(L"MaxStreams", MaxStreams), + CAPSVALDEF(L"MaxStreamStride", MaxStreamStride), - CAPSSHADERDEF("VertexShaderVersion", VertexShaderVersion), - CAPSVALDEF("MaxVertexShaderConst", MaxVertexShaderConst), + CAPSSHADERDEF(L"VertexShaderVersion", VertexShaderVersion), + CAPSVALDEF(L"MaxVertexShaderConst", MaxVertexShaderConst), - CAPSSHADERDEF("PixelShaderVersion", PixelShaderVersion), - CAPSFLOATDEF("PixelShader1xMaxValue", PixelShader1xMaxValue), + CAPSSHADERDEF(L"PixelShaderVersion", PixelShaderVersion), + CAPSFLOATDEF(L"PixelShader1xMaxValue", PixelShader1xMaxValue), - CAPSFLOATDEF("MaxNpatchTessellationLevel", MaxNpatchTessellationLevel), + CAPSFLOATDEF(L"MaxNpatchTessellationLevel", MaxNpatchTessellationLevel), - CAPSVALDEF("MasterAdapterOrdinal", MasterAdapterOrdinal), - CAPSVALDEF("AdapterOrdinalInGroup", AdapterOrdinalInGroup), - CAPSVALDEF("NumberOfAdaptersInGroup", NumberOfAdaptersInGroup), - CAPSVALDEF("NumSimultaneousRTs", NumSimultaneousRTs), - CAPSVALDEF("MaxVShaderInstructionsExecuted", MaxVShaderInstructionsExecuted), - CAPSVALDEF("MaxPShaderInstructionsExecuted", MaxPShaderInstructionsExecuted), - CAPSVALDEF("MaxVertexShader30InstructionSlots", MaxVertexShader30InstructionSlots), - CAPSVALDEF("MaxPixelShader30InstructionSlots", MaxPixelShader30InstructionSlots), + CAPSVALDEF(L"MasterAdapterOrdinal", MasterAdapterOrdinal), + CAPSVALDEF(L"AdapterOrdinalInGroup", AdapterOrdinalInGroup), + CAPSVALDEF(L"NumberOfAdaptersInGroup", NumberOfAdaptersInGroup), + CAPSVALDEF(L"NumSimultaneousRTs", NumSimultaneousRTs), + CAPSVALDEF(L"MaxVShaderInstructionsExecuted", MaxVShaderInstructionsExecuted), + CAPSVALDEF(L"MaxPShaderInstructionsExecuted", MaxPShaderInstructionsExecuted), + CAPSVALDEF(L"MaxVertexShader30InstructionSlots", MaxVertexShader30InstructionSlots), + CAPSVALDEF(L"MaxPixelShader30InstructionSlots", MaxPixelShader30InstructionSlots), { nullptr, 0, 0 } }; @@ -236,665 +236,665 @@ namespace //----------------------------------------------------------------------------- CAPDEF CapsCaps[] = { - CAPSFLAGDEF("D3DCAPS_READ_SCANLINE", Caps, D3DCAPS_READ_SCANLINE), - CAPSFLAGDEFex("D3DCAPS_OVERLAY", Caps, D3DCAPS_OVERLAY), - {"",0,0} + CAPSFLAGDEF(L"D3DCAPS_READ_SCANLINE", Caps, D3DCAPS_READ_SCANLINE), + CAPSFLAGDEFex(L"D3DCAPS_OVERLAY", Caps, D3DCAPS_OVERLAY), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsCaps2[] = { - CAPSFLAGDEF("D3DCAPS2_CANCALIBRATEGAMMA", Caps2, D3DCAPS2_CANCALIBRATEGAMMA), - CAPSFLAGDEF("D3DCAPS2_FULLSCREENGAMMA", Caps2, D3DCAPS2_FULLSCREENGAMMA), - CAPSFLAGDEF("D3DCAPS2_CANMANAGERESOURCE", Caps2, D3DCAPS2_CANMANAGERESOURCE), - CAPSFLAGDEF("D3DCAPS2_DYNAMICTEXTURES", Caps2, D3DCAPS2_DYNAMICTEXTURES), - CAPSFLAGDEF("D3DCAPS2_CANAUTOGENMIPMAP", Caps2, D3DCAPS2_CANAUTOGENMIPMAP), - CAPSFLAGDEFex("D3DCAPS2_CANSHARERESOURCE", Caps2, D3DCAPS2_CANSHARERESOURCE), - {"",0,0} + CAPSFLAGDEF(L"D3DCAPS2_CANCALIBRATEGAMMA", Caps2, D3DCAPS2_CANCALIBRATEGAMMA), + CAPSFLAGDEF(L"D3DCAPS2_FULLSCREENGAMMA", Caps2, D3DCAPS2_FULLSCREENGAMMA), + CAPSFLAGDEF(L"D3DCAPS2_CANMANAGERESOURCE", Caps2, D3DCAPS2_CANMANAGERESOURCE), + CAPSFLAGDEF(L"D3DCAPS2_DYNAMICTEXTURES", Caps2, D3DCAPS2_DYNAMICTEXTURES), + CAPSFLAGDEF(L"D3DCAPS2_CANAUTOGENMIPMAP", Caps2, D3DCAPS2_CANAUTOGENMIPMAP), + CAPSFLAGDEFex(L"D3DCAPS2_CANSHARERESOURCE", Caps2, D3DCAPS2_CANSHARERESOURCE), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsCaps3[] = { - CAPSFLAGDEF("D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD", Caps3, D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD), - CAPSFLAGDEF("D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION", Caps3, D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION), - CAPSFLAGDEF("D3DCAPS3_COPY_TO_VIDMEM", Caps3, D3DCAPS3_COPY_TO_VIDMEM), - CAPSFLAGDEF("D3DCAPS3_COPY_TO_SYSTEMMEM", Caps3, D3DCAPS3_COPY_TO_SYSTEMMEM), - CAPSFLAGDEFex("D3DCAPS3_DXVAHD", Caps3, D3DCAPS3_DXVAHD), - {"",0,0} + CAPSFLAGDEF(L"D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD", Caps3, D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD), + CAPSFLAGDEF(L"D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION", Caps3, D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION), + CAPSFLAGDEF(L"D3DCAPS3_COPY_TO_VIDMEM", Caps3, D3DCAPS3_COPY_TO_VIDMEM), + CAPSFLAGDEF(L"D3DCAPS3_COPY_TO_SYSTEMMEM", Caps3, D3DCAPS3_COPY_TO_SYSTEMMEM), + CAPSFLAGDEFex(L"D3DCAPS3_DXVAHD", Caps3, D3DCAPS3_DXVAHD), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsPresentationIntervals[] = { - CAPSFLAGDEF("D3DPRESENT_INTERVAL_ONE", PresentationIntervals, D3DPRESENT_INTERVAL_ONE), - CAPSFLAGDEF("D3DPRESENT_INTERVAL_TWO", PresentationIntervals, D3DPRESENT_INTERVAL_TWO), - CAPSFLAGDEF("D3DPRESENT_INTERVAL_THREE", PresentationIntervals, D3DPRESENT_INTERVAL_THREE), - CAPSFLAGDEF("D3DPRESENT_INTERVAL_FOUR", PresentationIntervals, D3DPRESENT_INTERVAL_FOUR), - CAPSFLAGDEF("D3DPRESENT_INTERVAL_IMMEDIATE", PresentationIntervals, D3DPRESENT_INTERVAL_IMMEDIATE), - {"",0,0} + CAPSFLAGDEF(L"D3DPRESENT_INTERVAL_ONE", PresentationIntervals, D3DPRESENT_INTERVAL_ONE), + CAPSFLAGDEF(L"D3DPRESENT_INTERVAL_TWO", PresentationIntervals, D3DPRESENT_INTERVAL_TWO), + CAPSFLAGDEF(L"D3DPRESENT_INTERVAL_THREE", PresentationIntervals, D3DPRESENT_INTERVAL_THREE), + CAPSFLAGDEF(L"D3DPRESENT_INTERVAL_FOUR", PresentationIntervals, D3DPRESENT_INTERVAL_FOUR), + CAPSFLAGDEF(L"D3DPRESENT_INTERVAL_IMMEDIATE", PresentationIntervals, D3DPRESENT_INTERVAL_IMMEDIATE), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsCursorCaps[] = { - CAPSFLAGDEF("D3DCURSORCAPS_COLOR", CursorCaps, D3DCURSORCAPS_COLOR), - CAPSFLAGDEF("D3DCURSORCAPS_LOWRES", CursorCaps, D3DCURSORCAPS_LOWRES), - {"",0,0} + CAPSFLAGDEF(L"D3DCURSORCAPS_COLOR", CursorCaps, D3DCURSORCAPS_COLOR), + CAPSFLAGDEF(L"D3DCURSORCAPS_LOWRES", CursorCaps, D3DCURSORCAPS_LOWRES), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsDevCaps[] = { - CAPSFLAGDEF("D3DDEVCAPS_EXECUTESYSTEMMEMORY", DevCaps, D3DDEVCAPS_EXECUTESYSTEMMEMORY), - CAPSFLAGDEF("D3DDEVCAPS_EXECUTEVIDEOMEMORY", DevCaps, D3DDEVCAPS_EXECUTEVIDEOMEMORY), - CAPSFLAGDEF("D3DDEVCAPS_TLVERTEXSYSTEMMEMORY", DevCaps, D3DDEVCAPS_TLVERTEXSYSTEMMEMORY), - CAPSFLAGDEF("D3DDEVCAPS_TLVERTEXVIDEOMEMORY", DevCaps, D3DDEVCAPS_TLVERTEXVIDEOMEMORY), - CAPSFLAGDEF("D3DDEVCAPS_TEXTURESYSTEMMEMORY", DevCaps, D3DDEVCAPS_TEXTURESYSTEMMEMORY), - CAPSFLAGDEF("D3DDEVCAPS_TEXTUREVIDEOMEMORY", DevCaps, D3DDEVCAPS_TEXTUREVIDEOMEMORY), - CAPSFLAGDEF("D3DDEVCAPS_DRAWPRIMTLVERTEX", DevCaps, D3DDEVCAPS_DRAWPRIMTLVERTEX), - CAPSFLAGDEF("D3DDEVCAPS_CANRENDERAFTERFLIP", DevCaps, D3DDEVCAPS_CANRENDERAFTERFLIP), - CAPSFLAGDEF("D3DDEVCAPS_TEXTURENONLOCALVIDMEM", DevCaps, D3DDEVCAPS_TEXTURENONLOCALVIDMEM), - CAPSFLAGDEF("D3DDEVCAPS_DRAWPRIMITIVES2", DevCaps, D3DDEVCAPS_DRAWPRIMITIVES2), - CAPSFLAGDEF("D3DDEVCAPS_SEPARATETEXTUREMEMORIES", DevCaps, D3DDEVCAPS_SEPARATETEXTUREMEMORIES), - CAPSFLAGDEF("D3DDEVCAPS_DRAWPRIMITIVES2EX", DevCaps, D3DDEVCAPS_DRAWPRIMITIVES2EX), - CAPSFLAGDEF("D3DDEVCAPS_HWTRANSFORMANDLIGHT", DevCaps, D3DDEVCAPS_HWTRANSFORMANDLIGHT), - CAPSFLAGDEF("D3DDEVCAPS_CANBLTSYSTONONLOCAL", DevCaps, D3DDEVCAPS_CANBLTSYSTONONLOCAL), - CAPSFLAGDEF("D3DDEVCAPS_HWRASTERIZATION", DevCaps, D3DDEVCAPS_HWRASTERIZATION), - CAPSFLAGDEF("D3DDEVCAPS_PUREDEVICE", DevCaps, D3DDEVCAPS_PUREDEVICE), - CAPSFLAGDEF("D3DDEVCAPS_QUINTICRTPATCHES", DevCaps, D3DDEVCAPS_QUINTICRTPATCHES), - CAPSFLAGDEF("D3DDEVCAPS_RTPATCHES", DevCaps, D3DDEVCAPS_RTPATCHES), - CAPSFLAGDEF("D3DDEVCAPS_RTPATCHHANDLEZERO", DevCaps, D3DDEVCAPS_RTPATCHHANDLEZERO), - CAPSFLAGDEF("D3DDEVCAPS_NPATCHES", DevCaps, D3DDEVCAPS_NPATCHES), - {"",0,0} + CAPSFLAGDEF(L"D3DDEVCAPS_EXECUTESYSTEMMEMORY", DevCaps, D3DDEVCAPS_EXECUTESYSTEMMEMORY), + CAPSFLAGDEF(L"D3DDEVCAPS_EXECUTEVIDEOMEMORY", DevCaps, D3DDEVCAPS_EXECUTEVIDEOMEMORY), + CAPSFLAGDEF(L"D3DDEVCAPS_TLVERTEXSYSTEMMEMORY", DevCaps, D3DDEVCAPS_TLVERTEXSYSTEMMEMORY), + CAPSFLAGDEF(L"D3DDEVCAPS_TLVERTEXVIDEOMEMORY", DevCaps, D3DDEVCAPS_TLVERTEXVIDEOMEMORY), + CAPSFLAGDEF(L"D3DDEVCAPS_TEXTURESYSTEMMEMORY", DevCaps, D3DDEVCAPS_TEXTURESYSTEMMEMORY), + CAPSFLAGDEF(L"D3DDEVCAPS_TEXTUREVIDEOMEMORY", DevCaps, D3DDEVCAPS_TEXTUREVIDEOMEMORY), + CAPSFLAGDEF(L"D3DDEVCAPS_DRAWPRIMTLVERTEX", DevCaps, D3DDEVCAPS_DRAWPRIMTLVERTEX), + CAPSFLAGDEF(L"D3DDEVCAPS_CANRENDERAFTERFLIP", DevCaps, D3DDEVCAPS_CANRENDERAFTERFLIP), + CAPSFLAGDEF(L"D3DDEVCAPS_TEXTURENONLOCALVIDMEM", DevCaps, D3DDEVCAPS_TEXTURENONLOCALVIDMEM), + CAPSFLAGDEF(L"D3DDEVCAPS_DRAWPRIMITIVES2", DevCaps, D3DDEVCAPS_DRAWPRIMITIVES2), + CAPSFLAGDEF(L"D3DDEVCAPS_SEPARATETEXTUREMEMORIES", DevCaps, D3DDEVCAPS_SEPARATETEXTUREMEMORIES), + CAPSFLAGDEF(L"D3DDEVCAPS_DRAWPRIMITIVES2EX", DevCaps, D3DDEVCAPS_DRAWPRIMITIVES2EX), + CAPSFLAGDEF(L"D3DDEVCAPS_HWTRANSFORMANDLIGHT", DevCaps, D3DDEVCAPS_HWTRANSFORMANDLIGHT), + CAPSFLAGDEF(L"D3DDEVCAPS_CANBLTSYSTONONLOCAL", DevCaps, D3DDEVCAPS_CANBLTSYSTONONLOCAL), + CAPSFLAGDEF(L"D3DDEVCAPS_HWRASTERIZATION", DevCaps, D3DDEVCAPS_HWRASTERIZATION), + CAPSFLAGDEF(L"D3DDEVCAPS_PUREDEVICE", DevCaps, D3DDEVCAPS_PUREDEVICE), + CAPSFLAGDEF(L"D3DDEVCAPS_QUINTICRTPATCHES", DevCaps, D3DDEVCAPS_QUINTICRTPATCHES), + CAPSFLAGDEF(L"D3DDEVCAPS_RTPATCHES", DevCaps, D3DDEVCAPS_RTPATCHES), + CAPSFLAGDEF(L"D3DDEVCAPS_RTPATCHHANDLEZERO", DevCaps, D3DDEVCAPS_RTPATCHHANDLEZERO), + CAPSFLAGDEF(L"D3DDEVCAPS_NPATCHES", DevCaps, D3DDEVCAPS_NPATCHES), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsLineCaps[] = { - CAPSFLAGDEF("D3DLINECAPS_TEXTURE", LineCaps, D3DLINECAPS_TEXTURE), - CAPSFLAGDEF("D3DLINECAPS_ZTEST", LineCaps, D3DLINECAPS_ZTEST), - CAPSFLAGDEF("D3DLINECAPS_BLEND", LineCaps, D3DLINECAPS_BLEND), - CAPSFLAGDEF("D3DLINECAPS_ALPHACMP", LineCaps, D3DLINECAPS_ALPHACMP), - CAPSFLAGDEF("D3DLINECAPS_FOG", LineCaps, D3DLINECAPS_FOG), - CAPSFLAGDEF("D3DLINECAPS_ANTIALIAS", LineCaps, D3DLINECAPS_ANTIALIAS), - {"",0,0} + CAPSFLAGDEF(L"D3DLINECAPS_TEXTURE", LineCaps, D3DLINECAPS_TEXTURE), + CAPSFLAGDEF(L"D3DLINECAPS_ZTEST", LineCaps, D3DLINECAPS_ZTEST), + CAPSFLAGDEF(L"D3DLINECAPS_BLEND", LineCaps, D3DLINECAPS_BLEND), + CAPSFLAGDEF(L"D3DLINECAPS_ALPHACMP", LineCaps, D3DLINECAPS_ALPHACMP), + CAPSFLAGDEF(L"D3DLINECAPS_FOG", LineCaps, D3DLINECAPS_FOG), + CAPSFLAGDEF(L"D3DLINECAPS_ANTIALIAS", LineCaps, D3DLINECAPS_ANTIALIAS), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsStencilCaps[] = { - CAPSFLAGDEF("D3DSTENCILCAPS_KEEP", StencilCaps, D3DSTENCILCAPS_KEEP), - CAPSFLAGDEF("D3DSTENCILCAPS_ZERO", StencilCaps, D3DSTENCILCAPS_ZERO), - CAPSFLAGDEF("D3DSTENCILCAPS_REPLACE", StencilCaps, D3DSTENCILCAPS_REPLACE), - CAPSFLAGDEF("D3DSTENCILCAPS_INCRSAT", StencilCaps, D3DSTENCILCAPS_INCRSAT), - CAPSFLAGDEF("D3DSTENCILCAPS_DECRSAT", StencilCaps, D3DSTENCILCAPS_DECRSAT), - CAPSFLAGDEF("D3DSTENCILCAPS_INVERT", StencilCaps, D3DSTENCILCAPS_INVERT), - CAPSFLAGDEF("D3DSTENCILCAPS_INCR", StencilCaps, D3DSTENCILCAPS_INCR), - CAPSFLAGDEF("D3DSTENCILCAPS_DECR", StencilCaps, D3DSTENCILCAPS_DECR), - CAPSFLAGDEF("D3DSTENCILCAPS_TWOSIDED", StencilCaps, D3DSTENCILCAPS_TWOSIDED), - {"",0,0} + CAPSFLAGDEF(L"D3DSTENCILCAPS_KEEP", StencilCaps, D3DSTENCILCAPS_KEEP), + CAPSFLAGDEF(L"D3DSTENCILCAPS_ZERO", StencilCaps, D3DSTENCILCAPS_ZERO), + CAPSFLAGDEF(L"D3DSTENCILCAPS_REPLACE", StencilCaps, D3DSTENCILCAPS_REPLACE), + CAPSFLAGDEF(L"D3DSTENCILCAPS_INCRSAT", StencilCaps, D3DSTENCILCAPS_INCRSAT), + CAPSFLAGDEF(L"D3DSTENCILCAPS_DECRSAT", StencilCaps, D3DSTENCILCAPS_DECRSAT), + CAPSFLAGDEF(L"D3DSTENCILCAPS_INVERT", StencilCaps, D3DSTENCILCAPS_INVERT), + CAPSFLAGDEF(L"D3DSTENCILCAPS_INCR", StencilCaps, D3DSTENCILCAPS_INCR), + CAPSFLAGDEF(L"D3DSTENCILCAPS_DECR", StencilCaps, D3DSTENCILCAPS_DECR), + CAPSFLAGDEF(L"D3DSTENCILCAPS_TWOSIDED", StencilCaps, D3DSTENCILCAPS_TWOSIDED), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsFVFCaps[] = { - CAPSFLAGDEF("D3DFVFCAPS_DONOTSTRIPELEMENTS", FVFCaps, D3DFVFCAPS_DONOTSTRIPELEMENTS), - CAPSMASK16DEF("D3DFVFCAPS_TEXCOORDCOUNTMASK", FVFCaps), - CAPSFLAGDEF("D3DFVFCAPS_PSIZE", FVFCaps, D3DFVFCAPS_PSIZE), - {"",0,0} + CAPSFLAGDEF(L"D3DFVFCAPS_DONOTSTRIPELEMENTS", FVFCaps, D3DFVFCAPS_DONOTSTRIPELEMENTS), + CAPSMASK16DEF(L"D3DFVFCAPS_TEXCOORDCOUNTMASK", FVFCaps), + CAPSFLAGDEF(L"D3DFVFCAPS_PSIZE", FVFCaps, D3DFVFCAPS_PSIZE), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsTextureOpCaps[] = { - CAPSFLAGDEF("D3DTEXOPCAPS_DISABLE", TextureOpCaps, D3DTEXOPCAPS_DISABLE), - CAPSFLAGDEF("D3DTEXOPCAPS_SELECTARG1", TextureOpCaps, D3DTEXOPCAPS_SELECTARG1), - CAPSFLAGDEF("D3DTEXOPCAPS_SELECTARG2", TextureOpCaps, D3DTEXOPCAPS_SELECTARG2), - CAPSFLAGDEF("D3DTEXOPCAPS_MODULATE", TextureOpCaps, D3DTEXOPCAPS_MODULATE), - CAPSFLAGDEF("D3DTEXOPCAPS_MODULATE2X", TextureOpCaps, D3DTEXOPCAPS_MODULATE2X), - CAPSFLAGDEF("D3DTEXOPCAPS_MODULATE4X", TextureOpCaps, D3DTEXOPCAPS_MODULATE4X), - CAPSFLAGDEF("D3DTEXOPCAPS_ADD", TextureOpCaps, D3DTEXOPCAPS_ADD), - CAPSFLAGDEF("D3DTEXOPCAPS_ADDSIGNED", TextureOpCaps, D3DTEXOPCAPS_ADDSIGNED), - CAPSFLAGDEF("D3DTEXOPCAPS_ADDSIGNED2X", TextureOpCaps, D3DTEXOPCAPS_ADDSIGNED2X), - CAPSFLAGDEF("D3DTEXOPCAPS_SUBTRACT", TextureOpCaps, D3DTEXOPCAPS_SUBTRACT), - CAPSFLAGDEF("D3DTEXOPCAPS_ADDSMOOTH", TextureOpCaps, D3DTEXOPCAPS_ADDSMOOTH), - CAPSFLAGDEF("D3DTEXOPCAPS_BLENDDIFFUSEALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDDIFFUSEALPHA), - CAPSFLAGDEF("D3DTEXOPCAPS_BLENDTEXTUREALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDTEXTUREALPHA), - CAPSFLAGDEF("D3DTEXOPCAPS_BLENDFACTORALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDFACTORALPHA), - CAPSFLAGDEF("D3DTEXOPCAPS_BLENDTEXTUREALPHAPM", TextureOpCaps, D3DTEXOPCAPS_BLENDTEXTUREALPHAPM), - CAPSFLAGDEF("D3DTEXOPCAPS_BLENDCURRENTALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDCURRENTALPHA), - CAPSFLAGDEF("D3DTEXOPCAPS_PREMODULATE", TextureOpCaps, D3DTEXOPCAPS_PREMODULATE), - CAPSFLAGDEF("D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR", TextureOpCaps, D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR), - CAPSFLAGDEF("D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA", TextureOpCaps, D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA), - CAPSFLAGDEF("D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR", TextureOpCaps, D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR), - CAPSFLAGDEF("D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA", TextureOpCaps, D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA), - CAPSFLAGDEF("D3DTEXOPCAPS_BUMPENVMAP", TextureOpCaps, D3DTEXOPCAPS_BUMPENVMAP), - CAPSFLAGDEF("D3DTEXOPCAPS_BUMPENVMAPLUMINANCE", TextureOpCaps, D3DTEXOPCAPS_BUMPENVMAPLUMINANCE), - CAPSFLAGDEF("D3DTEXOPCAPS_DOTPRODUCT3", TextureOpCaps, D3DTEXOPCAPS_DOTPRODUCT3), - CAPSFLAGDEF("D3DTEXOPCAPS_MULTIPLYADD", TextureOpCaps, D3DTEXOPCAPS_MULTIPLYADD), - CAPSFLAGDEF("D3DTEXOPCAPS_LERP", TextureOpCaps, D3DTEXOPCAPS_LERP), - {"",0,0} + CAPSFLAGDEF(L"D3DTEXOPCAPS_DISABLE", TextureOpCaps, D3DTEXOPCAPS_DISABLE), + CAPSFLAGDEF(L"D3DTEXOPCAPS_SELECTARG1", TextureOpCaps, D3DTEXOPCAPS_SELECTARG1), + CAPSFLAGDEF(L"D3DTEXOPCAPS_SELECTARG2", TextureOpCaps, D3DTEXOPCAPS_SELECTARG2), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MODULATE", TextureOpCaps, D3DTEXOPCAPS_MODULATE), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MODULATE2X", TextureOpCaps, D3DTEXOPCAPS_MODULATE2X), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MODULATE4X", TextureOpCaps, D3DTEXOPCAPS_MODULATE4X), + CAPSFLAGDEF(L"D3DTEXOPCAPS_ADD", TextureOpCaps, D3DTEXOPCAPS_ADD), + CAPSFLAGDEF(L"D3DTEXOPCAPS_ADDSIGNED", TextureOpCaps, D3DTEXOPCAPS_ADDSIGNED), + CAPSFLAGDEF(L"D3DTEXOPCAPS_ADDSIGNED2X", TextureOpCaps, D3DTEXOPCAPS_ADDSIGNED2X), + CAPSFLAGDEF(L"D3DTEXOPCAPS_SUBTRACT", TextureOpCaps, D3DTEXOPCAPS_SUBTRACT), + CAPSFLAGDEF(L"D3DTEXOPCAPS_ADDSMOOTH", TextureOpCaps, D3DTEXOPCAPS_ADDSMOOTH), + CAPSFLAGDEF(L"D3DTEXOPCAPS_BLENDDIFFUSEALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDDIFFUSEALPHA), + CAPSFLAGDEF(L"D3DTEXOPCAPS_BLENDTEXTUREALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDTEXTUREALPHA), + CAPSFLAGDEF(L"D3DTEXOPCAPS_BLENDFACTORALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDFACTORALPHA), + CAPSFLAGDEF(L"D3DTEXOPCAPS_BLENDTEXTUREALPHAPM", TextureOpCaps, D3DTEXOPCAPS_BLENDTEXTUREALPHAPM), + CAPSFLAGDEF(L"D3DTEXOPCAPS_BLENDCURRENTALPHA", TextureOpCaps, D3DTEXOPCAPS_BLENDCURRENTALPHA), + CAPSFLAGDEF(L"D3DTEXOPCAPS_PREMODULATE", TextureOpCaps, D3DTEXOPCAPS_PREMODULATE), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR", TextureOpCaps, D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA", TextureOpCaps, D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR", TextureOpCaps, D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA", TextureOpCaps, D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA), + CAPSFLAGDEF(L"D3DTEXOPCAPS_BUMPENVMAP", TextureOpCaps, D3DTEXOPCAPS_BUMPENVMAP), + CAPSFLAGDEF(L"D3DTEXOPCAPS_BUMPENVMAPLUMINANCE", TextureOpCaps, D3DTEXOPCAPS_BUMPENVMAPLUMINANCE), + CAPSFLAGDEF(L"D3DTEXOPCAPS_DOTPRODUCT3", TextureOpCaps, D3DTEXOPCAPS_DOTPRODUCT3), + CAPSFLAGDEF(L"D3DTEXOPCAPS_MULTIPLYADD", TextureOpCaps, D3DTEXOPCAPS_MULTIPLYADD), + CAPSFLAGDEF(L"D3DTEXOPCAPS_LERP", TextureOpCaps, D3DTEXOPCAPS_LERP), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsVertexProcessingCaps[] = { - CAPSFLAGDEF("D3DVTXPCAPS_DIRECTIONALLIGHTS", VertexProcessingCaps, D3DVTXPCAPS_DIRECTIONALLIGHTS), - CAPSFLAGDEF("D3DVTXPCAPS_LOCALVIEWER", VertexProcessingCaps, D3DVTXPCAPS_LOCALVIEWER), - CAPSFLAGDEF("D3DVTXPCAPS_MATERIALSOURCE7", VertexProcessingCaps, D3DVTXPCAPS_MATERIALSOURCE7), - CAPSFLAGDEF("D3DVTXPCAPS_POSITIONALLIGHTS", VertexProcessingCaps, D3DVTXPCAPS_POSITIONALLIGHTS), - CAPSFLAGDEF("D3DVTXPCAPS_TEXGEN", VertexProcessingCaps, D3DVTXPCAPS_TEXGEN), - CAPSFLAGDEF("D3DVTXPCAPS_TWEENING", VertexProcessingCaps, D3DVTXPCAPS_TWEENING), - CAPSFLAGDEF("D3DVTXPCAPS_TEXGEN_SPHEREMAP", VertexProcessingCaps, D3DVTXPCAPS_TEXGEN_SPHEREMAP), - CAPSFLAGDEF("D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER", VertexProcessingCaps, D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER), - {"",0,0} + CAPSFLAGDEF(L"D3DVTXPCAPS_DIRECTIONALLIGHTS", VertexProcessingCaps, D3DVTXPCAPS_DIRECTIONALLIGHTS), + CAPSFLAGDEF(L"D3DVTXPCAPS_LOCALVIEWER", VertexProcessingCaps, D3DVTXPCAPS_LOCALVIEWER), + CAPSFLAGDEF(L"D3DVTXPCAPS_MATERIALSOURCE7", VertexProcessingCaps, D3DVTXPCAPS_MATERIALSOURCE7), + CAPSFLAGDEF(L"D3DVTXPCAPS_POSITIONALLIGHTS", VertexProcessingCaps, D3DVTXPCAPS_POSITIONALLIGHTS), + CAPSFLAGDEF(L"D3DVTXPCAPS_TEXGEN", VertexProcessingCaps, D3DVTXPCAPS_TEXGEN), + CAPSFLAGDEF(L"D3DVTXPCAPS_TWEENING", VertexProcessingCaps, D3DVTXPCAPS_TWEENING), + CAPSFLAGDEF(L"D3DVTXPCAPS_TEXGEN_SPHEREMAP", VertexProcessingCaps, D3DVTXPCAPS_TEXGEN_SPHEREMAP), + CAPSFLAGDEF(L"D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER", VertexProcessingCaps, D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsPrimMiscCaps[] = { - CAPSFLAGDEF("D3DPMISCCAPS_MASKZ", PrimitiveMiscCaps, D3DPMISCCAPS_MASKZ), - CAPSFLAGDEF("D3DPMISCCAPS_CULLNONE", PrimitiveMiscCaps, D3DPMISCCAPS_CULLNONE), - CAPSFLAGDEF("D3DPMISCCAPS_CULLCW", PrimitiveMiscCaps, D3DPMISCCAPS_CULLCW), - CAPSFLAGDEF("D3DPMISCCAPS_CULLCCW", PrimitiveMiscCaps, D3DPMISCCAPS_CULLCCW), - CAPSFLAGDEF("D3DPMISCCAPS_COLORWRITEENABLE", PrimitiveMiscCaps, D3DPMISCCAPS_COLORWRITEENABLE), - CAPSFLAGDEF("D3DPMISCCAPS_CLIPPLANESCALEDPOINTS", PrimitiveMiscCaps, D3DPMISCCAPS_CLIPPLANESCALEDPOINTS), - CAPSFLAGDEF("D3DPMISCCAPS_CLIPTLVERTS", PrimitiveMiscCaps, D3DPMISCCAPS_CLIPTLVERTS), - CAPSFLAGDEF("D3DPMISCCAPS_TSSARGTEMP", PrimitiveMiscCaps, D3DPMISCCAPS_TSSARGTEMP), - CAPSFLAGDEF("D3DPMISCCAPS_BLENDOP", PrimitiveMiscCaps, D3DPMISCCAPS_BLENDOP), - CAPSFLAGDEF("D3DPMISCCAPS_NULLREFERENCE", PrimitiveMiscCaps, D3DPMISCCAPS_NULLREFERENCE), - CAPSFLAGDEF("D3DPMISCCAPS_INDEPENDENTWRITEMASKS", PrimitiveMiscCaps, D3DPMISCCAPS_INDEPENDENTWRITEMASKS), - CAPSFLAGDEF("D3DPMISCCAPS_PERSTAGECONSTANT", PrimitiveMiscCaps, D3DPMISCCAPS_PERSTAGECONSTANT), - CAPSFLAGDEF("D3DPMISCCAPS_FOGANDSPECULARALPHA", PrimitiveMiscCaps, D3DPMISCCAPS_FOGANDSPECULARALPHA), - CAPSFLAGDEF("D3DPMISCCAPS_SEPARATEALPHABLEND", PrimitiveMiscCaps, D3DPMISCCAPS_SEPARATEALPHABLEND), - CAPSFLAGDEF("D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS", PrimitiveMiscCaps, D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS), - CAPSFLAGDEF("D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING", PrimitiveMiscCaps, D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING), - CAPSFLAGDEF("D3DPMISCCAPS_FOGVERTEXCLAMPED", PrimitiveMiscCaps, D3DPMISCCAPS_FOGVERTEXCLAMPED), - CAPSFLAGDEFex("D3DPMISCCAPS_POSTBLENDSRGBCONVERT", PrimitiveMiscCaps, D3DPMISCCAPS_POSTBLENDSRGBCONVERT), - {"",0,0} + CAPSFLAGDEF(L"D3DPMISCCAPS_MASKZ", PrimitiveMiscCaps, D3DPMISCCAPS_MASKZ), + CAPSFLAGDEF(L"D3DPMISCCAPS_CULLNONE", PrimitiveMiscCaps, D3DPMISCCAPS_CULLNONE), + CAPSFLAGDEF(L"D3DPMISCCAPS_CULLCW", PrimitiveMiscCaps, D3DPMISCCAPS_CULLCW), + CAPSFLAGDEF(L"D3DPMISCCAPS_CULLCCW", PrimitiveMiscCaps, D3DPMISCCAPS_CULLCCW), + CAPSFLAGDEF(L"D3DPMISCCAPS_COLORWRITEENABLE", PrimitiveMiscCaps, D3DPMISCCAPS_COLORWRITEENABLE), + CAPSFLAGDEF(L"D3DPMISCCAPS_CLIPPLANESCALEDPOINTS", PrimitiveMiscCaps, D3DPMISCCAPS_CLIPPLANESCALEDPOINTS), + CAPSFLAGDEF(L"D3DPMISCCAPS_CLIPTLVERTS", PrimitiveMiscCaps, D3DPMISCCAPS_CLIPTLVERTS), + CAPSFLAGDEF(L"D3DPMISCCAPS_TSSARGTEMP", PrimitiveMiscCaps, D3DPMISCCAPS_TSSARGTEMP), + CAPSFLAGDEF(L"D3DPMISCCAPS_BLENDOP", PrimitiveMiscCaps, D3DPMISCCAPS_BLENDOP), + CAPSFLAGDEF(L"D3DPMISCCAPS_NULLREFERENCE", PrimitiveMiscCaps, D3DPMISCCAPS_NULLREFERENCE), + CAPSFLAGDEF(L"D3DPMISCCAPS_INDEPENDENTWRITEMASKS", PrimitiveMiscCaps, D3DPMISCCAPS_INDEPENDENTWRITEMASKS), + CAPSFLAGDEF(L"D3DPMISCCAPS_PERSTAGECONSTANT", PrimitiveMiscCaps, D3DPMISCCAPS_PERSTAGECONSTANT), + CAPSFLAGDEF(L"D3DPMISCCAPS_FOGANDSPECULARALPHA", PrimitiveMiscCaps, D3DPMISCCAPS_FOGANDSPECULARALPHA), + CAPSFLAGDEF(L"D3DPMISCCAPS_SEPARATEALPHABLEND", PrimitiveMiscCaps, D3DPMISCCAPS_SEPARATEALPHABLEND), + CAPSFLAGDEF(L"D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS", PrimitiveMiscCaps, D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS), + CAPSFLAGDEF(L"D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING", PrimitiveMiscCaps, D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING), + CAPSFLAGDEF(L"D3DPMISCCAPS_FOGVERTEXCLAMPED", PrimitiveMiscCaps, D3DPMISCCAPS_FOGVERTEXCLAMPED), + CAPSFLAGDEFex(L"D3DPMISCCAPS_POSTBLENDSRGBCONVERT", PrimitiveMiscCaps, D3DPMISCCAPS_POSTBLENDSRGBCONVERT), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsRasterCaps[] = { - CAPSFLAGDEF("D3DPRASTERCAPS_DITHER", RasterCaps, D3DPRASTERCAPS_DITHER), - CAPSFLAGDEF("D3DPRASTERCAPS_ZTEST", RasterCaps, D3DPRASTERCAPS_ZTEST), - CAPSFLAGDEF("D3DPRASTERCAPS_FOGVERTEX", RasterCaps, D3DPRASTERCAPS_FOGVERTEX), - CAPSFLAGDEF("D3DPRASTERCAPS_FOGTABLE", RasterCaps, D3DPRASTERCAPS_FOGTABLE), - // CAPSFLAGDEF("D3DPRASTERCAPS_ANTIALIASEDGES", RasterCaps, D3DPRASTERCAPS_ANTIALIASEDGES), - CAPSFLAGDEF("D3DPRASTERCAPS_MIPMAPLODBIAS", RasterCaps, D3DPRASTERCAPS_MIPMAPLODBIAS), - // CAPSFLAGDEF("D3DPRASTERCAPS_ZBIAS", RasterCaps, D3DPRASTERCAPS_ZBIAS), - CAPSFLAGDEF("D3DPRASTERCAPS_ZBUFFERLESSHSR", RasterCaps, D3DPRASTERCAPS_ZBUFFERLESSHSR), - CAPSFLAGDEF("D3DPRASTERCAPS_FOGRANGE", RasterCaps, D3DPRASTERCAPS_FOGRANGE), - CAPSFLAGDEF("D3DPRASTERCAPS_ANISOTROPY", RasterCaps, D3DPRASTERCAPS_ANISOTROPY), - CAPSFLAGDEF("D3DPRASTERCAPS_WBUFFER", RasterCaps, D3DPRASTERCAPS_WBUFFER), - CAPSFLAGDEF("D3DPRASTERCAPS_WFOG", RasterCaps, D3DPRASTERCAPS_WFOG), - CAPSFLAGDEF("D3DPRASTERCAPS_ZFOG", RasterCaps, D3DPRASTERCAPS_ZFOG), - CAPSFLAGDEF("D3DPRASTERCAPS_COLORPERSPECTIVE", RasterCaps, D3DPRASTERCAPS_COLORPERSPECTIVE), - // CAPSFLAGDEF("D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE", RasterCaps, D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE), - CAPSFLAGDEF("D3DPRASTERCAPS_SCISSORTEST", RasterCaps, D3DPRASTERCAPS_SCISSORTEST), - CAPSFLAGDEF("D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS", RasterCaps, D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS), - CAPSFLAGDEF("D3DPRASTERCAPS_DEPTHBIAS", RasterCaps, D3DPRASTERCAPS_DEPTHBIAS), - CAPSFLAGDEF("D3DPRASTERCAPS_MULTISAMPLE_TOGGLE",RasterCaps, D3DPRASTERCAPS_MULTISAMPLE_TOGGLE), - {"",0,0} + CAPSFLAGDEF(L"D3DPRASTERCAPS_DITHER", RasterCaps, D3DPRASTERCAPS_DITHER), + CAPSFLAGDEF(L"D3DPRASTERCAPS_ZTEST", RasterCaps, D3DPRASTERCAPS_ZTEST), + CAPSFLAGDEF(L"D3DPRASTERCAPS_FOGVERTEX", RasterCaps, D3DPRASTERCAPS_FOGVERTEX), + CAPSFLAGDEF(L"D3DPRASTERCAPS_FOGTABLE", RasterCaps, D3DPRASTERCAPS_FOGTABLE), + // CAPSFLAGDEF(L"D3DPRASTERCAPS_ANTIALIASEDGES", RasterCaps, D3DPRASTERCAPS_ANTIALIASEDGES), + CAPSFLAGDEF(L"D3DPRASTERCAPS_MIPMAPLODBIAS", RasterCaps, D3DPRASTERCAPS_MIPMAPLODBIAS), + // CAPSFLAGDEF(L"D3DPRASTERCAPS_ZBIAS", RasterCaps, D3DPRASTERCAPS_ZBIAS), + CAPSFLAGDEF(L"D3DPRASTERCAPS_ZBUFFERLESSHSR", RasterCaps, D3DPRASTERCAPS_ZBUFFERLESSHSR), + CAPSFLAGDEF(L"D3DPRASTERCAPS_FOGRANGE", RasterCaps, D3DPRASTERCAPS_FOGRANGE), + CAPSFLAGDEF(L"D3DPRASTERCAPS_ANISOTROPY", RasterCaps, D3DPRASTERCAPS_ANISOTROPY), + CAPSFLAGDEF(L"D3DPRASTERCAPS_WBUFFER", RasterCaps, D3DPRASTERCAPS_WBUFFER), + CAPSFLAGDEF(L"D3DPRASTERCAPS_WFOG", RasterCaps, D3DPRASTERCAPS_WFOG), + CAPSFLAGDEF(L"D3DPRASTERCAPS_ZFOG", RasterCaps, D3DPRASTERCAPS_ZFOG), + CAPSFLAGDEF(L"D3DPRASTERCAPS_COLORPERSPECTIVE", RasterCaps, D3DPRASTERCAPS_COLORPERSPECTIVE), + // CAPSFLAGDEF(L"D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE", RasterCaps, D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE), + CAPSFLAGDEF(L"D3DPRASTERCAPS_SCISSORTEST", RasterCaps, D3DPRASTERCAPS_SCISSORTEST), + CAPSFLAGDEF(L"D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS", RasterCaps, D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS), + CAPSFLAGDEF(L"D3DPRASTERCAPS_DEPTHBIAS", RasterCaps, D3DPRASTERCAPS_DEPTHBIAS), + CAPSFLAGDEF(L"D3DPRASTERCAPS_MULTISAMPLE_TOGGLE",RasterCaps, D3DPRASTERCAPS_MULTISAMPLE_TOGGLE), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsZCmpCaps[] = { - CAPSFLAGDEF("D3DPCMPCAPS_NEVER", ZCmpCaps, D3DPCMPCAPS_NEVER), - CAPSFLAGDEF("D3DPCMPCAPS_LESS", ZCmpCaps, D3DPCMPCAPS_LESS), - CAPSFLAGDEF("D3DPCMPCAPS_EQUAL", ZCmpCaps, D3DPCMPCAPS_EQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_LESSEQUAL", ZCmpCaps, D3DPCMPCAPS_LESSEQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_GREATER", ZCmpCaps, D3DPCMPCAPS_GREATER), - CAPSFLAGDEF("D3DPCMPCAPS_NOTEQUAL", ZCmpCaps, D3DPCMPCAPS_NOTEQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_GREATEREQUAL", ZCmpCaps, D3DPCMPCAPS_GREATEREQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_ALWAYS", ZCmpCaps, D3DPCMPCAPS_ALWAYS), - {"",0,0} + CAPSFLAGDEF(L"D3DPCMPCAPS_NEVER", ZCmpCaps, D3DPCMPCAPS_NEVER), + CAPSFLAGDEF(L"D3DPCMPCAPS_LESS", ZCmpCaps, D3DPCMPCAPS_LESS), + CAPSFLAGDEF(L"D3DPCMPCAPS_EQUAL", ZCmpCaps, D3DPCMPCAPS_EQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_LESSEQUAL", ZCmpCaps, D3DPCMPCAPS_LESSEQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_GREATER", ZCmpCaps, D3DPCMPCAPS_GREATER), + CAPSFLAGDEF(L"D3DPCMPCAPS_NOTEQUAL", ZCmpCaps, D3DPCMPCAPS_NOTEQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_GREATEREQUAL", ZCmpCaps, D3DPCMPCAPS_GREATEREQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_ALWAYS", ZCmpCaps, D3DPCMPCAPS_ALWAYS), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsSrcBlendCaps[] = { - CAPSFLAGDEF("D3DPBLENDCAPS_ZERO", SrcBlendCaps, D3DPBLENDCAPS_ZERO), - CAPSFLAGDEF("D3DPBLENDCAPS_ONE", SrcBlendCaps, D3DPBLENDCAPS_ONE), - CAPSFLAGDEF("D3DPBLENDCAPS_SRCCOLOR", SrcBlendCaps, D3DPBLENDCAPS_SRCCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_INVSRCCOLOR", SrcBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_SRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_SRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_INVSRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_INVSRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_DESTALPHA", SrcBlendCaps, D3DPBLENDCAPS_DESTALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_INVDESTALPHA", SrcBlendCaps, D3DPBLENDCAPS_INVDESTALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_DESTCOLOR", SrcBlendCaps, D3DPBLENDCAPS_DESTCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_INVDESTCOLOR", SrcBlendCaps, D3DPBLENDCAPS_INVDESTCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_SRCALPHASAT", SrcBlendCaps, D3DPBLENDCAPS_SRCALPHASAT), - CAPSFLAGDEF("D3DPBLENDCAPS_BOTHSRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_BOTHSRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_BOTHINVSRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_BOTHINVSRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_BLENDFACTOR", SrcBlendCaps, D3DPBLENDCAPS_BLENDFACTOR), - CAPSFLAGDEFex("D3DPBLENDCAPS_SRCCOLOR2", SrcBlendCaps, D3DPBLENDCAPS_SRCCOLOR2), - CAPSFLAGDEFex("D3DPBLENDCAPS_INVSRCCOLOR2", SrcBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR2), - {"",0,0} + CAPSFLAGDEF(L"D3DPBLENDCAPS_ZERO", SrcBlendCaps, D3DPBLENDCAPS_ZERO), + CAPSFLAGDEF(L"D3DPBLENDCAPS_ONE", SrcBlendCaps, D3DPBLENDCAPS_ONE), + CAPSFLAGDEF(L"D3DPBLENDCAPS_SRCCOLOR", SrcBlendCaps, D3DPBLENDCAPS_SRCCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVSRCCOLOR", SrcBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_SRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_SRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVSRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_INVSRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_DESTALPHA", SrcBlendCaps, D3DPBLENDCAPS_DESTALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVDESTALPHA", SrcBlendCaps, D3DPBLENDCAPS_INVDESTALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_DESTCOLOR", SrcBlendCaps, D3DPBLENDCAPS_DESTCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVDESTCOLOR", SrcBlendCaps, D3DPBLENDCAPS_INVDESTCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_SRCALPHASAT", SrcBlendCaps, D3DPBLENDCAPS_SRCALPHASAT), + CAPSFLAGDEF(L"D3DPBLENDCAPS_BOTHSRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_BOTHSRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_BOTHINVSRCALPHA", SrcBlendCaps, D3DPBLENDCAPS_BOTHINVSRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_BLENDFACTOR", SrcBlendCaps, D3DPBLENDCAPS_BLENDFACTOR), + CAPSFLAGDEFex(L"D3DPBLENDCAPS_SRCCOLOR2", SrcBlendCaps, D3DPBLENDCAPS_SRCCOLOR2), + CAPSFLAGDEFex(L"D3DPBLENDCAPS_INVSRCCOLOR2", SrcBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR2), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsDestBlendCaps[] = { - CAPSFLAGDEF("D3DPBLENDCAPS_ZERO", DestBlendCaps, D3DPBLENDCAPS_ZERO), - CAPSFLAGDEF("D3DPBLENDCAPS_ONE", DestBlendCaps, D3DPBLENDCAPS_ONE), - CAPSFLAGDEF("D3DPBLENDCAPS_SRCCOLOR", DestBlendCaps, D3DPBLENDCAPS_SRCCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_INVSRCCOLOR", DestBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_SRCALPHA", DestBlendCaps, D3DPBLENDCAPS_SRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_INVSRCALPHA", DestBlendCaps, D3DPBLENDCAPS_INVSRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_DESTALPHA", DestBlendCaps, D3DPBLENDCAPS_DESTALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_INVDESTALPHA", DestBlendCaps, D3DPBLENDCAPS_INVDESTALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_DESTCOLOR", DestBlendCaps, D3DPBLENDCAPS_DESTCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_INVDESTCOLOR", DestBlendCaps, D3DPBLENDCAPS_INVDESTCOLOR), - CAPSFLAGDEF("D3DPBLENDCAPS_SRCALPHASAT", DestBlendCaps, D3DPBLENDCAPS_SRCALPHASAT), - CAPSFLAGDEF("D3DPBLENDCAPS_BOTHSRCALPHA", DestBlendCaps, D3DPBLENDCAPS_BOTHSRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_BOTHINVSRCALPHA", DestBlendCaps, D3DPBLENDCAPS_BOTHINVSRCALPHA), - CAPSFLAGDEF("D3DPBLENDCAPS_BLENDFACTOR", DestBlendCaps, D3DPBLENDCAPS_BLENDFACTOR), - CAPSFLAGDEFex("D3DPBLENDCAPS_SRCCOLOR2", DestBlendCaps, D3DPBLENDCAPS_SRCCOLOR2), - CAPSFLAGDEFex("D3DPBLENDCAPS_INVSRCCOLOR2", DestBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR2), - {"",0,0} + CAPSFLAGDEF(L"D3DPBLENDCAPS_ZERO", DestBlendCaps, D3DPBLENDCAPS_ZERO), + CAPSFLAGDEF(L"D3DPBLENDCAPS_ONE", DestBlendCaps, D3DPBLENDCAPS_ONE), + CAPSFLAGDEF(L"D3DPBLENDCAPS_SRCCOLOR", DestBlendCaps, D3DPBLENDCAPS_SRCCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVSRCCOLOR", DestBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_SRCALPHA", DestBlendCaps, D3DPBLENDCAPS_SRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVSRCALPHA", DestBlendCaps, D3DPBLENDCAPS_INVSRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_DESTALPHA", DestBlendCaps, D3DPBLENDCAPS_DESTALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVDESTALPHA", DestBlendCaps, D3DPBLENDCAPS_INVDESTALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_DESTCOLOR", DestBlendCaps, D3DPBLENDCAPS_DESTCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_INVDESTCOLOR", DestBlendCaps, D3DPBLENDCAPS_INVDESTCOLOR), + CAPSFLAGDEF(L"D3DPBLENDCAPS_SRCALPHASAT", DestBlendCaps, D3DPBLENDCAPS_SRCALPHASAT), + CAPSFLAGDEF(L"D3DPBLENDCAPS_BOTHSRCALPHA", DestBlendCaps, D3DPBLENDCAPS_BOTHSRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_BOTHINVSRCALPHA", DestBlendCaps, D3DPBLENDCAPS_BOTHINVSRCALPHA), + CAPSFLAGDEF(L"D3DPBLENDCAPS_BLENDFACTOR", DestBlendCaps, D3DPBLENDCAPS_BLENDFACTOR), + CAPSFLAGDEFex(L"D3DPBLENDCAPS_SRCCOLOR2", DestBlendCaps, D3DPBLENDCAPS_SRCCOLOR2), + CAPSFLAGDEFex(L"D3DPBLENDCAPS_INVSRCCOLOR2", DestBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR2), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsAlphaCmpCaps[] = { - CAPSFLAGDEF("D3DPCMPCAPS_NEVER", AlphaCmpCaps, D3DPCMPCAPS_NEVER), - CAPSFLAGDEF("D3DPCMPCAPS_LESS", AlphaCmpCaps, D3DPCMPCAPS_LESS), - CAPSFLAGDEF("D3DPCMPCAPS_EQUAL", AlphaCmpCaps, D3DPCMPCAPS_EQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_LESSEQUAL", AlphaCmpCaps, D3DPCMPCAPS_LESSEQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_GREATER", AlphaCmpCaps, D3DPCMPCAPS_GREATER), - CAPSFLAGDEF("D3DPCMPCAPS_NOTEQUAL", AlphaCmpCaps, D3DPCMPCAPS_NOTEQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_GREATEREQUAL", AlphaCmpCaps, D3DPCMPCAPS_GREATEREQUAL), - CAPSFLAGDEF("D3DPCMPCAPS_ALWAYS", AlphaCmpCaps, D3DPCMPCAPS_ALWAYS), - {"",0,0} + CAPSFLAGDEF(L"D3DPCMPCAPS_NEVER", AlphaCmpCaps, D3DPCMPCAPS_NEVER), + CAPSFLAGDEF(L"D3DPCMPCAPS_LESS", AlphaCmpCaps, D3DPCMPCAPS_LESS), + CAPSFLAGDEF(L"D3DPCMPCAPS_EQUAL", AlphaCmpCaps, D3DPCMPCAPS_EQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_LESSEQUAL", AlphaCmpCaps, D3DPCMPCAPS_LESSEQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_GREATER", AlphaCmpCaps, D3DPCMPCAPS_GREATER), + CAPSFLAGDEF(L"D3DPCMPCAPS_NOTEQUAL", AlphaCmpCaps, D3DPCMPCAPS_NOTEQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_GREATEREQUAL", AlphaCmpCaps, D3DPCMPCAPS_GREATEREQUAL), + CAPSFLAGDEF(L"D3DPCMPCAPS_ALWAYS", AlphaCmpCaps, D3DPCMPCAPS_ALWAYS), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsShadeCaps[] = { - CAPSFLAGDEF("D3DPSHADECAPS_COLORGOURAUDRGB", ShadeCaps, D3DPSHADECAPS_COLORGOURAUDRGB), - CAPSFLAGDEF("D3DPSHADECAPS_SPECULARGOURAUDRGB", ShadeCaps, D3DPSHADECAPS_SPECULARGOURAUDRGB), - CAPSFLAGDEF("D3DPSHADECAPS_ALPHAGOURAUDBLEND", ShadeCaps, D3DPSHADECAPS_ALPHAGOURAUDBLEND), - CAPSFLAGDEF("D3DPSHADECAPS_FOGGOURAUD", ShadeCaps, D3DPSHADECAPS_FOGGOURAUD), - {"",0,0} + CAPSFLAGDEF(L"D3DPSHADECAPS_COLORGOURAUDRGB", ShadeCaps, D3DPSHADECAPS_COLORGOURAUDRGB), + CAPSFLAGDEF(L"D3DPSHADECAPS_SPECULARGOURAUDRGB", ShadeCaps, D3DPSHADECAPS_SPECULARGOURAUDRGB), + CAPSFLAGDEF(L"D3DPSHADECAPS_ALPHAGOURAUDBLEND", ShadeCaps, D3DPSHADECAPS_ALPHAGOURAUDBLEND), + CAPSFLAGDEF(L"D3DPSHADECAPS_FOGGOURAUD", ShadeCaps, D3DPSHADECAPS_FOGGOURAUD), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsTextureCaps[] = { - CAPSFLAGDEF("D3DPTEXTURECAPS_PERSPECTIVE", TextureCaps, D3DPTEXTURECAPS_PERSPECTIVE), - CAPSFLAGDEF("D3DPTEXTURECAPS_POW2", TextureCaps, D3DPTEXTURECAPS_POW2), - CAPSFLAGDEF("D3DPTEXTURECAPS_ALPHA", TextureCaps, D3DPTEXTURECAPS_ALPHA), - CAPSFLAGDEF("D3DPTEXTURECAPS_SQUAREONLY", TextureCaps, D3DPTEXTURECAPS_SQUAREONLY), - CAPSFLAGDEF("D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE", TextureCaps, D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE), - CAPSFLAGDEF("D3DPTEXTURECAPS_ALPHAPALETTE", TextureCaps, D3DPTEXTURECAPS_ALPHAPALETTE), - CAPSFLAGDEF("D3DPTEXTURECAPS_NONPOW2CONDITIONAL", TextureCaps, D3DPTEXTURECAPS_NONPOW2CONDITIONAL), - CAPSFLAGDEF("D3DPTEXTURECAPS_PROJECTED", TextureCaps, D3DPTEXTURECAPS_PROJECTED), - CAPSFLAGDEF("D3DPTEXTURECAPS_CUBEMAP", TextureCaps, D3DPTEXTURECAPS_CUBEMAP), - CAPSFLAGDEF("D3DPTEXTURECAPS_VOLUMEMAP", TextureCaps, D3DPTEXTURECAPS_VOLUMEMAP), - CAPSFLAGDEF("D3DPTEXTURECAPS_MIPMAP", TextureCaps, D3DPTEXTURECAPS_MIPMAP), - CAPSFLAGDEF("D3DPTEXTURECAPS_MIPVOLUMEMAP", TextureCaps, D3DPTEXTURECAPS_MIPVOLUMEMAP), - CAPSFLAGDEF("D3DPTEXTURECAPS_MIPCUBEMAP", TextureCaps, D3DPTEXTURECAPS_MIPCUBEMAP), - CAPSFLAGDEF("D3DPTEXTURECAPS_CUBEMAP_POW2", TextureCaps, D3DPTEXTURECAPS_CUBEMAP_POW2), - CAPSFLAGDEF("D3DPTEXTURECAPS_VOLUMEMAP_POW2", TextureCaps, D3DPTEXTURECAPS_VOLUMEMAP_POW2), - CAPSFLAGDEF("D3DPTEXTURECAPS_NOPROJECTEDBUMPENV", TextureCaps, D3DPTEXTURECAPS_NOPROJECTEDBUMPENV), - {"",0,0} + CAPSFLAGDEF(L"D3DPTEXTURECAPS_PERSPECTIVE", TextureCaps, D3DPTEXTURECAPS_PERSPECTIVE), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_POW2", TextureCaps, D3DPTEXTURECAPS_POW2), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_ALPHA", TextureCaps, D3DPTEXTURECAPS_ALPHA), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_SQUAREONLY", TextureCaps, D3DPTEXTURECAPS_SQUAREONLY), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE", TextureCaps, D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_ALPHAPALETTE", TextureCaps, D3DPTEXTURECAPS_ALPHAPALETTE), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_NONPOW2CONDITIONAL", TextureCaps, D3DPTEXTURECAPS_NONPOW2CONDITIONAL), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_PROJECTED", TextureCaps, D3DPTEXTURECAPS_PROJECTED), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_CUBEMAP", TextureCaps, D3DPTEXTURECAPS_CUBEMAP), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_VOLUMEMAP", TextureCaps, D3DPTEXTURECAPS_VOLUMEMAP), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_MIPMAP", TextureCaps, D3DPTEXTURECAPS_MIPMAP), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_MIPVOLUMEMAP", TextureCaps, D3DPTEXTURECAPS_MIPVOLUMEMAP), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_MIPCUBEMAP", TextureCaps, D3DPTEXTURECAPS_MIPCUBEMAP), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_CUBEMAP_POW2", TextureCaps, D3DPTEXTURECAPS_CUBEMAP_POW2), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_VOLUMEMAP_POW2", TextureCaps, D3DPTEXTURECAPS_VOLUMEMAP_POW2), + CAPSFLAGDEF(L"D3DPTEXTURECAPS_NOPROJECTEDBUMPENV", TextureCaps, D3DPTEXTURECAPS_NOPROJECTEDBUMPENV), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsTextureFilterCaps[] = { - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPOINT", TextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFLINEAR", TextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFANISOTROPIC", TextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFGAUSSIANQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFPOINT", TextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFLINEAR", TextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPOINT", TextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFLINEAR", TextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFANISOTROPIC", TextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), - CAPSFLAGDEFex("D3DPTFILTERCAPS_CONVOLUTIONMONO", TextureFilterCaps, D3DPTFILTERCAPS_CONVOLUTIONMONO), - {"",0,0} + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPOINT", TextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFLINEAR", TextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFANISOTROPIC", TextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFGAUSSIANQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFPOINT", TextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFLINEAR", TextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPOINT", TextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFLINEAR", TextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFANISOTROPIC", TextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", TextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), + CAPSFLAGDEFex(L"D3DPTFILTERCAPS_CONVOLUTIONMONO", TextureFilterCaps, D3DPTFILTERCAPS_CONVOLUTIONMONO), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsCubeTextureFilterCaps[] = { - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPOINT", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFLINEAR", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFANISOTROPIC", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFGAUSSIANQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFPOINT", CubeTextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFLINEAR", CubeTextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPOINT", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFLINEAR", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFANISOTROPIC", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), - {"",0,0} + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPOINT", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFLINEAR", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFANISOTROPIC", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFGAUSSIANQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFPOINT", CubeTextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFLINEAR", CubeTextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPOINT", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFLINEAR", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFANISOTROPIC", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", CubeTextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsVolumeTextureFilterCaps[] = { - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPOINT", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFLINEAR", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFANISOTROPIC", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFGAUSSIANQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFPOINT", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFLINEAR", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPOINT", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFLINEAR", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFANISOTROPIC", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), - {"",0,0} + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPOINT", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFLINEAR", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFANISOTROPIC", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFGAUSSIANQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFPOINT", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFLINEAR", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPOINT", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFLINEAR", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFANISOTROPIC", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", VolumeTextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsStretchRectFilterCaps[] = { - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPOINT", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFLINEAR", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFANISOTROPIC", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFGAUSSIANQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFPOINT", StretchRectFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFLINEAR", StretchRectFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPOINT", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFLINEAR", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFANISOTROPIC", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), - {"",0,0} + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPOINT", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFLINEAR", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFANISOTROPIC", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFGAUSSIANQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFPOINT", StretchRectFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFLINEAR", StretchRectFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPOINT", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFLINEAR", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFANISOTROPIC", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", StretchRectFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsTextureAddressCaps[] = { - CAPSFLAGDEF("D3DPTADDRESSCAPS_WRAP", TextureAddressCaps, D3DPTADDRESSCAPS_WRAP), - CAPSFLAGDEF("D3DPTADDRESSCAPS_MIRROR", TextureAddressCaps, D3DPTADDRESSCAPS_MIRROR), - CAPSFLAGDEF("D3DPTADDRESSCAPS_CLAMP", TextureAddressCaps, D3DPTADDRESSCAPS_CLAMP), - CAPSFLAGDEF("D3DPTADDRESSCAPS_BORDER", TextureAddressCaps, D3DPTADDRESSCAPS_BORDER), - CAPSFLAGDEF("D3DPTADDRESSCAPS_INDEPENDENTUV", TextureAddressCaps, D3DPTADDRESSCAPS_INDEPENDENTUV), - CAPSFLAGDEF("D3DPTADDRESSCAPS_MIRRORONCE", TextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE), - {"",0,0} + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_WRAP", TextureAddressCaps, D3DPTADDRESSCAPS_WRAP), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_MIRROR", TextureAddressCaps, D3DPTADDRESSCAPS_MIRROR), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_CLAMP", TextureAddressCaps, D3DPTADDRESSCAPS_CLAMP), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_BORDER", TextureAddressCaps, D3DPTADDRESSCAPS_BORDER), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_INDEPENDENTUV", TextureAddressCaps, D3DPTADDRESSCAPS_INDEPENDENTUV), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_MIRRORONCE", TextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsVolumeTextureAddressCaps[] = { - CAPSFLAGDEF("D3DPTADDRESSCAPS_WRAP", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_WRAP), - CAPSFLAGDEF("D3DPTADDRESSCAPS_MIRROR", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_MIRROR), - CAPSFLAGDEF("D3DPTADDRESSCAPS_CLAMP", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_CLAMP), - CAPSFLAGDEF("D3DPTADDRESSCAPS_BORDER", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_BORDER), - CAPSFLAGDEF("D3DPTADDRESSCAPS_INDEPENDENTUV", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_INDEPENDENTUV), - CAPSFLAGDEF("D3DPTADDRESSCAPS_MIRRORONCE", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE), - {"",0,0} + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_WRAP", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_WRAP), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_MIRROR", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_MIRROR), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_CLAMP", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_CLAMP), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_BORDER", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_BORDER), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_INDEPENDENTUV", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_INDEPENDENTUV), + CAPSFLAGDEF(L"D3DPTADDRESSCAPS_MIRRORONCE", VolumeTextureAddressCaps, D3DPTADDRESSCAPS_MIRRORONCE), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsDevCaps2[] = { - CAPSFLAGDEF("D3DDEVCAPS2_STREAMOFFSET", DevCaps2, D3DDEVCAPS2_STREAMOFFSET), - CAPSFLAGDEF("D3DDEVCAPS2_DMAPNPATCH", DevCaps2, D3DDEVCAPS2_DMAPNPATCH), - CAPSFLAGDEF("D3DDEVCAPS2_ADAPTIVETESSRTPATCH", DevCaps2, D3DDEVCAPS2_ADAPTIVETESSRTPATCH), - CAPSFLAGDEF("D3DDEVCAPS2_ADAPTIVETESSNPATCH", DevCaps2, D3DDEVCAPS2_ADAPTIVETESSNPATCH), - CAPSFLAGDEF("D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES", DevCaps2, D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES), - CAPSFLAGDEF("D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH", DevCaps2, D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH), - CAPSFLAGDEF("D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET", DevCaps2, D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET), - {"",0,0} + CAPSFLAGDEF(L"D3DDEVCAPS2_STREAMOFFSET", DevCaps2, D3DDEVCAPS2_STREAMOFFSET), + CAPSFLAGDEF(L"D3DDEVCAPS2_DMAPNPATCH", DevCaps2, D3DDEVCAPS2_DMAPNPATCH), + CAPSFLAGDEF(L"D3DDEVCAPS2_ADAPTIVETESSRTPATCH", DevCaps2, D3DDEVCAPS2_ADAPTIVETESSRTPATCH), + CAPSFLAGDEF(L"D3DDEVCAPS2_ADAPTIVETESSNPATCH", DevCaps2, D3DDEVCAPS2_ADAPTIVETESSNPATCH), + CAPSFLAGDEF(L"D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES", DevCaps2, D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES), + CAPSFLAGDEF(L"D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH", DevCaps2, D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH), + CAPSFLAGDEF(L"D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET", DevCaps2, D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsDeclTypes[] = { - CAPSFLAGDEF("D3DDTCAPS_UBYTE4", DeclTypes, D3DDTCAPS_UBYTE4), - CAPSFLAGDEF("D3DDTCAPS_UBYTE4N", DeclTypes, D3DDTCAPS_UBYTE4N), - CAPSFLAGDEF("D3DDTCAPS_SHORT2N", DeclTypes, D3DDTCAPS_SHORT2N), - CAPSFLAGDEF("D3DDTCAPS_SHORT4N", DeclTypes, D3DDTCAPS_SHORT4N), - CAPSFLAGDEF("D3DDTCAPS_USHORT2N", DeclTypes, D3DDTCAPS_USHORT2N), - CAPSFLAGDEF("D3DDTCAPS_USHORT4N", DeclTypes, D3DDTCAPS_USHORT4N), - CAPSFLAGDEF("D3DDTCAPS_UDEC3", DeclTypes, D3DDTCAPS_UDEC3), - CAPSFLAGDEF("D3DDTCAPS_DEC3N", DeclTypes, D3DDTCAPS_DEC3N), - CAPSFLAGDEF("D3DDTCAPS_FLOAT16_2", DeclTypes, D3DDTCAPS_FLOAT16_2), - CAPSFLAGDEF("D3DDTCAPS_FLOAT16_4", DeclTypes, D3DDTCAPS_FLOAT16_4), - {"",0,0} + CAPSFLAGDEF(L"D3DDTCAPS_UBYTE4", DeclTypes, D3DDTCAPS_UBYTE4), + CAPSFLAGDEF(L"D3DDTCAPS_UBYTE4N", DeclTypes, D3DDTCAPS_UBYTE4N), + CAPSFLAGDEF(L"D3DDTCAPS_SHORT2N", DeclTypes, D3DDTCAPS_SHORT2N), + CAPSFLAGDEF(L"D3DDTCAPS_SHORT4N", DeclTypes, D3DDTCAPS_SHORT4N), + CAPSFLAGDEF(L"D3DDTCAPS_USHORT2N", DeclTypes, D3DDTCAPS_USHORT2N), + CAPSFLAGDEF(L"D3DDTCAPS_USHORT4N", DeclTypes, D3DDTCAPS_USHORT4N), + CAPSFLAGDEF(L"D3DDTCAPS_UDEC3", DeclTypes, D3DDTCAPS_UDEC3), + CAPSFLAGDEF(L"D3DDTCAPS_DEC3N", DeclTypes, D3DDTCAPS_DEC3N), + CAPSFLAGDEF(L"D3DDTCAPS_FLOAT16_2", DeclTypes, D3DDTCAPS_FLOAT16_2), + CAPSFLAGDEF(L"D3DDTCAPS_FLOAT16_4", DeclTypes, D3DDTCAPS_FLOAT16_4), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsVS20Caps[] = { - CAPSFLAGDEF("D3DVS20CAPS_PREDICATION", VS20Caps.Caps, D3DVS20CAPS_PREDICATION), - CAPSVALDEF("DynamicFlowControlDepth", VS20Caps.DynamicFlowControlDepth), - CAPSVALDEF("NumTemps", VS20Caps.NumTemps), - CAPSVALDEF("StaticFlowControlDepth", VS20Caps.StaticFlowControlDepth), - {"",0,0} + CAPSFLAGDEF(L"D3DVS20CAPS_PREDICATION", VS20Caps.Caps, D3DVS20CAPS_PREDICATION), + CAPSVALDEF(L"DynamicFlowControlDepth", VS20Caps.DynamicFlowControlDepth), + CAPSVALDEF(L"NumTemps", VS20Caps.NumTemps), + CAPSVALDEF(L"StaticFlowControlDepth", VS20Caps.StaticFlowControlDepth), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsPS20Caps[] = { - CAPSFLAGDEF("D3DPS20CAPS_ARBITRARYSWIZZLE", PS20Caps.Caps, D3DPS20CAPS_ARBITRARYSWIZZLE), - CAPSFLAGDEF("D3DPS20CAPS_GRADIENTINSTRUCTIONS", PS20Caps.Caps, D3DPS20CAPS_GRADIENTINSTRUCTIONS), - CAPSFLAGDEF("D3DPS20CAPS_PREDICATION", PS20Caps.Caps, D3DPS20CAPS_PREDICATION), - CAPSFLAGDEF("D3DPS20CAPS_NODEPENDENTREADLIMIT", PS20Caps.Caps, D3DPS20CAPS_NODEPENDENTREADLIMIT), - CAPSFLAGDEF("D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT", PS20Caps.Caps, D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT), - CAPSVALDEF("DynamicFlowControlDepth", PS20Caps.DynamicFlowControlDepth), - CAPSVALDEF("NumTemps", PS20Caps.NumTemps), - CAPSVALDEF("StaticFlowControlDepth", PS20Caps.StaticFlowControlDepth), - CAPSVALDEF("NumInstructionSlots", PS20Caps.NumInstructionSlots), - {"",0,0} + CAPSFLAGDEF(L"D3DPS20CAPS_ARBITRARYSWIZZLE", PS20Caps.Caps, D3DPS20CAPS_ARBITRARYSWIZZLE), + CAPSFLAGDEF(L"D3DPS20CAPS_GRADIENTINSTRUCTIONS", PS20Caps.Caps, D3DPS20CAPS_GRADIENTINSTRUCTIONS), + CAPSFLAGDEF(L"D3DPS20CAPS_PREDICATION", PS20Caps.Caps, D3DPS20CAPS_PREDICATION), + CAPSFLAGDEF(L"D3DPS20CAPS_NODEPENDENTREADLIMIT", PS20Caps.Caps, D3DPS20CAPS_NODEPENDENTREADLIMIT), + CAPSFLAGDEF(L"D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT", PS20Caps.Caps, D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT), + CAPSVALDEF(L"DynamicFlowControlDepth", PS20Caps.DynamicFlowControlDepth), + CAPSVALDEF(L"NumTemps", PS20Caps.NumTemps), + CAPSVALDEF(L"StaticFlowControlDepth", PS20Caps.StaticFlowControlDepth), + CAPSVALDEF(L"NumInstructionSlots", PS20Caps.NumInstructionSlots), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEF CapsVertexTextureFilterCaps[] = { - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPOINT", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFLINEAR", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFANISOTROPIC", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MINFGAUSSIANQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFPOINT", VertexTextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MIPFLINEAR", VertexTextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPOINT", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFLINEAR", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFANISOTROPIC", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), - CAPSFLAGDEF("D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), - {"",0,0} + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPOINT", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFLINEAR", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFANISOTROPIC", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFPYRAMIDALQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MINFGAUSSIANQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MINFGAUSSIANQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFPOINT", VertexTextureFilterCaps, D3DPTFILTERCAPS_MIPFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MIPFLINEAR", VertexTextureFilterCaps, D3DPTFILTERCAPS_MIPFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPOINT", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFPOINT), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFLINEAR", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFLINEAR), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFANISOTROPIC", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFANISOTROPIC), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD), + CAPSFLAGDEF(L"D3DPTFILTERCAPS_MAGFGAUSSIANQUAD", VertexTextureFilterCaps, D3DPTFILTERCAPS_MAGFGAUSSIANQUAD), + {L"",0,0} }; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- CAPDEFS DXGCapDefs[] = { - {"", nullptr, (LPARAM)0, }, - {"+Caps", DXGDisplayCaps, (LPARAM)DXGGenCaps, }, - {"Caps", DXGDisplayCaps, (LPARAM)CapsCaps, }, - {"Caps2", DXGDisplayCaps, (LPARAM)CapsCaps2, }, - {"Caps3", DXGDisplayCaps, (LPARAM)CapsCaps3, }, - {"PresentationIntervals", DXGDisplayCaps, (LPARAM)CapsPresentationIntervals, }, - {"CursorCaps", DXGDisplayCaps, (LPARAM)CapsCursorCaps, }, - {"DevCaps", DXGDisplayCaps, (LPARAM)CapsDevCaps, }, - {"PrimitiveMiscCaps", DXGDisplayCaps, (LPARAM)CapsPrimMiscCaps }, - {"RasterCaps", DXGDisplayCaps, (LPARAM)CapsRasterCaps }, - {"ZCmpCaps", DXGDisplayCaps, (LPARAM)CapsZCmpCaps }, - {"SrcBlendCaps", DXGDisplayCaps, (LPARAM)CapsSrcBlendCaps }, - {"DestBlendCaps", DXGDisplayCaps, (LPARAM)CapsDestBlendCaps }, - {"AlphaCmpCaps", DXGDisplayCaps, (LPARAM)CapsAlphaCmpCaps }, - {"ShadeCaps", DXGDisplayCaps, (LPARAM)CapsShadeCaps }, - {"TextureCaps", DXGDisplayCaps, (LPARAM)CapsTextureCaps }, - - {"TextureFilterCaps", DXGDisplayCaps, (LPARAM)CapsTextureFilterCaps }, - {"CubeTextureFilterCaps", DXGDisplayCaps, (LPARAM)CapsCubeTextureFilterCaps }, - {"VolumeTextureFilterCaps", DXGDisplayCaps, (LPARAM)CapsVolumeTextureFilterCaps }, - {"TextureAddressCaps", DXGDisplayCaps, (LPARAM)CapsTextureAddressCaps }, - {"VolumeTextureAddressCaps", DXGDisplayCaps, (LPARAM)CapsVolumeTextureAddressCaps }, - - {"LineCaps", DXGDisplayCaps, (LPARAM)CapsLineCaps }, - {"StencilCaps", DXGDisplayCaps, (LPARAM)CapsStencilCaps, }, - {"FVFCaps", DXGDisplayCaps, (LPARAM)CapsFVFCaps, }, - {"TextureOpCaps", DXGDisplayCaps, (LPARAM)CapsTextureOpCaps, }, - {"VertexProcessingCaps", DXGDisplayCaps, (LPARAM)CapsVertexProcessingCaps, }, - {"DevCaps2", DXGDisplayCaps, (LPARAM)CapsDevCaps2, }, - {"DeclTypes", DXGDisplayCaps, (LPARAM)CapsDeclTypes, }, - {"StretchRectFilterCaps", DXGDisplayCaps, (LPARAM)CapsStretchRectFilterCaps, }, - {"VS20Caps", DXGDisplayCaps, (LPARAM)CapsVS20Caps, }, - {"PS20Caps", DXGDisplayCaps, (LPARAM)CapsPS20Caps, }, - {"VertexTextureFilterCaps",DXGDisplayCaps, (LPARAM)CapsVertexTextureFilterCaps, }, - - {"-", nullptr, (LPARAM)0, }, + {L"", nullptr, (LPARAM)0, }, + {L"+Caps", DXGDisplayCaps, (LPARAM)DXGGenCaps, }, + {L"Caps", DXGDisplayCaps, (LPARAM)CapsCaps, }, + {L"Caps2", DXGDisplayCaps, (LPARAM)CapsCaps2, }, + {L"Caps3", DXGDisplayCaps, (LPARAM)CapsCaps3, }, + {L"PresentationIntervals", DXGDisplayCaps, (LPARAM)CapsPresentationIntervals, }, + {L"CursorCaps", DXGDisplayCaps, (LPARAM)CapsCursorCaps, }, + {L"DevCaps", DXGDisplayCaps, (LPARAM)CapsDevCaps, }, + {L"PrimitiveMiscCaps", DXGDisplayCaps, (LPARAM)CapsPrimMiscCaps }, + {L"RasterCaps", DXGDisplayCaps, (LPARAM)CapsRasterCaps }, + {L"ZCmpCaps", DXGDisplayCaps, (LPARAM)CapsZCmpCaps }, + {L"SrcBlendCaps", DXGDisplayCaps, (LPARAM)CapsSrcBlendCaps }, + {L"DestBlendCaps", DXGDisplayCaps, (LPARAM)CapsDestBlendCaps }, + {L"AlphaCmpCaps", DXGDisplayCaps, (LPARAM)CapsAlphaCmpCaps }, + {L"ShadeCaps", DXGDisplayCaps, (LPARAM)CapsShadeCaps }, + {L"TextureCaps", DXGDisplayCaps, (LPARAM)CapsTextureCaps }, + + {L"TextureFilterCaps", DXGDisplayCaps, (LPARAM)CapsTextureFilterCaps }, + {L"CubeTextureFilterCaps", DXGDisplayCaps, (LPARAM)CapsCubeTextureFilterCaps }, + {L"VolumeTextureFilterCaps", DXGDisplayCaps, (LPARAM)CapsVolumeTextureFilterCaps }, + {L"TextureAddressCaps", DXGDisplayCaps, (LPARAM)CapsTextureAddressCaps }, + {L"VolumeTextureAddressCaps", DXGDisplayCaps, (LPARAM)CapsVolumeTextureAddressCaps }, + + {L"LineCaps", DXGDisplayCaps, (LPARAM)CapsLineCaps }, + {L"StencilCaps", DXGDisplayCaps, (LPARAM)CapsStencilCaps, }, + {L"FVFCaps", DXGDisplayCaps, (LPARAM)CapsFVFCaps, }, + {L"TextureOpCaps", DXGDisplayCaps, (LPARAM)CapsTextureOpCaps, }, + {L"VertexProcessingCaps", DXGDisplayCaps, (LPARAM)CapsVertexProcessingCaps, }, + {L"DevCaps2", DXGDisplayCaps, (LPARAM)CapsDevCaps2, }, + {L"DeclTypes", DXGDisplayCaps, (LPARAM)CapsDeclTypes, }, + {L"StretchRectFilterCaps", DXGDisplayCaps, (LPARAM)CapsStretchRectFilterCaps, }, + {L"VS20Caps", DXGDisplayCaps, (LPARAM)CapsVS20Caps, }, + {L"PS20Caps", DXGDisplayCaps, (LPARAM)CapsPS20Caps, }, + {L"VertexTextureFilterCaps",DXGDisplayCaps, (LPARAM)CapsVertexTextureFilterCaps, }, + + {L"-", nullptr, (LPARAM)0, }, { nullptr, 0, 0 } }; //----------------------------------------------------------------------------- - const TCHAR* FormatName(D3DFORMAT format) + const WCHAR* FormatName(D3DFORMAT format) { switch (format) { - case D3DFMT_UNKNOWN: return TEXT("D3DFMT_UNKNOWN"); - case D3DFMT_R8G8B8: return TEXT("D3DFMT_R8G8B8"); - case D3DFMT_A8R8G8B8: return TEXT("D3DFMT_A8R8G8B8"); - case D3DFMT_X8R8G8B8: return TEXT("D3DFMT_X8R8G8B8"); - case D3DFMT_R5G6B5: return TEXT("D3DFMT_R5G6B5"); - case D3DFMT_X1R5G5B5: return TEXT("D3DFMT_X1R5G5B5"); - case D3DFMT_A1R5G5B5: return TEXT("D3DFMT_A1R5G5B5"); - case D3DFMT_A4R4G4B4: return TEXT("D3DFMT_A4R4G4B4"); - case D3DFMT_R3G3B2: return TEXT("D3DFMT_R3G3B2"); - case D3DFMT_A8: return TEXT("D3DFMT_A8"); - case D3DFMT_A8R3G3B2: return TEXT("D3DFMT_A8R3G3B2"); - case D3DFMT_X4R4G4B4: return TEXT("D3DFMT_X4R4G4B4"); - case D3DFMT_A2B10G10R10: return TEXT("D3DFMT_A2B10G10R10"); - case D3DFMT_A8B8G8R8: return TEXT("D3DFMT_A8B8G8R8"); - case D3DFMT_X8B8G8R8: return TEXT("D3DFMT_X8B8G8R8"); - case D3DFMT_G16R16: return TEXT("D3DFMT_G16R16"); - case D3DFMT_A2R10G10B10: return TEXT("D3DFMT_A2R10G10B10"); - case D3DFMT_A16B16G16R16: return TEXT("D3DFMT_A16B16G16R16"); - - case D3DFMT_A8P8: return TEXT("D3DFMT_A8P8"); - case D3DFMT_P8: return TEXT("D3DFMT_P8"); - - case D3DFMT_L8: return TEXT("D3DFMT_L8"); - case D3DFMT_A8L8: return TEXT("D3DFMT_A8L8"); - case D3DFMT_A4L4: return TEXT("D3DFMT_A4L4"); - - case D3DFMT_V8U8: return TEXT("D3DFMT_V8U8"); - case D3DFMT_L6V5U5: return TEXT("D3DFMT_L6V5U5"); - case D3DFMT_X8L8V8U8: return TEXT("D3DFMT_X8L8V8U8"); - case D3DFMT_Q8W8V8U8: return TEXT("D3DFMT_Q8W8V8U8"); - case D3DFMT_V16U16: return TEXT("D3DFMT_V16U16"); - case D3DFMT_A2W10V10U10: return TEXT("D3DFMT_A2W10V10U10"); - - case D3DFMT_UYVY: return TEXT("D3DFMT_UYVY"); - case D3DFMT_R8G8_B8G8: return TEXT("D3DFMT_R8G8_B8G8"); - case D3DFMT_YUY2: return TEXT("D3DFMT_YUY2"); - case D3DFMT_G8R8_G8B8: return TEXT("D3DFMT_G8R8_G8B8"); - case D3DFMT_DXT1: return TEXT("D3DFMT_DXT1"); - case D3DFMT_DXT2: return TEXT("D3DFMT_DXT2"); - case D3DFMT_DXT3: return TEXT("D3DFMT_DXT3"); - case D3DFMT_DXT4: return TEXT("D3DFMT_DXT4"); - case D3DFMT_DXT5: return TEXT("D3DFMT_DXT5"); - - case D3DFMT_D16_LOCKABLE: return TEXT("D3DFMT_D16_LOCKABLE"); - case D3DFMT_D32: return TEXT("D3DFMT_D32"); - case D3DFMT_D15S1: return TEXT("D3DFMT_D15S1"); - case D3DFMT_D24S8: return TEXT("D3DFMT_D24S8"); - case D3DFMT_D24X8: return TEXT("D3DFMT_D24X8"); - case D3DFMT_D24X4S4: return TEXT("D3DFMT_D24X4S4"); - case D3DFMT_D16: return TEXT("D3DFMT_D16"); - case D3DFMT_D32F_LOCKABLE: return TEXT("D3DFMT_D32F_LOCKABLE"); - case D3DFMT_D24FS8: return TEXT("D3DFMT_D24FS8"); - - case D3DFMT_L16: return TEXT("D3DFMT_L16"); - - case D3DFMT_VERTEXDATA: return TEXT("D3DFMT_VERTEXDATA"); - case D3DFMT_INDEX16: return TEXT("D3DFMT_INDEX16"); - case D3DFMT_INDEX32: return TEXT("D3DFMT_INDEX32"); - - case D3DFMT_Q16W16V16U16: return TEXT("D3DFMT_Q16W16V16U16"); - - case D3DFMT_MULTI2_ARGB8: return TEXT("D3DFMT_MULTI2_ARGB8"); - - case D3DFMT_R16F: return TEXT("D3DFMT_R16F"); - case D3DFMT_G16R16F: return TEXT("D3DFMT_G16R16F"); - case D3DFMT_A16B16G16R16F: return TEXT("D3DFMT_A16B16G16R16F"); - - case D3DFMT_R32F: return TEXT("D3DFMT_R32F"); - case D3DFMT_G32R32F: return TEXT("D3DFMT_G32R32F"); - case D3DFMT_A32B32G32R32F: return TEXT("D3DFMT_A32B32G32R32F"); - - case D3DFMT_CxV8U8: return TEXT("D3DFMT_CxV8U8"); - - case D3DFMT_D32_LOCKABLE: return TEXT("D3DFMT_D32_LOCKABLE"); - case D3DFMT_S8_LOCKABLE: return TEXT("D3DFMT_S8_LOCKABLE"); - case D3DFMT_A1: return TEXT("D3DFMT_A1"); - - default: return TEXT("Unknown format"); + case D3DFMT_UNKNOWN: return L"D3DFMT_UNKNOWN"; + case D3DFMT_R8G8B8: return L"D3DFMT_R8G8B8"; + case D3DFMT_A8R8G8B8: return L"D3DFMT_A8R8G8B8"; + case D3DFMT_X8R8G8B8: return L"D3DFMT_X8R8G8B8"; + case D3DFMT_R5G6B5: return L"D3DFMT_R5G6B5"; + case D3DFMT_X1R5G5B5: return L"D3DFMT_X1R5G5B5"; + case D3DFMT_A1R5G5B5: return L"D3DFMT_A1R5G5B5"; + case D3DFMT_A4R4G4B4: return L"D3DFMT_A4R4G4B4"; + case D3DFMT_R3G3B2: return L"D3DFMT_R3G3B2"; + case D3DFMT_A8: return L"D3DFMT_A8"; + case D3DFMT_A8R3G3B2: return L"D3DFMT_A8R3G3B2"; + case D3DFMT_X4R4G4B4: return L"D3DFMT_X4R4G4B4"; + case D3DFMT_A2B10G10R10: return L"D3DFMT_A2B10G10R10"; + case D3DFMT_A8B8G8R8: return L"D3DFMT_A8B8G8R8"; + case D3DFMT_X8B8G8R8: return L"D3DFMT_X8B8G8R8"; + case D3DFMT_G16R16: return L"D3DFMT_G16R16"; + case D3DFMT_A2R10G10B10: return L"D3DFMT_A2R10G10B10"; + case D3DFMT_A16B16G16R16: return L"D3DFMT_A16B16G16R16"; + + case D3DFMT_A8P8: return L"D3DFMT_A8P8"; + case D3DFMT_P8: return L"D3DFMT_P8"; + + case D3DFMT_L8: return L"D3DFMT_L8"; + case D3DFMT_A8L8: return L"D3DFMT_A8L8"; + case D3DFMT_A4L4: return L"D3DFMT_A4L4"; + + case D3DFMT_V8U8: return L"D3DFMT_V8U8"; + case D3DFMT_L6V5U5: return L"D3DFMT_L6V5U5"; + case D3DFMT_X8L8V8U8: return L"D3DFMT_X8L8V8U8"; + case D3DFMT_Q8W8V8U8: return L"D3DFMT_Q8W8V8U8"; + case D3DFMT_V16U16: return L"D3DFMT_V16U16"; + case D3DFMT_A2W10V10U10: return L"D3DFMT_A2W10V10U10"; + + case D3DFMT_UYVY: return L"D3DFMT_UYVY"; + case D3DFMT_R8G8_B8G8: return L"D3DFMT_R8G8_B8G8"; + case D3DFMT_YUY2: return L"D3DFMT_YUY2"; + case D3DFMT_G8R8_G8B8: return L"D3DFMT_G8R8_G8B8"; + case D3DFMT_DXT1: return L"D3DFMT_DXT1"; + case D3DFMT_DXT2: return L"D3DFMT_DXT2"; + case D3DFMT_DXT3: return L"D3DFMT_DXT3"; + case D3DFMT_DXT4: return L"D3DFMT_DXT4"; + case D3DFMT_DXT5: return L"D3DFMT_DXT5"; + + case D3DFMT_D16_LOCKABLE: return L"D3DFMT_D16_LOCKABLE"; + case D3DFMT_D32: return L"D3DFMT_D32"; + case D3DFMT_D15S1: return L"D3DFMT_D15S1"; + case D3DFMT_D24S8: return L"D3DFMT_D24S8"; + case D3DFMT_D24X8: return L"D3DFMT_D24X8"; + case D3DFMT_D24X4S4: return L"D3DFMT_D24X4S4"; + case D3DFMT_D16: return L"D3DFMT_D16"; + case D3DFMT_D32F_LOCKABLE: return L"D3DFMT_D32F_LOCKABLE"; + case D3DFMT_D24FS8: return L"D3DFMT_D24FS8"; + + case D3DFMT_L16: return L"D3DFMT_L16"; + + case D3DFMT_VERTEXDATA: return L"D3DFMT_VERTEXDATA"; + case D3DFMT_INDEX16: return L"D3DFMT_INDEX16"; + case D3DFMT_INDEX32: return L"D3DFMT_INDEX32"; + + case D3DFMT_Q16W16V16U16: return L"D3DFMT_Q16W16V16U16"; + + case D3DFMT_MULTI2_ARGB8: return L"D3DFMT_MULTI2_ARGB8"; + + case D3DFMT_R16F: return L"D3DFMT_R16F"; + case D3DFMT_G16R16F: return L"D3DFMT_G16R16F"; + case D3DFMT_A16B16G16R16F: return L"D3DFMT_A16B16G16R16F"; + + case D3DFMT_R32F: return L"D3DFMT_R32F"; + case D3DFMT_G32R32F: return L"D3DFMT_G32R32F"; + case D3DFMT_A32B32G32R32F: return L"D3DFMT_A32B32G32R32F"; + + case D3DFMT_CxV8U8: return L"D3DFMT_CxV8U8"; + + case D3DFMT_D32_LOCKABLE: return L"D3DFMT_D32_LOCKABLE"; + case D3DFMT_S8_LOCKABLE: return L"D3DFMT_S8_LOCKABLE"; + case D3DFMT_A1: return L"D3DFMT_A1"; + + default: return L"Unknown format"; } } //----------------------------------------------------------------------------- - const TCHAR* MultiSampleTypeName(D3DMULTISAMPLE_TYPE msType) + const WCHAR* MultiSampleTypeName(D3DMULTISAMPLE_TYPE msType) { switch (msType) { - case D3DMULTISAMPLE_NONE: return TEXT("D3DMULTISAMPLE_NONE"); - case D3DMULTISAMPLE_NONMASKABLE: return TEXT("D3DMULTISAMPLE_NONMASKABLE"); - case D3DMULTISAMPLE_2_SAMPLES: return TEXT("D3DMULTISAMPLE_2_SAMPLES"); - case D3DMULTISAMPLE_3_SAMPLES: return TEXT("D3DMULTISAMPLE_3_SAMPLES"); - case D3DMULTISAMPLE_4_SAMPLES: return TEXT("D3DMULTISAMPLE_4_SAMPLES"); - case D3DMULTISAMPLE_5_SAMPLES: return TEXT("D3DMULTISAMPLE_5_SAMPLES"); - case D3DMULTISAMPLE_6_SAMPLES: return TEXT("D3DMULTISAMPLE_6_SAMPLES"); - case D3DMULTISAMPLE_7_SAMPLES: return TEXT("D3DMULTISAMPLE_7_SAMPLES"); - case D3DMULTISAMPLE_8_SAMPLES: return TEXT("D3DMULTISAMPLE_8_SAMPLES"); - case D3DMULTISAMPLE_9_SAMPLES: return TEXT("D3DMULTISAMPLE_9_SAMPLES"); - case D3DMULTISAMPLE_10_SAMPLES: return TEXT("D3DMULTISAMPLE_10_SAMPLES"); - case D3DMULTISAMPLE_11_SAMPLES: return TEXT("D3DMULTISAMPLE_11_SAMPLES"); - case D3DMULTISAMPLE_12_SAMPLES: return TEXT("D3DMULTISAMPLE_12_SAMPLES"); - case D3DMULTISAMPLE_13_SAMPLES: return TEXT("D3DMULTISAMPLE_13_SAMPLES"); - case D3DMULTISAMPLE_14_SAMPLES: return TEXT("D3DMULTISAMPLE_14_SAMPLES"); - case D3DMULTISAMPLE_15_SAMPLES: return TEXT("D3DMULTISAMPLE_15_SAMPLES"); - case D3DMULTISAMPLE_16_SAMPLES: return TEXT("D3DMULTISAMPLE_16_SAMPLES"); - default: return TEXT("Unknown type"); + case D3DMULTISAMPLE_NONE: return L"D3DMULTISAMPLE_NONE"; + case D3DMULTISAMPLE_NONMASKABLE: return L"D3DMULTISAMPLE_NONMASKABLE"; + case D3DMULTISAMPLE_2_SAMPLES: return L"D3DMULTISAMPLE_2_SAMPLES"; + case D3DMULTISAMPLE_3_SAMPLES: return L"D3DMULTISAMPLE_3_SAMPLES"; + case D3DMULTISAMPLE_4_SAMPLES: return L"D3DMULTISAMPLE_4_SAMPLES"; + case D3DMULTISAMPLE_5_SAMPLES: return L"D3DMULTISAMPLE_5_SAMPLES"; + case D3DMULTISAMPLE_6_SAMPLES: return L"D3DMULTISAMPLE_6_SAMPLES"; + case D3DMULTISAMPLE_7_SAMPLES: return L"D3DMULTISAMPLE_7_SAMPLES"; + case D3DMULTISAMPLE_8_SAMPLES: return L"D3DMULTISAMPLE_8_SAMPLES"; + case D3DMULTISAMPLE_9_SAMPLES: return L"D3DMULTISAMPLE_9_SAMPLES"; + case D3DMULTISAMPLE_10_SAMPLES: return L"D3DMULTISAMPLE_10_SAMPLES"; + case D3DMULTISAMPLE_11_SAMPLES: return L"D3DMULTISAMPLE_11_SAMPLES"; + case D3DMULTISAMPLE_12_SAMPLES: return L"D3DMULTISAMPLE_12_SAMPLES"; + case D3DMULTISAMPLE_13_SAMPLES: return L"D3DMULTISAMPLE_13_SAMPLES"; + case D3DMULTISAMPLE_14_SAMPLES: return L"D3DMULTISAMPLE_14_SAMPLES"; + case D3DMULTISAMPLE_15_SAMPLES: return L"D3DMULTISAMPLE_15_SAMPLES"; + case D3DMULTISAMPLE_16_SAMPLES: return L"D3DMULTISAMPLE_16_SAMPLES"; + default: return L"Unknown type"; } } @@ -912,8 +912,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", 15); - LVAddColumn(g_hwndLV, 1, "Value", 40); + LVAddColumn(g_hwndLV, 0, L"Name", 15); + LVAddColumn(g_hwndLV, 1, L"Value", 40); } D3DADAPTER_IDENTIFIER9 identifier; @@ -922,58 +922,64 @@ namespace return hr; GUID guid = identifier.DeviceIdentifier; - TCHAR szGuid[50]; - sprintf_s(szGuid, sizeof(szGuid), TEXT("{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"), + WCHAR szGuid[50]; + swprintf_s(szGuid, 50, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); - TCHAR szVersion[50]; - sprintf_s(szVersion, sizeof(szVersion), TEXT("0x%08X-%08X"), identifier.DriverVersion.HighPart, + WCHAR szVersion[50]; + swprintf_s(szVersion, 50, L"0x%08X-%08X", identifier.DriverVersion.HighPart, identifier.DriverVersion.LowPart); + WideString wideDriver(identifier.Driver); + WideString wideDescription(identifier.Description); + WideString wideDeviceName(identifier.DeviceName); + if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "Driver"); - LVAddText(g_hwndLV, 1, "%s", identifier.Driver); - LVAddText(g_hwndLV, 0, "Description"); - LVAddText(g_hwndLV, 1, "%s", identifier.Description); - LVAddText(g_hwndLV, 0, "DeviceName"); - LVAddText(g_hwndLV, 1, "%s", identifier.DeviceName); + LVAddText(g_hwndLV, 0, L"Driver"); + LVAddText(g_hwndLV, 1, L"%s", wideDriver.c_str()); + + LVAddText(g_hwndLV, 0, L"Description"); + LVAddText(g_hwndLV, 1, L"%s", wideDescription.c_str()); + + LVAddText(g_hwndLV, 0, L"DeviceName"); + LVAddText(g_hwndLV, 1, L"%s", wideDeviceName.c_str()); - LVAddText(g_hwndLV, 0, "DriverVersion"); - LVAddText(g_hwndLV, 1, "%s", szVersion); + LVAddText(g_hwndLV, 0, L"DriverVersion"); + LVAddText(g_hwndLV, 1, L"%s", szVersion); - LVAddText(g_hwndLV, 0, "VendorId"); - LVAddText(g_hwndLV, 1, "0x%08x", identifier.VendorId); + LVAddText(g_hwndLV, 0, L"VendorId"); + LVAddText(g_hwndLV, 1, L"0x%08x", identifier.VendorId); - LVAddText(g_hwndLV, 0, "DeviceId"); - LVAddText(g_hwndLV, 1, "0x%08x", identifier.DeviceId); + LVAddText(g_hwndLV, 0, L"DeviceId"); + LVAddText(g_hwndLV, 1, L"0x%08x", identifier.DeviceId); - LVAddText(g_hwndLV, 0, "SubSysId"); - LVAddText(g_hwndLV, 1, "0x%08x", identifier.SubSysId); + LVAddText(g_hwndLV, 0, L"SubSysId"); + LVAddText(g_hwndLV, 1, L"0x%08x", identifier.SubSysId); - LVAddText(g_hwndLV, 0, "Revision"); - LVAddText(g_hwndLV, 1, "%d", identifier.Revision); + LVAddText(g_hwndLV, 0, L"Revision"); + LVAddText(g_hwndLV, 1, L"%d", identifier.Revision); - LVAddText(g_hwndLV, 0, "DeviceIdentifier"); + LVAddText(g_hwndLV, 0, L"DeviceIdentifier"); LVAddText(g_hwndLV, 1, szGuid); - LVAddText(g_hwndLV, 0, "WHQLLevel"); - LVAddText(g_hwndLV, 1, "%d", identifier.WHQLLevel); + LVAddText(g_hwndLV, 0, L"WHQLLevel"); + LVAddText(g_hwndLV, 1, L"%d", identifier.WHQLLevel); } else { - PrintStringValueLine("Driver", identifier.Driver, pPrintInfo); - PrintStringValueLine("Description", identifier.Description, pPrintInfo); - PrintStringValueLine("DriverVersion", szVersion, pPrintInfo); - PrintHexValueLine("VendorId", identifier.VendorId, pPrintInfo); - PrintHexValueLine("DeviceId", identifier.DeviceId, pPrintInfo); - PrintHexValueLine("SubSysId", identifier.SubSysId, pPrintInfo); - PrintValueLine("Revision", identifier.Revision, pPrintInfo); - PrintStringValueLine("DeviceIdentifier", szGuid, pPrintInfo); - PrintValueLine("WHQLLevel", identifier.WHQLLevel, pPrintInfo); + PrintStringValueLine(L"Driver", wideDriver.c_str(), pPrintInfo); + PrintStringValueLine(L"Description", wideDescription.c_str(), pPrintInfo); + PrintStringValueLine(L"DriverVersion", szVersion, pPrintInfo); + PrintHexValueLine(L"VendorId", identifier.VendorId, pPrintInfo); + PrintHexValueLine(L"DeviceId", identifier.DeviceId, pPrintInfo); + PrintHexValueLine(L"SubSysId", identifier.SubSysId, pPrintInfo); + PrintValueLine(L"Revision", identifier.Revision, pPrintInfo); + PrintStringValueLine(L"DeviceIdentifier", szGuid, pPrintInfo); + PrintValueLine(L"WHQLLevel", identifier.WHQLLevel, pPrintInfo); } return S_OK; } @@ -988,9 +994,9 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Resolution", 10); - LVAddColumn(g_hwndLV, 1, "Pixel Format", 15); - LVAddColumn(g_hwndLV, 2, "Refresh Rate", 10); + LVAddColumn(g_hwndLV, 0, L"Resolution", 10); + LVAddColumn(g_hwndLV, 1, L"Pixel Format", 15); + LVAddColumn(g_hwndLV, 2, L"Refresh Rate", 10); } for (INT iFormat = 0; iFormat < NumAdapterFormats; iFormat++) @@ -1003,13 +1009,13 @@ namespace g_pD3D->EnumAdapterModes(iAdapter, fmt, iMode, &mode); if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "%d x %d", mode.Width, mode.Height); + LVAddText(g_hwndLV, 0, L"%d x %d", mode.Width, mode.Height); LVAddText(g_hwndLV, 1, FormatName(mode.Format)); - LVAddText(g_hwndLV, 2, "%d", mode.RefreshRate); + LVAddText(g_hwndLV, 2, L"%d", mode.RefreshRate); } else { - char szBuff[80]; + WCHAR szBuff[80]; DWORD cchLen; int x1, x2, x3, yLine; @@ -1019,18 +1025,18 @@ namespace x3 = x2 + (20 * pPrintInfo->dwCharWidth); yLine = (pPrintInfo->dwCurrLine * pPrintInfo->dwLineHeight); - sprintf_s(szBuff, sizeof(szBuff), "%u x %u", mode.Width, mode.Height); - cchLen = static_cast(_tcslen(szBuff)); + swprintf_s(szBuff, 80, L"%u x %u", mode.Width, mode.Height); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(x1, yLine, szBuff, cchLen, pPrintInfo))) return E_FAIL; - strcpy_s(szBuff, sizeof(szBuff), FormatName(mode.Format)); - cchLen = static_cast(_tcslen(szBuff)); + wcscpy_s(szBuff, 80, FormatName(mode.Format)); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(x2, yLine, szBuff, cchLen, pPrintInfo))) return E_FAIL; - sprintf_s(szBuff, sizeof(szBuff), "%u", mode.RefreshRate); - cchLen = static_cast(_tcslen(szBuff)); + swprintf_s(szBuff, 80, L"%u", mode.RefreshRate); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(x3, yLine, szBuff, cchLen, pPrintInfo))) return E_FAIL; @@ -1075,17 +1081,17 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Quality Levels", 30); + LVAddColumn(g_hwndLV, 0, L"Quality Levels", 30); } DWORD dwNumQualityLevels; if (SUCCEEDED(g_pD3D->CheckDeviceMultiSampleType(iAdapter, devType, fmt, bWindowed, msType, &dwNumQualityLevels))) { - TCHAR str[100]; + WCHAR str[100]; if (dwNumQualityLevels == 1) - sprintf_s(str, sizeof(str), "%u quality level", dwNumQualityLevels); + swprintf_s(str, 100, L"%u quality level", dwNumQualityLevels); else - sprintf_s(str, sizeof(str), "%u quality levels", dwNumQualityLevels); + swprintf_s(str, 100, L"%u quality levels", dwNumQualityLevels); if (!pPrintInfo) { LVAddText(g_hwndLV, 0, str); @@ -1113,7 +1119,7 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Back Buffer Formats", 20); + LVAddColumn(g_hwndLV, 0, L"Back Buffer Formats", 20); } for (int iFmt = 0; iFmt < NumBBFormats; iFmt++) @@ -1123,7 +1129,7 @@ namespace { if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "%s", FormatName(fmt)); + LVAddText(g_hwndLV, 0, L"%s", FormatName(fmt)); } else { @@ -1149,7 +1155,7 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Render Target Formats", 20); + LVAddColumn(g_hwndLV, 0, L"Render Target Formats", 20); } for (int iFmt = 0; iFmt < NumFormats; iFmt++) @@ -1160,7 +1166,7 @@ namespace { if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "%s", FormatName(fmt)); + LVAddText(g_hwndLV, 0, L"%s", FormatName(fmt)); } else { @@ -1186,7 +1192,7 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Depth/Stencil Formats", 20); + LVAddColumn(g_hwndLV, 0, L"Depth/Stencil Formats", 20); } for (int iFmt = 0; iFmt < NumDSFormats; iFmt++) @@ -1201,7 +1207,7 @@ namespace { if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "%s", FormatName(fmt)); + LVAddText(g_hwndLV, 0, L"%s", FormatName(fmt)); } else { @@ -1228,17 +1234,17 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Quality Levels", 20); + LVAddColumn(g_hwndLV, 0, L"Quality Levels", 20); } DWORD dwNumQualityLevels; if (SUCCEEDED(g_pD3D->CheckDeviceMultiSampleType(iAdapter, devType, fmtDS, FALSE, msType, &dwNumQualityLevels))) { - TCHAR str[100]; + WCHAR str[100]; if (dwNumQualityLevels == 1) - sprintf_s(str, sizeof(str), "%u quality level", dwNumQualityLevels); + swprintf_s(str, 100, L"%u quality level", dwNumQualityLevels); else - sprintf_s(str, sizeof(str), "%u quality levels", dwNumQualityLevels); + swprintf_s(str, 100, L"%u quality levels", dwNumQualityLevels); if (!pPrintInfo) { LVAddText(g_hwndLV, 0, str); @@ -1266,7 +1272,7 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Plain Surface Formats", 20); + LVAddColumn(g_hwndLV, 0, L"Plain Surface Formats", 20); } for (int iFmt = 0; iFmt < NumFormats; iFmt++) @@ -1281,7 +1287,7 @@ namespace { if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "%s", FormatName(fmt)); + LVAddText(g_hwndLV, 0, L"%s", FormatName(fmt)); } else { @@ -1305,7 +1311,7 @@ namespace auto devType = static_cast(HIWORD(lParam1)); auto fmtAdapter = static_cast(lParam2); auto RType = static_cast(lParam3); - const TCHAR* pstr; + const WCHAR* pstr; HRESULT hr; UINT col = 0; @@ -1317,44 +1323,44 @@ namespace switch (RType) { case D3DRTYPE_SURFACE: - LVAddColumn(g_hwndLV, col++, "Surface Formats", 20); + LVAddColumn(g_hwndLV, col++, L"Surface Formats", 20); break; case D3DRTYPE_VOLUME: - LVAddColumn(g_hwndLV, col++, "Volume Formats", 20); + LVAddColumn(g_hwndLV, col++, L"Volume Formats", 20); break; case D3DRTYPE_TEXTURE: - LVAddColumn(g_hwndLV, col++, "Texture Formats", 20); + LVAddColumn(g_hwndLV, col++, L"Texture Formats", 20); break; case D3DRTYPE_VOLUMETEXTURE: - LVAddColumn(g_hwndLV, col++, "Volume Texture Formats", 20); + LVAddColumn(g_hwndLV, col++, L"Volume Texture Formats", 20); break; case D3DRTYPE_CUBETEXTURE: - LVAddColumn(g_hwndLV, col++, "Cube Texture Formats", 20); + LVAddColumn(g_hwndLV, col++, L"Cube Texture Formats", 20); break; default: return E_FAIL; } - LVAddColumn(g_hwndLV, col++, "0 (Plain)", 22); + LVAddColumn(g_hwndLV, col++, L"0 (Plain)", 22); if (RType != D3DRTYPE_VOLUMETEXTURE) - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_RENDERTARGET", 22); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_RENDERTARGET", 22); // LVAddColumn(g_hwndLV, col++, "D3DUSAGE_DEPTHSTENCIL", 22); if (RType != D3DRTYPE_SURFACE) { if (RType != D3DRTYPE_VOLUMETEXTURE) { - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_AUTOGENMIPMAP", 22); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_AUTOGENMIPMAP", 22); if (RType != D3DRTYPE_CUBETEXTURE) { - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_DMAP", 22); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_DMAP", 22); } } - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_QUERY_LEGACYBUMPMAP", 22); - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_QUERY_SRGBREAD", 18); - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_QUERY_FILTER", 15); - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_QUERY_SRGBWRITE", 18); - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING", 18); - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_QUERY_VERTEXTEXTURE", 18); - LVAddColumn(g_hwndLV, col++, "D3DUSAGE_QUERY_WRAPANDMIP", 18); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_QUERY_LEGACYBUMPMAP", 22); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_QUERY_SRGBREAD", 18); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_QUERY_FILTER", 15); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_QUERY_SRGBWRITE", 18); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING", 18); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_QUERY_VERTEXTEXTURE", 18); + LVAddColumn(g_hwndLV, col++, L"D3DUSAGE_QUERY_WRAPANDMIP", 18); } } const DWORD usageArray[] = @@ -1435,7 +1441,7 @@ namespace col = 0; // Add list item for this format if (!pPrintInfo) - LVAddText(g_hwndLV, col++, "%s", FormatName(fmt)); + LVAddText(g_hwndLV, col++, L"%s", FormatName(fmt)); else PrintStringLine(FormatName(fmt), pPrintInfo); @@ -1487,11 +1493,11 @@ namespace usageArray[iUsage], RType, fmt); } if (hr == D3DOK_NOAUTOGEN) - pstr = TEXT("No"); + pstr = L"No"; else if (SUCCEEDED(hr)) - pstr = TEXT("Yes"); + pstr = L"Yes"; else - pstr = TEXT("No"); + pstr = L"No"; if (!pPrintInfo) LVAddText(g_hwndLV, col++, pstr); else @@ -1557,7 +1563,7 @@ VOID DXG_Init() { g_is9Ex = FALSE; - g_hInstD3D = LoadLibraryEx("d3d9.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); + g_hInstD3D = LoadLibraryEx(L"d3d9.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_hInstD3D) { g_direct3DCreate9 = reinterpret_cast(GetProcAddress(g_hInstD3D, "Direct3DCreate9")); @@ -1586,13 +1592,13 @@ VOID DXG_FillTree(HWND hwndTV) D3DCAPS9 caps; D3DCAPS9* pCapsCopy; - static const TCHAR* deviceNameArray[] = { "HAL", "Software", "Reference" }; + static const WCHAR* deviceNameArray[] = { L"HAL", L"Software", L"Reference" }; static const UINT numDeviceTypes = sizeof(deviceTypeArray) / sizeof(deviceTypeArray[0]); if (!g_pD3D) return; - HTREEITEM hTree = TVAddNode(TVI_ROOT, "Direct3D9 Devices", TRUE, IDI_DIRECTX, + HTREEITEM hTree = TVAddNode(TVI_ROOT, L"Direct3D9 Devices", TRUE, IDI_DIRECTX, nullptr, 0, 0); UINT numAdapters = g_pD3D->GetAdapterCount(); @@ -1601,11 +1607,12 @@ VOID DXG_FillTree(HWND hwndTV) D3DADAPTER_IDENTIFIER9 identifier; if (SUCCEEDED(g_pD3D->GetAdapterIdentifier(iAdapter, 0, &identifier))) { - HTREEITEM hTree2 = TVAddNode(hTree, identifier.Description, TRUE, IDI_CAPS, + WideString wideDescription(identifier.Description); + HTREEITEM hTree2 = TVAddNode(hTree, wideDescription.c_str(), TRUE, IDI_CAPS, DXGDisplayAdapterInfo, iAdapter, 0); - (void)TVAddNode(hTree2, "Display Modes", FALSE, IDI_CAPS, + (void)TVAddNode(hTree2, L"Display Modes", FALSE, IDI_CAPS, DXGDisplayModes, iAdapter, 0); - HTREEITEM hTree3 = TVAddNode(hTree2, "D3D Device Types", TRUE, IDI_CAPS, + HTREEITEM hTree3 = TVAddNode(hTree2, L"D3D Device Types", TRUE, IDI_CAPS, nullptr, 0, 0); for (iDevice = 0; iDevice < numDeviceTypes; iDevice++) @@ -1630,7 +1637,7 @@ VOID DXG_FillTree(HWND hwndTV) AddCapsToTV(hTree4, DXGCapDefs, (LPARAM)pCapsCopy); // List adapter formats for each device - HTREEITEM hTree5 = TVAddNode(hTree4, "Adapter Formats", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTree5 = TVAddNode(hTree4, L"Adapter Formats", TRUE, IDI_CAPS, nullptr, 0, 0); D3DFORMAT fmtAdapter; for (int iFmtAdapter = 0; iFmtAdapter < NumAdapterFormats; iFmtAdapter++) { @@ -1640,17 +1647,17 @@ VOID DXG_FillTree(HWND hwndTV) if (!IsAdapterFmtAvailable(iAdapter, devType, fmtAdapter, bWindowed)) continue; - TCHAR sz[100]; - sprintf_s(sz, sizeof(sz), "%s %s", FormatName(fmtAdapter), bWindowed ? "(Windowed)" : "(Fullscreen)"); + WCHAR sz[100]; + swprintf_s(sz, 100, L"%s %s", FormatName(fmtAdapter), bWindowed ? L"(Windowed)" : L"(Fullscreen)"); HTREEITEM hTree6 = TVAddNode(hTree5, sz, TRUE, IDI_CAPS, nullptr, 0, 0); - TVAddNodeEx(hTree6, "Back Buffer Formats", FALSE, IDI_CAPS, DXGDisplayBackBuffer, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)bWindowed); - TVAddNodeEx(hTree6, "Render Target Formats", FALSE, IDI_CAPS, DXGDisplayRenderTarget, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)0); - TVAddNodeEx(hTree6, "Depth/Stencil Formats", FALSE, IDI_CAPS, DXGDisplayDepthStencil, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)0); - TVAddNodeEx(hTree6, "Plain Surface Formats", FALSE, IDI_CAPS, DXGDisplayPlainSurface, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)0); - TVAddNodeEx(hTree6, "Texture Formats", FALSE, IDI_CAPS, DXGDisplayResource, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)D3DRTYPE_TEXTURE); - TVAddNodeEx(hTree6, "Cube Texture Formats", FALSE, IDI_CAPS, DXGDisplayResource, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)D3DRTYPE_CUBETEXTURE); - TVAddNodeEx(hTree6, "Volume Texture Formats", FALSE, IDI_CAPS, DXGDisplayResource, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)D3DRTYPE_VOLUMETEXTURE); - HTREEITEM hTree7 = TVAddNode(hTree6, "Render Format Compatibility", TRUE, IDI_CAPS, nullptr, 0, 0); + TVAddNodeEx(hTree6, L"Back Buffer Formats", FALSE, IDI_CAPS, DXGDisplayBackBuffer, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)bWindowed); + TVAddNodeEx(hTree6, L"Render Target Formats", FALSE, IDI_CAPS, DXGDisplayRenderTarget, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)0); + TVAddNodeEx(hTree6, L"Depth/Stencil Formats", FALSE, IDI_CAPS, DXGDisplayDepthStencil, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)0); + TVAddNodeEx(hTree6, L"Plain Surface Formats", FALSE, IDI_CAPS, DXGDisplayPlainSurface, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)0); + TVAddNodeEx(hTree6, L"Texture Formats", FALSE, IDI_CAPS, DXGDisplayResource, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)D3DRTYPE_TEXTURE); + TVAddNodeEx(hTree6, L"Cube Texture Formats", FALSE, IDI_CAPS, DXGDisplayResource, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)D3DRTYPE_CUBETEXTURE); + TVAddNodeEx(hTree6, L"Volume Texture Formats", FALSE, IDI_CAPS, DXGDisplayResource, MAKELPARAM(iAdapter, (UINT)devType), (LPARAM)fmtAdapter, (LPARAM)D3DRTYPE_VOLUMETEXTURE); + HTREEITEM hTree7 = TVAddNode(hTree6, L"Render Format Compatibility", TRUE, IDI_CAPS, nullptr, 0, 0); D3DFORMAT fmtRender; for (int iFmtRender = 0; iFmtRender < NumFormats; iFmtRender++) { @@ -1664,7 +1671,7 @@ VOID DXG_FillTree(HWND hwndTV) if (SUCCEEDED(g_pD3D->CheckDeviceMultiSampleType(iAdapter, devType, fmtRender, bWindowed, msType, nullptr))) { HTREEITEM hTree9 = TVAddNodeEx(hTree8, MultiSampleTypeName(msType), TRUE, IDI_CAPS, DXGDisplayMultiSample, MAKELPARAM(iAdapter, (UINT)devType), MAKELPARAM(bWindowed, (UINT)msType), (LPARAM)fmtRender); - HTREEITEM hTree10 = TVAddNode(hTree9, "Compatible Depth/Stencil Formats", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTree10 = TVAddNode(hTree9, L"Compatible Depth/Stencil Formats", TRUE, IDI_CAPS, nullptr, 0, 0); D3DFORMAT DSFmt; for (int iFmt = 0; iFmt < NumDSFormats; iFmt++) { diff --git a/dxgi.cpp b/dxgi.cpp index 4eeb246..75f3b0b 100644 --- a/dxgi.cpp +++ b/dxgi.cpp @@ -75,33 +75,35 @@ enum FLMASK : uint32_t //----------------------------------------------------------------------------- namespace { - const char D3D10_NOTE[] = "Most Direct3D 10 features are required. Tool only shows optional features."; - const char D3D10_NOTE1[] = "Most Direct3D 10.1 features are required. Tool only shows optional features."; - const char D3D11_NOTE[] = "Most Direct3D 11 features are required. Tool only shows optional features."; - const char D3D11_NOTE1[] = "Most Direct3D 11.1 features are required. Tool only shows optional features."; - const char D3D11_NOTE2[] = "Most Direct3D 11.2 features are required. Tool only shows optional features."; - const char D3D11_NOTE3[] = "Most Direct3D 11.3 features are required. Tool only shows optional features."; - const char D3D11_NOTE4[] = "Most Direct3D 11.x features are required. Tool only shows optional features."; - const char _10L9_NOTE[] = "Most 10level9 features are required. Tool only shows optional features."; - const char SEE_D3D10[] = "See Direct3D 10 node for device details."; - const char SEE_D3D10_1[] = "See Direct3D 10.1 node for device details."; - const char SEE_D3D11[] = "See Direct3D 11 node for device details."; - const char SEE_D3D11_1[] = "See Direct3D 11.1 node for device details."; - - const char FL_NOTE[] = "This feature summary is derived from hardware feature level"; - - static_assert(sizeof(D3D10_NOTE) < 80, "String too long"); - static_assert(sizeof(D3D10_NOTE1) < 80, "String too long"); - static_assert(sizeof(D3D11_NOTE) < 80, "String too long"); - static_assert(sizeof(D3D11_NOTE1) < 80, "String too long"); - static_assert(sizeof(D3D11_NOTE2) < 80, "String too long"); - static_assert(sizeof(D3D11_NOTE3) < 80, "String too long"); - static_assert(sizeof(D3D11_NOTE4) < 80, "String too long"); - static_assert(sizeof(_10L9_NOTE) < 80, "String too long"); - static_assert(sizeof(SEE_D3D10) < 80, "String too long"); - static_assert(sizeof(SEE_D3D10_1) < 80, "String too long"); - static_assert(sizeof(SEE_D3D11) < 80, "String too long"); - static_assert(sizeof(SEE_D3D11_1) < 80, "String too long"); + const WCHAR D3D10_NOTE[] = L"Most Direct3D 10 features are required. Tool only shows optional features."; + const WCHAR D3D10_NOTE1[] = L"Most Direct3D 10.1 features are required. Tool only shows optional features."; + const WCHAR D3D11_NOTE[] = L"Most Direct3D 11 features are required. Tool only shows optional features."; + const WCHAR D3D11_NOTE1[] = L"Most Direct3D 11.1 features are required. Tool only shows optional features."; + const WCHAR D3D11_NOTE2[] = L"Most Direct3D 11.2 features are required. Tool only shows optional features."; + const WCHAR D3D11_NOTE3[] = L"Most Direct3D 11.3 features are required. Tool only shows optional features."; + const WCHAR D3D11_NOTE4[] = L"Most Direct3D 11.x features are required. Tool only shows optional features."; + const WCHAR _10L9_NOTE[] = L"Most 10level9 features are required. Tool only shows optional features."; + const WCHAR SEE_D3D10[] = L"See Direct3D 10 node for device details."; + const WCHAR SEE_D3D10_1[] = L"See Direct3D 10.1 node for device details."; + const WCHAR SEE_D3D11[] = L"See Direct3D 11 node for device details."; + const WCHAR SEE_D3D11_1[] = L"See Direct3D 11.1 node for device details."; + + const WCHAR FL_NOTE[] = L"This feature summary is derived from hardware feature level"; + + static_assert(_countof(D3D10_NOTE) < 80, "String too long"); + static_assert(_countof(D3D10_NOTE1) < 80, "String too long"); + static_assert(_countof(D3D11_NOTE) < 80, "String too long"); + static_assert(_countof(D3D11_NOTE1) < 80, "String too long"); + static_assert(_countof(D3D11_NOTE2) < 80, "String too long"); + static_assert(_countof(D3D11_NOTE3) < 80, "String too long"); + static_assert(_countof(D3D11_NOTE4) < 80, "String too long"); + static_assert(_countof(_10L9_NOTE) < 80, "String too long"); + static_assert(_countof(SEE_D3D10) < 80, "String too long"); + static_assert(_countof(SEE_D3D10_1) < 80, "String too long"); + static_assert(_countof(SEE_D3D11) < 80, "String too long"); + static_assert(_countof(SEE_D3D11_1) < 80, "String too long"); + + static_assert(_countof(FL_NOTE) < 80, "String too long"); //----------------------------------------------------------------------------- @@ -130,22 +132,22 @@ namespace } extern DWORD g_dwViewState; -extern const char c_szYes[]; -extern const char c_szNo[]; -extern const char c_szNA[]; +extern const WCHAR c_szYes[]; +extern const WCHAR c_szNo[]; +extern const WCHAR c_szNA[]; -const char c_szOptYes[] = "Optional (Yes)"; -const char c_szOptNo[] = "Optional (No)"; +const WCHAR c_szOptYes[] = L"Optional (Yes)"; +const WCHAR c_szOptNo[] = L"Optional (No)"; namespace { - const char* szRotation[] = + const WCHAR* szRotation[] = { - "DXGI_MODE_ROTATION_UNSPECIFIED", - "DXGI_MODE_ROTATION_IDENTITY", - "DXGI_MODE_ROTATION_ROTATE90", - "DXGI_MODE_ROTATION_ROTATE180", - "DXGI_MODE_ROTATION_ROTATE270" + L"DXGI_MODE_ROTATION_UNSPECIFIED", + L"DXGI_MODE_ROTATION_IDENTITY", + L"DXGI_MODE_ROTATION_ROTATE90", + L"DXGI_MODE_ROTATION_ROTATE180", + L"DXGI_MODE_ROTATION_ROTATE270" }; // The DXGI formats that can be used as display devices @@ -354,7 +356,7 @@ namespace return rootSigOpt.HighestVersion; } - const char* D3D12DXRSupported(_In_ ID3D12Device* device) + const WCHAR* D3D12DXRSupported(_In_ ID3D12Device* device) { D3D12_FEATURE_DATA_D3D12_OPTIONS5 d3d12opts = {}; if (SUCCEEDED(device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &d3d12opts, sizeof(D3D12_FEATURE_DATA_D3D12_OPTIONS5)))) @@ -362,8 +364,8 @@ namespace switch (d3d12opts.RaytracingTier) { case D3D12_RAYTRACING_TIER_NOT_SUPPORTED: break; - case D3D12_RAYTRACING_TIER_1_0: return "Optional (Yes - Tier 1.0)"; - case D3D12_RAYTRACING_TIER_1_1: return "Optional (Yes - Tier 1.1)"; + case D3D12_RAYTRACING_TIER_1_0: return L"Optional (Yes - Tier 1.0)"; + case D3D12_RAYTRACING_TIER_1_1: return L"Optional (Yes - Tier 1.1)"; default: return c_szOptYes; } } @@ -371,7 +373,7 @@ namespace return c_szOptNo; } - const char* D3D12VRSSupported(_In_ ID3D12Device* device) + const WCHAR* D3D12VRSSupported(_In_ ID3D12Device* device) { D3D12_FEATURE_DATA_D3D12_OPTIONS6 d3d12opts = {}; if (SUCCEEDED(device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS6, &d3d12opts, sizeof(D3D12_FEATURE_DATA_D3D12_OPTIONS6)))) @@ -379,8 +381,8 @@ namespace switch (d3d12opts.VariableShadingRateTier) { case D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED: break; - case D3D12_VARIABLE_SHADING_RATE_TIER_1: return "Optional (Yes - Tier 1)"; - case D3D12_VARIABLE_SHADING_RATE_TIER_2: return "Optional (Yes - Tier 2)"; + case D3D12_VARIABLE_SHADING_RATE_TIER_1: return L"Optional (Yes - Tier 1)"; + case D3D12_VARIABLE_SHADING_RATE_TIER_2: return L"Optional (Yes - Tier 2)"; default: return c_szOptYes; } } @@ -424,7 +426,7 @@ namespace //----------------------------------------------------------------------------- #define ENUMNAME(a) case a: return TEXT(#a) - const TCHAR* FormatName(DXGI_FORMAT format) + const WCHAR* FormatName(DXGI_FORMAT format) { switch (format) { @@ -548,11 +550,11 @@ namespace ENUMNAME(DXGI_FORMAT_V408); default: - return TEXT("DXGI_FORMAT_UNKNOWN"); + return L"DXGI_FORMAT_UNKNOWN"; } } - const TCHAR* FLName(D3D10_FEATURE_LEVEL1 lvl) + const WCHAR* FLName(D3D10_FEATURE_LEVEL1 lvl) { switch (lvl) { @@ -563,11 +565,11 @@ namespace ENUMNAME(D3D10_FEATURE_LEVEL_9_3); default: - return TEXT("D3D10_FEATURE_LEVEL_UNKNOWN"); + return L"D3D10_FEATURE_LEVEL_UNKNOWN"; } } - const TCHAR* FLName(D3D_FEATURE_LEVEL lvl) + const WCHAR* FLName(D3D_FEATURE_LEVEL lvl) { switch (lvl) { @@ -583,7 +585,7 @@ namespace ENUMNAME(D3D_FEATURE_LEVEL_12_2); default: - return TEXT("D3D_FEATURE_LEVEL_UNKNOWN"); + return L"D3D_FEATURE_LEVEL_UNKNOWN"; } } @@ -609,8 +611,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 50); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 50); } DXGI_ADAPTER_DESC desc; @@ -622,46 +624,42 @@ namespace DWORD dsm = (DWORD)(desc.DedicatedSystemMemory / (1024 * 1024)); DWORD ssm = (DWORD)(desc.SharedSystemMemory / (1024 * 1024)); - char szDesc[128]; - - wcstombs_s(nullptr, szDesc, desc.Description, 128); - if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "Description"); - LVAddText(g_hwndLV, 1, "%s", szDesc); + LVAddText(g_hwndLV, 0, L"Description"); + LVAddText(g_hwndLV, 1, L"%s", desc.Description); - LVAddText(g_hwndLV, 0, "VendorId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.VendorId); + LVAddText(g_hwndLV, 0, L"VendorId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.VendorId); - LVAddText(g_hwndLV, 0, "DeviceId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.DeviceId); + LVAddText(g_hwndLV, 0, L"DeviceId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.DeviceId); - LVAddText(g_hwndLV, 0, "SubSysId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.SubSysId); + LVAddText(g_hwndLV, 0, L"SubSysId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.SubSysId); - LVAddText(g_hwndLV, 0, "Revision"); - LVAddText(g_hwndLV, 1, "%d", desc.Revision); + LVAddText(g_hwndLV, 0, L"Revision"); + LVAddText(g_hwndLV, 1, L"%d", desc.Revision); - LVAddText(g_hwndLV, 0, "DedicatedVideoMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", dvm); + LVAddText(g_hwndLV, 0, L"DedicatedVideoMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", dvm); - LVAddText(g_hwndLV, 0, "DedicatedSystemMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", dsm); + LVAddText(g_hwndLV, 0, L"DedicatedSystemMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", dsm); - LVAddText(g_hwndLV, 0, "SharedSystemMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", ssm); + LVAddText(g_hwndLV, 0, L"SharedSystemMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", ssm); } else { - PrintStringValueLine("Description", szDesc, pPrintInfo); - PrintHexValueLine("VendorId", desc.VendorId, pPrintInfo); - PrintHexValueLine("DeviceId", desc.DeviceId, pPrintInfo); - PrintHexValueLine("SubSysId", desc.SubSysId, pPrintInfo); - PrintValueLine("Revision", desc.Revision, pPrintInfo); - PrintValueLine("DedicatedVideoMemory (MB)", dvm, pPrintInfo); - PrintValueLine("DedicatedSystemMemory (MB)", dsm, pPrintInfo); - PrintValueLine("SharedSystemMemory (MB)", ssm, pPrintInfo); + PrintStringValueLine(L"Description", desc.Description, pPrintInfo); + PrintHexValueLine(L"VendorId", desc.VendorId, pPrintInfo); + PrintHexValueLine(L"DeviceId", desc.DeviceId, pPrintInfo); + PrintHexValueLine(L"SubSysId", desc.SubSysId, pPrintInfo); + PrintValueLine(L"Revision", desc.Revision, pPrintInfo); + PrintValueLine(L"DedicatedVideoMemory (MB)", dvm, pPrintInfo); + PrintValueLine(L"DedicatedSystemMemory (MB)", dsm, pPrintInfo); + PrintValueLine(L"SharedSystemMemory (MB)", ssm, pPrintInfo); } return S_OK; @@ -675,8 +673,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 50); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 50); } DXGI_ADAPTER_DESC1 desc; @@ -688,50 +686,46 @@ namespace auto dsm = static_cast(desc.DedicatedSystemMemory / (1024 * 1024)); auto ssm = static_cast(desc.SharedSystemMemory / (1024 * 1024)); - char szDesc[128]; - - wcstombs_s(nullptr, szDesc, desc.Description, 128); - if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "Description"); - LVAddText(g_hwndLV, 1, "%s", szDesc); + LVAddText(g_hwndLV, 0, L"Description"); + LVAddText(g_hwndLV, 1, L"%s", desc.Description); - LVAddText(g_hwndLV, 0, "VendorId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.VendorId); + LVAddText(g_hwndLV, 0, L"VendorId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.VendorId); - LVAddText(g_hwndLV, 0, "DeviceId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.DeviceId); + LVAddText(g_hwndLV, 0, L"DeviceId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.DeviceId); - LVAddText(g_hwndLV, 0, "SubSysId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.SubSysId); + LVAddText(g_hwndLV, 0, L"SubSysId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.SubSysId); - LVAddText(g_hwndLV, 0, "Revision"); - LVAddText(g_hwndLV, 1, "%d", desc.Revision); + LVAddText(g_hwndLV, 0, L"Revision"); + LVAddText(g_hwndLV, 1, L"%d", desc.Revision); - LVAddText(g_hwndLV, 0, "DedicatedVideoMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", dvm); + LVAddText(g_hwndLV, 0, L"DedicatedVideoMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", dvm); - LVAddText(g_hwndLV, 0, "DedicatedSystemMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", dsm); + LVAddText(g_hwndLV, 0, L"DedicatedSystemMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", dsm); - LVAddText(g_hwndLV, 0, "SharedSystemMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", ssm); + LVAddText(g_hwndLV, 0, L"SharedSystemMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", ssm); - LVAddText(g_hwndLV, 0, "Remote"); + LVAddText(g_hwndLV, 0, L"Remote"); LVAddText(g_hwndLV, 1, (desc.Flags & DXGI_ADAPTER_FLAG_REMOTE) ? c_szYes : c_szNo); } else { - PrintStringValueLine("Description", szDesc, pPrintInfo); - PrintHexValueLine("VendorId", desc.VendorId, pPrintInfo); - PrintHexValueLine("DeviceId", desc.DeviceId, pPrintInfo); - PrintHexValueLine("SubSysId", desc.SubSysId, pPrintInfo); - PrintValueLine("Revision", desc.Revision, pPrintInfo); - PrintValueLine("DedicatedVideoMemory (MB)", dvm, pPrintInfo); - PrintValueLine("DedicatedSystemMemory (MB)", dsm, pPrintInfo); - PrintValueLine("SharedSystemMemory (MB)", ssm, pPrintInfo); - PrintStringValueLine("Remote", (desc.Flags & DXGI_ADAPTER_FLAG_REMOTE) ? c_szYes : c_szNo, pPrintInfo); + PrintStringValueLine(L"Description", desc.Description, pPrintInfo); + PrintHexValueLine(L"VendorId", desc.VendorId, pPrintInfo); + PrintHexValueLine(L"DeviceId", desc.DeviceId, pPrintInfo); + PrintHexValueLine(L"SubSysId", desc.SubSysId, pPrintInfo); + PrintValueLine(L"Revision", desc.Revision, pPrintInfo); + PrintValueLine(L"DedicatedVideoMemory (MB)", dvm, pPrintInfo); + PrintValueLine(L"DedicatedSystemMemory (MB)", dsm, pPrintInfo); + PrintValueLine(L"SharedSystemMemory (MB)", ssm, pPrintInfo); + PrintStringValueLine(L"Remote", (desc.Flags & DXGI_ADAPTER_FLAG_REMOTE) ? c_szYes : c_szNo, pPrintInfo); } return S_OK; @@ -745,8 +739,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 50); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 50); } DXGI_ADAPTER_DESC2 desc; @@ -758,81 +752,77 @@ namespace auto dsm = static_cast(desc.DedicatedSystemMemory / (1024 * 1024)); auto ssm = static_cast(desc.SharedSystemMemory / (1024 * 1024)); - char szDesc[128]; - - wcstombs_s(nullptr, szDesc, desc.Description, 128); - - const char* gpg = nullptr; - const char* cpg = nullptr; + const WCHAR* gpg = nullptr; + const WCHAR* cpg = nullptr; switch (desc.GraphicsPreemptionGranularity) { - case DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY: gpg = "DMA Buffer"; break; - case DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY: gpg = "Primitive"; break; - case DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY: gpg = "Triangle"; break; - case DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY: gpg = "Pixel"; break; - case DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY: gpg = "Instruction"; break; - default: gpg = "Unknown"; break; + case DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY: gpg = L"DMA Buffer"; break; + case DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY: gpg = L"Primitive"; break; + case DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY: gpg = L"Triangle"; break; + case DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY: gpg = L"Pixel"; break; + case DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY: gpg = L"Instruction"; break; + default: gpg = L"Unknown"; break; } switch (desc.ComputePreemptionGranularity) { - case DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY: cpg = "DMA Buffer"; break; - case DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY: cpg = "Dispatch"; break; - case DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY: cpg = "Thread Group"; break; - case DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY: cpg = "Thread"; break; - case DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY: cpg = "Instruction"; break; - default: cpg = "Unknown"; break; + case DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY: cpg = L"DMA Buffer"; break; + case DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY: cpg = L"Dispatch"; break; + case DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY: cpg = L"Thread Group"; break; + case DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY: cpg = L"Thread"; break; + case DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY: cpg = L"Instruction"; break; + default: cpg = L"Unknown"; break; } if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "Description"); - LVAddText(g_hwndLV, 1, "%s", szDesc); + LVAddText(g_hwndLV, 0, L"Description"); + LVAddText(g_hwndLV, 1, L"%s", desc.Description); - LVAddText(g_hwndLV, 0, "VendorId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.VendorId); + LVAddText(g_hwndLV, 0, L"VendorId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.VendorId); - LVAddText(g_hwndLV, 0, "DeviceId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.DeviceId); + LVAddText(g_hwndLV, 0, L"DeviceId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.DeviceId); - LVAddText(g_hwndLV, 0, "SubSysId"); - LVAddText(g_hwndLV, 1, "0x%08x", desc.SubSysId); + LVAddText(g_hwndLV, 0, L"SubSysId"); + LVAddText(g_hwndLV, 1, L"0x%08x", desc.SubSysId); - LVAddText(g_hwndLV, 0, "Revision"); - LVAddText(g_hwndLV, 1, "%d", desc.Revision); + LVAddText(g_hwndLV, 0, L"Revision"); + LVAddText(g_hwndLV, 1, L"%d", desc.Revision); - LVAddText(g_hwndLV, 0, "DedicatedVideoMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", dvm); + LVAddText(g_hwndLV, 0, L"DedicatedVideoMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", dvm); - LVAddText(g_hwndLV, 0, "DedicatedSystemMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", dsm); + LVAddText(g_hwndLV, 0, L"DedicatedSystemMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", dsm); - LVAddText(g_hwndLV, 0, "SharedSystemMemory (MB)"); - LVAddText(g_hwndLV, 1, "%d", ssm); + LVAddText(g_hwndLV, 0, L"SharedSystemMemory (MB)"); + LVAddText(g_hwndLV, 1, L"%d", ssm); - LVAddText(g_hwndLV, 0, "Remote"); + LVAddText(g_hwndLV, 0, L"Remote"); LVAddText(g_hwndLV, 1, (desc.Flags & DXGI_ADAPTER_FLAG_REMOTE) ? c_szYes : c_szNo); - LVAddText(g_hwndLV, 0, "Graphics Preemption Granularity"); + LVAddText(g_hwndLV, 0, L"Graphics Preemption Granularity"); LVAddText(g_hwndLV, 1, gpg); - LVAddText(g_hwndLV, 0, "Compute Preemption Granularity"); + LVAddText(g_hwndLV, 0, L"Compute Preemption Granularity"); LVAddText(g_hwndLV, 1, cpg); } else { - PrintStringValueLine("Description", szDesc, pPrintInfo); - PrintHexValueLine("VendorId", desc.VendorId, pPrintInfo); - PrintHexValueLine("DeviceId", desc.DeviceId, pPrintInfo); - PrintHexValueLine("SubSysId", desc.SubSysId, pPrintInfo); - PrintValueLine("Revision", desc.Revision, pPrintInfo); - PrintValueLine("DedicatedVideoMemory (MB)", dvm, pPrintInfo); - PrintValueLine("DedicatedSystemMemory (MB)", dsm, pPrintInfo); - PrintValueLine("SharedSystemMemory (MB)", ssm, pPrintInfo); - PrintStringValueLine("Remote", (desc.Flags & DXGI_ADAPTER_FLAG_REMOTE) ? c_szYes : c_szNo, pPrintInfo); - PrintStringValueLine("Graphics Preemption Granularity", gpg, pPrintInfo); - PrintStringValueLine("Compute Preemption Granularity", cpg, pPrintInfo); + PrintStringValueLine(L"Description", desc.Description, pPrintInfo); + PrintHexValueLine(L"VendorId", desc.VendorId, pPrintInfo); + PrintHexValueLine(L"DeviceId", desc.DeviceId, pPrintInfo); + PrintHexValueLine(L"SubSysId", desc.SubSysId, pPrintInfo); + PrintValueLine(L"Revision", desc.Revision, pPrintInfo); + PrintValueLine(L"DedicatedVideoMemory (MB)", dvm, pPrintInfo); + PrintValueLine(L"DedicatedSystemMemory (MB)", dsm, pPrintInfo); + PrintValueLine(L"SharedSystemMemory (MB)", ssm, pPrintInfo); + PrintStringValueLine(L"Remote", (desc.Flags & DXGI_ADAPTER_FLAG_REMOTE) ? c_szYes : c_szNo, pPrintInfo); + PrintStringValueLine(L"Graphics Preemption Granularity", gpg, pPrintInfo); + PrintStringValueLine(L"Compute Preemption Granularity", cpg, pPrintInfo); } return S_OK; @@ -847,8 +837,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 40); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 40); } DXGI_OUTPUT_DESC desc; @@ -856,26 +846,22 @@ namespace if (FAILED(hr)) return hr; - char szDevName[32]; - - wcstombs_s(nullptr, szDevName, desc.DeviceName, 32); - if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "DeviceName"); - LVAddText(g_hwndLV, 1, "%s", szDevName); + LVAddText(g_hwndLV, 0, L"DeviceName"); + LVAddText(g_hwndLV, 1, L"%s", desc.DeviceName); - LVAddText(g_hwndLV, 0, "AttachedToDesktop"); + LVAddText(g_hwndLV, 0, L"AttachedToDesktop"); LVAddText(g_hwndLV, 1, desc.AttachedToDesktop ? c_szYes : c_szNo); - LVAddText(g_hwndLV, 0, "Rotation"); + LVAddText(g_hwndLV, 0, L"Rotation"); LVAddText(g_hwndLV, 1, szRotation[desc.Rotation]); } else { - PrintStringValueLine("DeviceName", szDevName, pPrintInfo); - PrintStringValueLine("AttachedToDesktop", desc.AttachedToDesktop ? c_szYes : c_szNo, pPrintInfo); - PrintStringValueLine("Rotation", szRotation[desc.Rotation], pPrintInfo); + PrintStringValueLine(L"DeviceName", desc.DeviceName, pPrintInfo); + PrintStringValueLine(L"AttachedToDesktop", desc.AttachedToDesktop ? c_szYes : c_szNo, pPrintInfo); + PrintStringValueLine(L"Rotation", szRotation[desc.Rotation], pPrintInfo); } return S_OK; @@ -890,9 +876,9 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Resolution", 14); - LVAddColumn(g_hwndLV, 1, "Pixel Format", 40); - LVAddColumn(g_hwndLV, 2, "Refresh Rate", 10); + LVAddColumn(g_hwndLV, 0, L"Resolution", 14); + LVAddColumn(g_hwndLV, 1, L"Pixel Format", 40); + LVAddColumn(g_hwndLV, 2, L"Refresh Rate", 10); } for (UINT iFormat = 0; iFormat < NumAdapterFormats; ++iFormat) @@ -929,13 +915,13 @@ namespace const DXGI_MODE_DESC* pDesc = &pDescs[iMode]; if (!pPrintInfo) { - LVAddText(g_hwndLV, 0, "%d x %d", pDesc->Width, pDesc->Height); + LVAddText(g_hwndLV, 0, L"%d x %d", pDesc->Width, pDesc->Height); LVAddText(g_hwndLV, 1, FormatName(pDesc->Format)); - LVAddText(g_hwndLV, 2, "%d", RefreshRate(pDesc->RefreshRate)); + LVAddText(g_hwndLV, 2, L"%d", RefreshRate(pDesc->RefreshRate)); } else { - char szBuff[80]; + WCHAR szBuff[80]; DWORD cchLen; // Calculate Name and Value column x offsets @@ -944,18 +930,18 @@ namespace int x3 = x2 + (20 * pPrintInfo->dwCharWidth); int yLine = (pPrintInfo->dwCurrLine * pPrintInfo->dwLineHeight); - sprintf_s(szBuff, sizeof(szBuff), "%u x %u", pDesc->Width, pDesc->Height); - cchLen = static_cast(_tcslen(szBuff)); + swprintf_s(szBuff, 80, L"%u x %u", pDesc->Width, pDesc->Height); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(x1, yLine, szBuff, cchLen, pPrintInfo))) return E_FAIL; - strcpy_s(szBuff, sizeof(szBuff), FormatName(pDesc->Format)); - cchLen = static_cast(_tcslen(szBuff)); + wcscpy_s(szBuff, 80, FormatName(pDesc->Format)); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(x2, yLine, szBuff, cchLen, pPrintInfo))) return E_FAIL; - sprintf_s(szBuff, sizeof(szBuff), "%u", RefreshRate(pDesc->RefreshRate)); - cchLen = static_cast(_tcslen(szBuff)); + swprintf_s(szBuff, 80, L"%u", RefreshRate(pDesc->RefreshRate)); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(x3, yLine, szBuff, cchLen, pPrintInfo))) return E_FAIL; @@ -997,10 +983,10 @@ namespace PrintStringValueLine( a, b, pPrintInfo ); \ } -#define XTOSTRING(a) #a TOSTRING(a) +#define XTOSTRING(a) TEXT(#a) TOSTRING(a) #define TOSTRING(a) #a -#define XTOSTRING2(a) #a TOSTRING2(a) +#define XTOSTRING2(a) TEXT(#a) TOSTRING2(a) #define TOSTRING2(a) "( " #a " )" //----------------------------------------------------------------------------- @@ -1010,8 +996,8 @@ namespace { if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } BOOL allowTearing = FALSE; @@ -1021,11 +1007,11 @@ namespace if (!pPrintInfo) { - LVYESNO("Allow tearing", allowTearing); + LVYESNO(L"Allow tearing", allowTearing); } else { - PRINTYESNO("Allow tearing", allowTearing); + PRINTYESNO(L"Allow tearing", allowTearing); } } @@ -1248,43 +1234,43 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); - } - - const char* shaderModel = nullptr; - const char* computeShader = c_szNo; - const char* maxTexDim = nullptr; - const char* maxCubeDim = nullptr; - const char* maxVolDim = nullptr; - const char* maxTexRepeat = nullptr; - const char* maxAnisotropy = nullptr; - const char* maxPrimCount = "4294967296"; - const char* maxInputSlots = nullptr; - const char* mrt = nullptr; - const char* extFormats = nullptr; - const char* x2_10BitFormat = nullptr; - const char* logic_ops = c_szNo; - const char* cb_partial = c_szNA; - const char* cb_offsetting = c_szNA; - const char* uavSlots = nullptr; - const char* uavEveryStage = nullptr; - const char* uavOnlyRender = nullptr; - const char* nonpow2 = nullptr; - const char* bpp16 = c_szNo; - const char* shadows = nullptr; - const char* cubeRT = nullptr; - const char* tiled_rsc = nullptr; - const char* binding_rsc = nullptr; - const char* minmaxfilter = nullptr; - const char* mapdefaultbuff = nullptr; - const char* consrv_rast = nullptr; - const char* rast_ordered_views = nullptr; - const char* ps_stencil_ref = nullptr; - const char* instancing = nullptr; - const char* vrs = nullptr; - const char* meshShaders = nullptr; - const char* dxr = nullptr; + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); + } + + const WCHAR* shaderModel = nullptr; + const WCHAR* computeShader = c_szNo; + const WCHAR* maxTexDim = nullptr; + const WCHAR* maxCubeDim = nullptr; + const WCHAR* maxVolDim = nullptr; + const WCHAR* maxTexRepeat = nullptr; + const WCHAR* maxAnisotropy = nullptr; + const WCHAR* maxPrimCount = L"4294967296"; + const WCHAR* maxInputSlots = nullptr; + const WCHAR* mrt = nullptr; + const WCHAR* extFormats = nullptr; + const WCHAR* x2_10BitFormat = nullptr; + const WCHAR* logic_ops = c_szNo; + const WCHAR* cb_partial = c_szNA; + const WCHAR* cb_offsetting = c_szNA; + const WCHAR* uavSlots = nullptr; + const WCHAR* uavEveryStage = nullptr; + const WCHAR* uavOnlyRender = nullptr; + const WCHAR* nonpow2 = nullptr; + const WCHAR* bpp16 = c_szNo; + const WCHAR* shadows = nullptr; + const WCHAR* cubeRT = nullptr; + const WCHAR* tiled_rsc = nullptr; + const WCHAR* binding_rsc = nullptr; + const WCHAR* minmaxfilter = nullptr; + const WCHAR* mapdefaultbuff = nullptr; + const WCHAR* consrv_rast = nullptr; + const WCHAR* rast_ordered_views = nullptr; + const WCHAR* ps_stencil_ref = nullptr; + const WCHAR* instancing = nullptr; + const WCHAR* vrs = nullptr; + const WCHAR* meshShaders = nullptr; + const WCHAR* dxr = nullptr; BOOL _10level9 = FALSE; @@ -1296,29 +1282,29 @@ namespace switch (GetD3D12ShaderModel(pD3D12)) { case D3D_SHADER_MODEL_6_9: - shaderModel = "6.9 (Optional)"; - computeShader = "Yes (CS 6.9)"; + shaderModel = L"6.9 (Optional)"; + computeShader = L"Yes (CS 6.9)"; break; case D3D_SHADER_MODEL_6_8: - shaderModel = "6.8 (Optional)"; - computeShader = "Yes (CS 6.8)"; + shaderModel = L"6.8 (Optional)"; + computeShader = L"Yes (CS 6.8)"; break; case D3D_SHADER_MODEL_6_7: - shaderModel = "6.7 (Optional)"; - computeShader = "Yes (CS 6.7)"; + shaderModel = L"6.7 (Optional)"; + computeShader = L"Yes (CS 6.7)"; break; case D3D_SHADER_MODEL_6_6: - shaderModel = "6.6 (Optional)"; - computeShader = "Yes (CS 6.6)"; + shaderModel = L"6.6 (Optional)"; + computeShader = L"Yes (CS 6.6)"; break; default: - shaderModel = "6.5"; - computeShader = "Yes (CS 6.5)"; + shaderModel = L"6.5"; + computeShader = L"Yes (CS 6.5)"; break; } - vrs = "Yes - Tier 2"; + vrs = L"Yes - Tier 2"; meshShaders = c_szYes; - dxr = "Yes - Tier 1.1"; + dxr = L"Yes - Tier 1.1"; } // Fall-through @@ -1329,48 +1315,48 @@ namespace switch (GetD3D12ShaderModel(pD3D12)) { case D3D_SHADER_MODEL_6_9: - shaderModel = "6.9 (Optional)"; - computeShader = "Yes (CS 6.9)"; + shaderModel = L"6.9 (Optional)"; + computeShader = L"Yes (CS 6.9)"; break; case D3D_SHADER_MODEL_6_8: - shaderModel = "6.8 (Optional)"; - computeShader = "Yes (CS 6.8)"; + shaderModel = L"6.8 (Optional)"; + computeShader = L"Yes (CS 6.8)"; break; case D3D_SHADER_MODEL_6_7: - shaderModel = "6.7 (Optional)"; - computeShader = "Yes (CS 6.7)"; + shaderModel = L"6.7 (Optional)"; + computeShader = L"Yes (CS 6.7)"; break; case D3D_SHADER_MODEL_6_6: - shaderModel = "6.6 (Optional)"; - computeShader = "Yes (CS 6.6)"; + shaderModel = L"6.6 (Optional)"; + computeShader = L"Yes (CS 6.6)"; break; case D3D_SHADER_MODEL_6_5: - shaderModel = "6.5 (Optional)"; - computeShader = "Yes (CS 6.5)"; + shaderModel = L"6.5 (Optional)"; + computeShader = L"Yes (CS 6.5)"; break; case D3D_SHADER_MODEL_6_4: - shaderModel = "6.4 (Optional)"; - computeShader = "Yes (CS 6.4)"; + shaderModel = L"6.4 (Optional)"; + computeShader = L"Yes (CS 6.4)"; break; case D3D_SHADER_MODEL_6_3: - shaderModel = "6.3 (Optional)"; - computeShader = "Yes (CS 6.3)"; + shaderModel = L"6.3 (Optional)"; + computeShader = L"Yes (CS 6.3)"; break; case D3D_SHADER_MODEL_6_2: - shaderModel = "6.2 (Optional)"; - computeShader = "Yes (CS 6.2)"; + shaderModel = L"6.2 (Optional)"; + computeShader = L"Yes (CS 6.2)"; break; case D3D_SHADER_MODEL_6_1: - shaderModel = "6.1 (Optional)"; - computeShader = "Yes (CS 6.1)"; + shaderModel = L"6.1 (Optional)"; + computeShader = L"Yes (CS 6.1)"; break; case D3D_SHADER_MODEL_6_0: - shaderModel = "6.0 (Optional)"; - computeShader = "Yes (CS 6.0)"; + shaderModel = L"6.0 (Optional)"; + computeShader = L"Yes (CS 6.0)"; break; default: - shaderModel = "5.1"; - computeShader = "Yes (CS 5.1)"; + shaderModel = L"5.1"; + computeShader = L"Yes (CS 5.1)"; break; } } @@ -1380,8 +1366,8 @@ namespace cb_partial = c_szYes; cb_offsetting = c_szYes; uavEveryStage = c_szYes; - uavOnlyRender = "16"; - nonpow2 = "Full"; + uavOnlyRender = L"16"; + nonpow2 = L"Full"; bpp16 = c_szYes; instancing = c_szYes; @@ -1401,17 +1387,17 @@ namespace switch (d3d12opts.TiledResourcesTier) { // 12.0 & 12.1 should be T2 or greater, 12.2 is T3 or greater - case D3D12_TILED_RESOURCES_TIER_2: tiled_rsc = "Yes - Tier 2"; break; - case D3D12_TILED_RESOURCES_TIER_3: tiled_rsc = "Yes - Tier 3"; break; - case D3D12_TILED_RESOURCES_TIER_4: tiled_rsc = "Yes - Tier 4"; break; + case D3D12_TILED_RESOURCES_TIER_2: tiled_rsc = L"Yes - Tier 2"; break; + case D3D12_TILED_RESOURCES_TIER_3: tiled_rsc = L"Yes - Tier 3"; break; + case D3D12_TILED_RESOURCES_TIER_4: tiled_rsc = L"Yes - Tier 4"; break; default: tiled_rsc = c_szYes; break; } switch (d3d12opts.ResourceBindingTier) { // 12.0 & 12.1 should be T2 or greater, 12.2 is T3 or greater - case D3D12_RESOURCE_BINDING_TIER_2: binding_rsc = "Yes - Tier 2"; break; - case D3D12_RESOURCE_BINDING_TIER_3: binding_rsc = "Yes - Tier 3"; break; + case D3D12_RESOURCE_BINDING_TIER_2: binding_rsc = L"Yes - Tier 2"; break; + case D3D12_RESOURCE_BINDING_TIER_3: binding_rsc = L"Yes - Tier 3"; break; default: binding_rsc = c_szYes; break; } @@ -1420,9 +1406,9 @@ namespace switch (d3d12opts.ConservativeRasterizationTier) { // 12.1 requires T1, 12.2 requires T3 - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = "Yes - Tier 1"; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = "Yes - Tier 2"; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = "Yes - Tier 3"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = L"Yes - Tier 1"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = L"Yes - Tier 2"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = L"Yes - Tier 3"; break; default: consrv_rast = c_szYes; break; } @@ -1433,9 +1419,9 @@ namespace switch (d3d12opts.ConservativeRasterizationTier) { case D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED: consrv_rast = c_szOptNo; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = "Optional (Yes - Tier 1)"; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = "Optional (Yes - Tier 2)"; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = "Optional (Yes - Tier 3)"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = L"Optional (Yes - Tier 1)"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = L"Optional (Yes - Tier 2)"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = L"Optional (Yes - Tier 3)"; break; default: consrv_rast = c_szOptYes; break; } @@ -1468,8 +1454,8 @@ namespace switch (tiled) { // 12.0 & 12.1 should be T2 or greater, 12.2 is T3 or greater - case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = "Yes - Tier 2"; break; - case D3D11_TILED_RESOURCES_TIER_3: tiled_rsc = "Yes - Tier 3"; break; + case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = L"Yes - Tier 2"; break; + case D3D11_TILED_RESOURCES_TIER_3: tiled_rsc = L"Yes - Tier 3"; break; default: tiled_rsc = c_szYes; break; } @@ -1478,9 +1464,9 @@ namespace switch (crast) { // 12.1 requires T1 - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = "Yes - Tier 1"; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = "Yes - Tier 2"; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = "Yes - Tier 3"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = L"Yes - Tier 1"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = L"Yes - Tier 2"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = L"Yes - Tier 3"; break; default: consrv_rast = c_szYes; break; } @@ -1491,9 +1477,9 @@ namespace switch (crast) { case D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED: consrv_rast = c_szOptNo; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = "Optional (Yes - Tier 1)"; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = "Optional (Yes - Tier 2)"; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = "Optional (Yes - Tier 3)"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = L"Optional (Yes - Tier 1)"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = L"Optional (Yes - Tier 2)"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = L"Optional (Yes - Tier 3)"; break; default: consrv_rast = c_szOptYes; break; } @@ -1507,8 +1493,8 @@ namespace break; case D3D_FEATURE_LEVEL_11_1: - shaderModel = "5.0"; - computeShader = "Yes (CS 5.0)"; + shaderModel = L"5.0"; + computeShader = L"Yes (CS 5.0)"; maxTexDim = XTOSTRING(D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION); maxCubeDim = XTOSTRING(D3D11_REQ_TEXTURECUBE_DIMENSION); maxVolDim = XTOSTRING(D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION); @@ -1523,42 +1509,42 @@ namespace cb_offsetting = c_szYes; uavSlots = XTOSTRING(D3D11_1_UAV_SLOT_COUNT); uavEveryStage = c_szYes; - uavOnlyRender = "16"; - nonpow2 = "Full"; + uavOnlyRender = L"16"; + nonpow2 = L"Full"; bpp16 = c_szYes; instancing = c_szYes; if (pD3D12) { - shaderModel = "5.1"; - computeShader = "Yes (CS 5.1)"; + shaderModel = L"5.1"; + computeShader = L"Yes (CS 5.1)"; auto d3d12opts = GetD3D12Options(pD3D12); switch (d3d12opts.TiledResourcesTier) { case D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED: tiled_rsc = c_szOptNo; break; - case D3D12_TILED_RESOURCES_TIER_1: tiled_rsc = "Optional (Yes - Tier 1)"; break; - case D3D12_TILED_RESOURCES_TIER_2: tiled_rsc = "Optional (Yes - Tier 2)"; break; - case D3D12_TILED_RESOURCES_TIER_3: tiled_rsc = "Optional (Yes - Tier 3)"; break; - case D3D12_TILED_RESOURCES_TIER_4: tiled_rsc = "Optional (Yes - Tier 4)"; break; + case D3D12_TILED_RESOURCES_TIER_1: tiled_rsc = L"Optional (Yes - Tier 1)"; break; + case D3D12_TILED_RESOURCES_TIER_2: tiled_rsc = L"Optional (Yes - Tier 2)"; break; + case D3D12_TILED_RESOURCES_TIER_3: tiled_rsc = L"Optional (Yes - Tier 3)"; break; + case D3D12_TILED_RESOURCES_TIER_4: tiled_rsc = L"Optional (Yes - Tier 4)"; break; default: tiled_rsc = c_szOptYes; break; } switch (d3d12opts.ResourceBindingTier) { - case D3D12_RESOURCE_BINDING_TIER_1: binding_rsc = "Yes - Tier 1"; break; - case D3D12_RESOURCE_BINDING_TIER_2: binding_rsc = "Yes - Tier 2"; break; - case D3D12_RESOURCE_BINDING_TIER_3: binding_rsc = "Yes - Tier 3"; break; + case D3D12_RESOURCE_BINDING_TIER_1: binding_rsc = L"Yes - Tier 1"; break; + case D3D12_RESOURCE_BINDING_TIER_2: binding_rsc = L"Yes - Tier 2"; break; + case D3D12_RESOURCE_BINDING_TIER_3: binding_rsc = L"Yes - Tier 3"; break; default: binding_rsc = c_szYes; break; } switch (d3d12opts.ConservativeRasterizationTier) { case D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED: consrv_rast = c_szOptNo; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = "Optional (Yes - Tier 1)"; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = "Optional (Yes - Tier 2)"; break; - case D3D12_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = "Optional (Yes - Tier 3)"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = L"Optional (Yes - Tier 1)"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = L"Optional (Yes - Tier 2)"; break; + case D3D12_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = L"Optional (Yes - Tier 3)"; break; default: consrv_rast = c_szOptYes; break; } @@ -1580,18 +1566,18 @@ namespace switch (tiled) { case D3D11_TILED_RESOURCES_NOT_SUPPORTED: tiled_rsc = c_szOptNo; break; - case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = "Optional (Yes - Tier 1)"; break; - case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = "Optional (Yes - Tier 2)"; break; - case D3D11_TILED_RESOURCES_TIER_3: tiled_rsc = "Optional (Yes - Tier 3)"; break; + case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = L"Optional (Yes - Tier 1)"; break; + case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = L"Optional (Yes - Tier 2)"; break; + case D3D11_TILED_RESOURCES_TIER_3: tiled_rsc = L"Optional (Yes - Tier 3)"; break; default: tiled_rsc = c_szOptYes; break; } switch (crast) { case D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED: consrv_rast = c_szOptNo; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = "Optional (Yes - Tier 1)"; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = "Optional (Yes - Tier 2)"; break; - case D3D11_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = "Optional (Yes - Tier 3)"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_1: consrv_rast = L"Optional (Yes - Tier 1)"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_2: consrv_rast = L"Optional (Yes - Tier 2)"; break; + case D3D11_CONSERVATIVE_RASTERIZATION_TIER_3: consrv_rast = L"Optional (Yes - Tier 3)"; break; default: consrv_rast = c_szOptYes; break; } @@ -1609,8 +1595,8 @@ namespace switch (tiled) { case D3D11_TILED_RESOURCES_NOT_SUPPORTED: tiled_rsc = c_szOptNo; break; - case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = "Optional (Yes - Tier 1)"; break; - case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = "Optional (Yes - Tier 2)"; break; + case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = L"Optional (Yes - Tier 1)"; break; + case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = L"Optional (Yes - Tier 2)"; break; default: tiled_rsc = c_szOptYes; break; } @@ -1620,8 +1606,8 @@ namespace break; case D3D_FEATURE_LEVEL_11_0: - shaderModel = "5.0"; - computeShader = "Yes (CS 5.0)"; + shaderModel = L"5.0"; + computeShader = L"Yes (CS 5.0)"; maxTexDim = XTOSTRING(D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION); maxCubeDim = XTOSTRING(D3D11_REQ_TEXTURECUBE_DIMENSION); maxVolDim = XTOSTRING(D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION); @@ -1635,26 +1621,26 @@ namespace if (pD3D12) { - shaderModel = "5.1"; - computeShader = "Yes (CS 5.1)"; + shaderModel = L"5.1"; + computeShader = L"Yes (CS 5.1)"; auto d3d12opts = GetD3D12Options(pD3D12); switch (d3d12opts.TiledResourcesTier) { case D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED: tiled_rsc = c_szOptNo; break; - case D3D12_TILED_RESOURCES_TIER_1: tiled_rsc = "Optional (Yes - Tier 1)"; break; - case D3D12_TILED_RESOURCES_TIER_2: tiled_rsc = "Optional (Yes - Tier 2)"; break; - case D3D12_TILED_RESOURCES_TIER_3: tiled_rsc = "Optional (Yes - Tier 3)"; break; - case D3D12_TILED_RESOURCES_TIER_4: tiled_rsc = "Optional (Yes - Tier 4)"; break; + case D3D12_TILED_RESOURCES_TIER_1: tiled_rsc = L"Optional (Yes - Tier 1)"; break; + case D3D12_TILED_RESOURCES_TIER_2: tiled_rsc = L"Optional (Yes - Tier 2)"; break; + case D3D12_TILED_RESOURCES_TIER_3: tiled_rsc = L"Optional (Yes - Tier 3)"; break; + case D3D12_TILED_RESOURCES_TIER_4: tiled_rsc = L"Optional (Yes - Tier 4)"; break; default: tiled_rsc = c_szOptYes; break; } switch (d3d12opts.ResourceBindingTier) { - case D3D12_RESOURCE_BINDING_TIER_1: binding_rsc = "Yes - Tier 1"; break; - case D3D12_RESOURCE_BINDING_TIER_2: binding_rsc = "Yes - Tier 2"; break; - case D3D12_RESOURCE_BINDING_TIER_3: binding_rsc = "Yes - Tier 3"; break; + case D3D12_RESOURCE_BINDING_TIER_1: binding_rsc = L"Yes - Tier 1"; break; + case D3D12_RESOURCE_BINDING_TIER_2: binding_rsc = L"Yes - Tier 2"; break; + case D3D12_RESOURCE_BINDING_TIER_3: binding_rsc = L"Yes - Tier 3"; break; default: binding_rsc = c_szYes; break; } @@ -1662,10 +1648,10 @@ namespace consrv_rast = rast_ordered_views = ps_stencil_ref = minmaxfilter = c_szNo; mapdefaultbuff = c_szYes; - uavSlots = "8"; + uavSlots = L"8"; uavEveryStage = c_szNo; - uavOnlyRender = "8"; - nonpow2 = "Full"; + uavOnlyRender = L"8"; + nonpow2 = L"Full"; } else if (pD3D11_3) { @@ -1684,9 +1670,9 @@ namespace switch (tiled) { case D3D11_TILED_RESOURCES_NOT_SUPPORTED: tiled_rsc = c_szOptNo; break; - case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = "Optional (Yes - Tier 1)"; break; - case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = "Optional (Yes - Tier 2)"; break; - case D3D11_TILED_RESOURCES_TIER_3: tiled_rsc = "Optional (Yes - Tier 3)"; break; + case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = L"Optional (Yes - Tier 1)"; break; + case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = L"Optional (Yes - Tier 2)"; break; + case D3D11_TILED_RESOURCES_TIER_3: tiled_rsc = L"Optional (Yes - Tier 3)"; break; default: tiled_rsc = c_szOptYes; break; } @@ -1702,8 +1688,8 @@ namespace switch (tiled) { case D3D11_TILED_RESOURCES_NOT_SUPPORTED: tiled_rsc = c_szOptNo; break; - case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = "Optional (Yes - Tier 1)"; break; - case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = "Optional (Yes - Tier 2)"; break; + case D3D11_TILED_RESOURCES_TIER_1: tiled_rsc = L"Optional (Yes - Tier 1)"; break; + case D3D11_TILED_RESOURCES_TIER_2: tiled_rsc = L"Optional (Yes - Tier 2)"; break; default: tiled_rsc = c_szOptYes; break; } @@ -1725,15 +1711,15 @@ namespace CheckExtendedFormats(pD3D, ext, x2, bpp565); bpp16 = (bpp565) ? c_szOptYes : c_szOptNo; - uavSlots = "8"; + uavSlots = L"8"; uavEveryStage = c_szNo; - uavOnlyRender = "8"; - nonpow2 = "Full"; + uavOnlyRender = L"8"; + nonpow2 = L"Full"; } break; case D3D_FEATURE_LEVEL_10_1: - shaderModel = "4.x"; + shaderModel = L"4.x"; instancing = c_szYes; if (pD3D11_3) @@ -1754,8 +1740,8 @@ namespace if (d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x) { - computeShader = "Optional (Yes - CS 4.x)"; - uavSlots = "1"; + computeShader = L"Optional (Yes - CS 4.x)"; + uavSlots = L"1"; uavEveryStage = c_szNo; uavOnlyRender = c_szNo; } @@ -1775,14 +1761,14 @@ namespace extFormats = (ext) ? c_szOptYes : c_szOptNo; x2_10BitFormat = (x2) ? c_szOptYes : c_szOptNo; - nonpow2 = "Full"; + nonpow2 = L"Full"; bpp16 = (bpp565) ? c_szOptYes : c_szOptNo; } else if (pD3D11) { auto d3d10xhw = GetD3D11Options(pD3D11); - computeShader = (d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x) ? "Optional (Yes - CS 4.x)" : c_szOptNo; + computeShader = (d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x) ? L"Optional (Yes - CS 4.x)" : c_szOptNo; BOOL ext, x2, bpp565; CheckExtendedFormats(pD3D11, ext, x2, bpp565); @@ -1817,7 +1803,7 @@ namespace break; case D3D_FEATURE_LEVEL_10_0: - shaderModel = "4.0"; + shaderModel = L"4.0"; instancing = c_szYes; if (pD3D11_3) @@ -1837,8 +1823,8 @@ namespace if (d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x) { - computeShader = "Optional (Yes - CS 4.x)"; - uavSlots = "1"; + computeShader = L"Optional (Yes - CS 4.x)"; + uavSlots = L"1"; uavEveryStage = c_szNo; uavOnlyRender = c_szNo; } @@ -1858,14 +1844,14 @@ namespace extFormats = (ext) ? c_szOptYes : c_szOptNo; x2_10BitFormat = (x2) ? c_szOptYes : c_szOptNo; - nonpow2 = "Full"; + nonpow2 = L"Full"; bpp16 = (bpp565) ? c_szOptYes : c_szOptNo; } else if (pD3D11) { auto d3d10xhw = GetD3D11Options(pD3D11); - computeShader = (d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x) ? "Optional (Yes - CS 4.0)" : c_szOptNo; + computeShader = (d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x) ? L"Optional (Yes - CS 4.0)" : c_szOptNo; BOOL ext, x2, bpp565; CheckExtendedFormats(pD3D11, ext, x2, bpp565); @@ -1901,7 +1887,7 @@ namespace case D3D_FEATURE_LEVEL_9_3: _10level9 = TRUE; - shaderModel = "2.0 (4_0_level_9_3) [vs_2_a/ps_2_b]"; + shaderModel = L"2.0 (4_0_level_9_3) [vs_2_a/ps_2_b]"; computeShader = c_szNA; maxTexDim = XTOSTRING2(D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION); maxCubeDim = XTOSTRING2(D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION); @@ -1928,7 +1914,7 @@ namespace bool bNonPow2, bShadows, bInstancing, bCubeRT; CheckD3D9Ops1(pD3D, bNonPow2, bShadows, bInstancing, bCubeRT); - nonpow2 = bNonPow2 ? "Optional (Full)" : "Conditional"; + nonpow2 = bNonPow2 ? L"Optional (Full)" : L"Conditional"; shadows = bShadows ? c_szOptYes : c_szOptNo; cubeRT = bCubeRT ? c_szOptYes : c_szOptNo; } @@ -1944,14 +1930,14 @@ namespace bool bNonPow2, bShadows; CheckD3D9Ops(pD3D11_1, bNonPow2, bShadows); - nonpow2 = bNonPow2 ? "Optional (Full)" : "Conditional"; + nonpow2 = bNonPow2 ? L"Optional (Full)" : L"Conditional"; shadows = bShadows ? c_szOptYes : c_szOptNo; } break; case D3D_FEATURE_LEVEL_9_2: _10level9 = TRUE; - shaderModel = "2.0 (4_0_level_9_1)"; + shaderModel = L"2.0 (4_0_level_9_1)"; computeShader = c_szNA; maxTexDim = XTOSTRING2(D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION); maxCubeDim = XTOSTRING2(D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION); @@ -1978,9 +1964,9 @@ namespace bool bNonPow2, bShadows, bInstancing, bCubeRT; CheckD3D9Ops1(pD3D, bNonPow2, bShadows, bInstancing, bCubeRT); - nonpow2 = bNonPow2 ? "Optional (Full)" : "Conditional"; + nonpow2 = bNonPow2 ? L"Optional (Full)" : L"Conditional"; shadows = bShadows ? c_szOptYes : c_szOptNo; - instancing = bInstancing ? "Optional (Simple)" : c_szOptNo; + instancing = bInstancing ? L"Optional (Simple)" : c_szOptNo; cubeRT = bCubeRT ? c_szOptYes : c_szOptNo; } else if (pD3D11_1) @@ -1995,14 +1981,14 @@ namespace bool bNonPow2, bShadows; CheckD3D9Ops(pD3D11_1, bNonPow2, bShadows); - nonpow2 = bNonPow2 ? "Optional (Full)" : "Conditional"; + nonpow2 = bNonPow2 ? L"Optional (Full)" : L"Conditional"; shadows = bShadows ? c_szOptYes : c_szOptNo; } break; case D3D_FEATURE_LEVEL_9_1: _10level9 = TRUE; - shaderModel = "2.0 (4_0_level_9_1)"; + shaderModel = L"2.0 (4_0_level_9_1)"; computeShader = c_szNA; maxTexDim = XTOSTRING2(D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION); maxCubeDim = XTOSTRING2(D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION); @@ -2029,9 +2015,9 @@ namespace bool bNonPow2, bShadows, bInstancing, bCubeRT; CheckD3D9Ops1(pD3D, bNonPow2, bShadows, bInstancing, bCubeRT); - nonpow2 = bNonPow2 ? "Optional (Full)" : "Conditional"; + nonpow2 = bNonPow2 ? L"Optional (Full)" : L"Conditional"; shadows = bShadows ? c_szOptYes : c_szOptNo; - instancing = bInstancing ? "Optional (Simple)" : c_szOptNo; + instancing = bInstancing ? L"Optional (Simple)" : c_szOptNo; cubeRT = bCubeRT ? c_szOptYes : c_szOptNo; } else if (pD3D11_1) @@ -2046,7 +2032,7 @@ namespace bool bNonPow2, bShadows; CheckD3D9Ops(pD3D11_1, bNonPow2, bShadows); - nonpow2 = bNonPow2 ? "Optional (Full)" : "Conditional"; + nonpow2 = bNonPow2 ? L"Optional (Full)" : L"Conditional"; shadows = bShadows ? c_szOptYes : c_szOptNo; } break; @@ -2057,7 +2043,7 @@ namespace if (d3dType == D3D_DRIVER_TYPE_WARP) { - maxTexDim = (pD3D12 || pD3D11_3 || pD3D11_2 || pD3D11_1) ? "16777216" : "65536"; + maxTexDim = (pD3D12 || pD3D11_3 || pD3D11_2 || pD3D11_1) ? L"16777216" : L"65536"; } if (pD3D12) @@ -2080,61 +2066,61 @@ namespace if (!pPrintInfo) { - LVLINE("Shader Model", shaderModel); - LVYESNO("Geometry Shader", (fl >= D3D_FEATURE_LEVEL_10_0)); - LVYESNO("Stream Out", (fl >= D3D_FEATURE_LEVEL_10_0)); + LVLINE(L"Shader Model", shaderModel); + LVYESNO(L"Geometry Shader", (fl >= D3D_FEATURE_LEVEL_10_0)); + LVYESNO(L"Stream Out", (fl >= D3D_FEATURE_LEVEL_10_0)); if (pD3D12 || pD3D11_3 || pD3D11_2 || pD3D11_1 || pD3D11) { if (g_dwViewState == IDM_VIEWALL || computeShader != c_szNo) { - LVLINE("DirectCompute", computeShader); + LVLINE(L"DirectCompute", computeShader); } - LVYESNO("Hull & Domain Shaders", (fl >= D3D_FEATURE_LEVEL_11_0)); + LVYESNO(L"Hull & Domain Shaders", (fl >= D3D_FEATURE_LEVEL_11_0)); } if (pD3D12) { - LVLINE("Variable Rate Shading (VRS)", vrs); - LVLINE("Mesh & Amplification Shaders", meshShaders); - LVLINE("DirectX Raytracing", dxr); + LVLINE(L"Variable Rate Shading (VRS)", vrs); + LVLINE(L"Mesh & Amplification Shaders", meshShaders); + LVLINE(L"DirectX Raytracing", dxr); } - LVYESNO("Texture Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_0)); + LVYESNO(L"Texture Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_0)); if (d3dVer != 0) { - LVYESNO("Cubemap Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_1)); + LVYESNO(L"Cubemap Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_1)); } - LVYESNO("BC4/BC5 Compression", (fl >= D3D_FEATURE_LEVEL_10_0)); + LVYESNO(L"BC4/BC5 Compression", (fl >= D3D_FEATURE_LEVEL_10_0)); if (pD3D12 || pD3D11_3 || pD3D11_2 || pD3D11_1 || pD3D11) { - LVYESNO("BC6H/BC7 Compression", (fl >= D3D_FEATURE_LEVEL_11_0)); + LVYESNO(L"BC6H/BC7 Compression", (fl >= D3D_FEATURE_LEVEL_11_0)); } - LVYESNO("Alpha-to-coverage", (fl >= D3D_FEATURE_LEVEL_10_0)); + LVYESNO(L"Alpha-to-coverage", (fl >= D3D_FEATURE_LEVEL_10_0)); if (pD3D11_1 || pD3D11_2 || pD3D11_3 || pD3D12) { - LVLINE("Logic Ops (Output Merger)", logic_ops); + LVLINE(L"Logic Ops (Output Merger)", logic_ops); } if (pD3D11_1 || pD3D11_2 || pD3D11_3) { - LVLINE("Constant Buffer Partial Updates", cb_partial); - LVLINE("Constant Buffer Offsetting", cb_offsetting); + LVLINE(L"Constant Buffer Partial Updates", cb_partial); + LVLINE(L"Constant Buffer Offsetting", cb_offsetting); if (uavEveryStage) { - LVLINE("UAVs at Every Stage", uavEveryStage); + LVLINE(L"UAVs at Every Stage", uavEveryStage); } if (uavOnlyRender) { - LVLINE("UAV-only rendering", uavOnlyRender); + LVLINE(L"UAV-only rendering", uavOnlyRender); } } @@ -2142,7 +2128,7 @@ namespace { if (tiled_rsc) { - LVLINE("Tiled Resources", tiled_rsc); + LVLINE(L"Tiled Resources", tiled_rsc); } } @@ -2150,12 +2136,12 @@ namespace { if (minmaxfilter) { - LVLINE("Min/Max Filtering", minmaxfilter); + LVLINE(L"Min/Max Filtering", minmaxfilter); } if (mapdefaultbuff) { - LVLINE("Map DEFAULT Buffers", mapdefaultbuff); + LVLINE(L"Map DEFAULT Buffers", mapdefaultbuff); } } @@ -2163,153 +2149,153 @@ namespace { if (consrv_rast) { - LVLINE("Conservative Rasterization", consrv_rast); + LVLINE(L"Conservative Rasterization", consrv_rast); } if (ps_stencil_ref) { - LVLINE("PS-Specified Stencil Ref", ps_stencil_ref); + LVLINE(L"PS-Specified Stencil Ref", ps_stencil_ref); } if (rast_ordered_views) { - LVLINE("Rasterizer Ordered Views", rast_ordered_views); + LVLINE(L"Rasterizer Ordered Views", rast_ordered_views); } } if (pD3D12 && binding_rsc) { - LVLINE("Resource Binding", binding_rsc); + LVLINE(L"Resource Binding", binding_rsc); } if (g_DXGIFactory1 && !pD3D12) { - LVLINE("Extended Formats (BGRA, etc.)", extFormats); + LVLINE(L"Extended Formats (BGRA, etc.)", extFormats); if (x2_10BitFormat && (g_dwViewState == IDM_VIEWALL || x2_10BitFormat != c_szNo)) { - LVLINE("10-bit XR High Color Format", x2_10BitFormat); + LVLINE(L"10-bit XR High Color Format", x2_10BitFormat); } } if (pD3D11_1 || pD3D11_2 || pD3D11_3) { - LVLINE("16-bit Formats (565/5551/4444)", bpp16); + LVLINE(L"16-bit Formats (565/5551/4444)", bpp16); } if (nonpow2 && !pD3D12) { - LVLINE("Non-Power-of-2 Textures", nonpow2); + LVLINE(L"Non-Power-of-2 Textures", nonpow2); } - LVLINE("Max Texture Dimension", maxTexDim); - LVLINE("Max Cubemap Dimension", maxCubeDim); + LVLINE(L"Max Texture Dimension", maxTexDim); + LVLINE(L"Max Cubemap Dimension", maxCubeDim); if (maxVolDim) { - LVLINE("Max Volume Extent", maxVolDim); + LVLINE(L"Max Volume Extent", maxVolDim); } if (maxTexRepeat) { - LVLINE("Max Texture Repeat", maxTexRepeat); + LVLINE(L"Max Texture Repeat", maxTexRepeat); } - LVLINE("Max Input Slots", maxInputSlots); + LVLINE(L"Max Input Slots", maxInputSlots); if (uavSlots) { - LVLINE("UAV Slots", uavSlots); + LVLINE(L"UAV Slots", uavSlots); } if (maxAnisotropy) { - LVLINE("Max Anisotropy", maxAnisotropy); + LVLINE(L"Max Anisotropy", maxAnisotropy); } - LVLINE("Max Primitive Count", maxPrimCount); + LVLINE(L"Max Primitive Count", maxPrimCount); if (mrt) { - LVLINE("Simultaneous Render Targets", mrt); + LVLINE(L"Simultaneous Render Targets", mrt); } if (_10level9) { - LVYESNO("Occlusion Queries", (fl >= D3D_FEATURE_LEVEL_9_2)); - LVYESNO("Separate Alpha Blend", (fl >= D3D_FEATURE_LEVEL_9_2)); - LVYESNO("Mirror Once", (fl >= D3D_FEATURE_LEVEL_9_2)); - LVYESNO("Overlapping Vertex Elements", (fl >= D3D_FEATURE_LEVEL_9_2)); - LVYESNO("Independant Write Masks", (fl >= D3D_FEATURE_LEVEL_9_3)); + LVYESNO(L"Occlusion Queries", (fl >= D3D_FEATURE_LEVEL_9_2)); + LVYESNO(L"Separate Alpha Blend", (fl >= D3D_FEATURE_LEVEL_9_2)); + LVYESNO(L"Mirror Once", (fl >= D3D_FEATURE_LEVEL_9_2)); + LVYESNO(L"Overlapping Vertex Elements", (fl >= D3D_FEATURE_LEVEL_9_2)); + LVYESNO(L"Independant Write Masks", (fl >= D3D_FEATURE_LEVEL_9_3)); - LVLINE("Instancing", instancing); + LVLINE(L"Instancing", instancing); if (pD3D11_1 || pD3D11_2 || pD3D11_3) { - LVLINE("Shadow Support", shadows); + LVLINE(L"Shadow Support", shadows); } if (pD3D11_2 || pD3D11_3) { - LVLINE("Cubemap Render w/ non-Cube Depth", cubeRT); + LVLINE(L"Cubemap Render w/ non-Cube Depth", cubeRT); } } - LVLINE("Note", FL_NOTE); + LVLINE(L"Note", FL_NOTE); } else { - PRINTLINE("Shader Model", shaderModel); - PRINTYESNO("Geometry Shader", (fl >= D3D_FEATURE_LEVEL_10_0)); - PRINTYESNO("Stream Out", (fl >= D3D_FEATURE_LEVEL_10_0)); + PRINTLINE(L"Shader Model", shaderModel); + PRINTYESNO(L"Geometry Shader", (fl >= D3D_FEATURE_LEVEL_10_0)); + PRINTYESNO(L"Stream Out", (fl >= D3D_FEATURE_LEVEL_10_0)); if (pD3D12 || pD3D11_3 || pD3D11_2 || pD3D11_1 || pD3D11) { - PRINTLINE("DirectCompute", computeShader); - PRINTYESNO("Hull & Domain Shaders", (fl >= D3D_FEATURE_LEVEL_11_0)); + PRINTLINE(L"DirectCompute", computeShader); + PRINTYESNO(L"Hull & Domain Shaders", (fl >= D3D_FEATURE_LEVEL_11_0)); } if (pD3D12) { - PRINTLINE("Variable Rate Shading (VRS)", vrs); - PRINTLINE("Mesh & Amplification Shaders", meshShaders); - PRINTLINE("DirectX Raytracing", dxr); + PRINTLINE(L"Variable Rate Shading (VRS)", vrs); + PRINTLINE(L"Mesh & Amplification Shaders", meshShaders); + PRINTLINE(L"DirectX Raytracing", dxr); } - PRINTYESNO("Texture Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_0)); + PRINTYESNO(L"Texture Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_0)); if (d3dVer != 0) { - PRINTYESNO("Cubemap Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_1)); + PRINTYESNO(L"Cubemap Resource Arrays", (fl >= D3D_FEATURE_LEVEL_10_1)); } - PRINTYESNO("BC4/BC5 Compression", (fl >= D3D_FEATURE_LEVEL_10_0)); + PRINTYESNO(L"BC4/BC5 Compression", (fl >= D3D_FEATURE_LEVEL_10_0)); if (pD3D11_3 || pD3D11_2 || pD3D11_1 || pD3D11) { - PRINTYESNO("BC6H/BC7 Compression", (fl >= D3D_FEATURE_LEVEL_11_0)); + PRINTYESNO(L"BC6H/BC7 Compression", (fl >= D3D_FEATURE_LEVEL_11_0)); } - PRINTYESNO("Alpha-to-coverage", (fl >= D3D_FEATURE_LEVEL_10_0)); + PRINTYESNO(L"Alpha-to-coverage", (fl >= D3D_FEATURE_LEVEL_10_0)); if (pD3D11_1 || pD3D11_2 || pD3D11_3 || pD3D12) { - PRINTLINE("Logic Ops (Output Merger)", logic_ops); + PRINTLINE(L"Logic Ops (Output Merger)", logic_ops); } if (pD3D11_1 || pD3D11_2 || pD3D11_3) { - PRINTLINE("Constant Buffer Partial Updates", cb_partial); - PRINTLINE("Constant Buffer Offsetting", cb_offsetting); + PRINTLINE(L"Constant Buffer Partial Updates", cb_partial); + PRINTLINE(L"Constant Buffer Offsetting", cb_offsetting); if (uavEveryStage) { - PRINTLINE("UAVs at Every Stage", uavEveryStage); + PRINTLINE(L"UAVs at Every Stage", uavEveryStage); } if (uavOnlyRender) { - PRINTLINE("UAV-only rendering", uavOnlyRender); + PRINTLINE(L"UAV-only rendering", uavOnlyRender); } } @@ -2317,7 +2303,7 @@ namespace { if (tiled_rsc) { - PRINTLINE("Tiled Resources", tiled_rsc); + PRINTLINE(L"Tiled Resources", tiled_rsc); } } @@ -2325,12 +2311,12 @@ namespace { if (minmaxfilter) { - PRINTLINE("Min/Max Filtering", minmaxfilter); + PRINTLINE(L"Min/Max Filtering", minmaxfilter); } if (mapdefaultbuff) { - PRINTLINE("Map DEFAULT Buffers", mapdefaultbuff); + PRINTLINE(L"Map DEFAULT Buffers", mapdefaultbuff); } } @@ -2338,99 +2324,99 @@ namespace { if (consrv_rast) { - PRINTLINE("Conservative Rasterization", consrv_rast); + PRINTLINE(L"Conservative Rasterization", consrv_rast); } if (ps_stencil_ref) { - PRINTLINE("PS-Specified Stencil Ref ", ps_stencil_ref); + PRINTLINE(L"PS-Specified Stencil Ref ", ps_stencil_ref); } if (rast_ordered_views) { - PRINTLINE("Rasterizer Ordered Views", rast_ordered_views); + PRINTLINE(L"Rasterizer Ordered Views", rast_ordered_views); } } if (pD3D12 && binding_rsc) { - PRINTLINE("Resource Binding", binding_rsc); + PRINTLINE(L"Resource Binding", binding_rsc); } if (g_DXGIFactory1 && !pD3D12) { - PRINTLINE("Extended Formats (BGRA, etc.)", extFormats); + PRINTLINE(L"Extended Formats (BGRA, etc.)", extFormats); if (x2_10BitFormat) { - PRINTLINE("10-bit XR High Color Format", x2_10BitFormat); + PRINTLINE(L"10-bit XR High Color Format", x2_10BitFormat); } } if (pD3D11_1 || pD3D11_2 || pD3D11_3) { - PRINTLINE("16-bit Formats (565/5551/4444)", bpp16); + PRINTLINE(L"16-bit Formats (565/5551/4444)", bpp16); } if (nonpow2) { - PRINTLINE("Non-Power-of-2 Textures", nonpow2); + PRINTLINE(L"Non-Power-of-2 Textures", nonpow2); } - PRINTLINE("Max Texture Dimension", maxTexDim); - PRINTLINE("Max Cubemap Dimension", maxCubeDim); + PRINTLINE(L"Max Texture Dimension", maxTexDim); + PRINTLINE(L"Max Cubemap Dimension", maxCubeDim); if (maxVolDim) { - PRINTLINE("Max Volume Extent", maxVolDim); + PRINTLINE(L"Max Volume Extent", maxVolDim); } if (maxTexRepeat) { - PRINTLINE("Max Texture Repeat", maxTexRepeat); + PRINTLINE(L"Max Texture Repeat", maxTexRepeat); } - PRINTLINE("Max Input Slots", maxInputSlots); + PRINTLINE(L"Max Input Slots", maxInputSlots); if (uavSlots) { - PRINTLINE("UAV Slots", uavSlots); + PRINTLINE(L"UAV Slots", uavSlots); } if (maxAnisotropy) { - PRINTLINE("Max Anisotropy", maxAnisotropy); + PRINTLINE(L"Max Anisotropy", maxAnisotropy); } - PRINTLINE("Max Primitive Count", maxPrimCount); + PRINTLINE(L"Max Primitive Count", maxPrimCount); if (mrt) { - PRINTLINE("Simultaneous Render Targets", mrt); + PRINTLINE(L"Simultaneous Render Targets", mrt); } if (_10level9) { - PRINTYESNO("Occlusion Queries", (fl >= D3D_FEATURE_LEVEL_9_2)); - PRINTYESNO("Separate Alpha Blend", (fl >= D3D_FEATURE_LEVEL_9_2)); - PRINTYESNO("Mirror Once", (fl >= D3D_FEATURE_LEVEL_9_2)); - PRINTYESNO("Overlapping Vertex Elements", (fl >= D3D_FEATURE_LEVEL_9_2)); - PRINTYESNO("Independant Write Masks", (fl >= D3D_FEATURE_LEVEL_9_3)); + PRINTYESNO(L"Occlusion Queries", (fl >= D3D_FEATURE_LEVEL_9_2)); + PRINTYESNO(L"Separate Alpha Blend", (fl >= D3D_FEATURE_LEVEL_9_2)); + PRINTYESNO(L"Mirror Once", (fl >= D3D_FEATURE_LEVEL_9_2)); + PRINTYESNO(L"Overlapping Vertex Elements", (fl >= D3D_FEATURE_LEVEL_9_2)); + PRINTYESNO(L"Independant Write Masks", (fl >= D3D_FEATURE_LEVEL_9_3)); - PRINTLINE("Instancing", instancing); + PRINTLINE(L"Instancing", instancing); if (pD3D11_1 || pD3D11_2 || pD3D11_3) { - PRINTLINE("Shadow Support", shadows); + PRINTLINE(L"Shadow Support", shadows); } if (pD3D11_2 || pD3D11_3) { - PRINTLINE("Cubemap Render w/ non-Cube Depth", cubeRT); + PRINTLINE(L"Cubemap Render w/ non-Cube Depth", cubeRT); } } - PRINTLINE("Note", FL_NOTE); + PRINTLINE(L"Note", FL_NOTE); } return S_OK; @@ -2446,16 +2432,16 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); if (lParam2 == D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET) { - LVAddColumn(g_hwndLV, 1, "Value", 25); - LVAddColumn(g_hwndLV, 2, "Quality Level", 25); + LVAddColumn(g_hwndLV, 1, L"Value", 25); + LVAddColumn(g_hwndLV, 2, L"Quality Level", 25); } else { - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } } @@ -2470,21 +2456,21 @@ namespace { if (g_DXGIFactory1) { - LVYESNO("Extended Formats (BGRA, etc.)", ext); - LVYESNO("10-bit XR High Color Format", x2); + LVYESNO(L"Extended Formats (BGRA, etc.)", ext); + LVYESNO(L"10-bit XR High Color Format", x2); } - LVLINE("Note", D3D10_NOTE); + LVLINE(L"Note", D3D10_NOTE); } else { if (g_DXGIFactory1) { - PRINTYESNO("Extended Formats (BGRA, etc.)", ext); - PRINTYESNO("10-bit XR High Color Format", x2); + PRINTYESNO(L"Extended Formats (BGRA, etc.)", ext); + PRINTYESNO(L"10-bit XR High Color Format", x2); } - PRINTLINE("Note", D3D10_NOTE); + PRINTLINE(L"Note", D3D10_NOTE); } return S_OK; @@ -2591,20 +2577,20 @@ namespace if (g_dwViewState == IDM_VIEWALL || msaa) { LVAddText(g_hwndLV, 0, FormatName(fmt)); - LVAddText(g_hwndLV, 1, msaa ? c_szYes : c_szNo); \ + LVAddText(g_hwndLV, 1, msaa ? c_szYes : c_szNo); - TCHAR strBuffer[16]; - sprintf_s(strBuffer, 16, "%u", msaa ? quality : 0); + WCHAR strBuffer[16]; + swprintf_s(strBuffer, 16, L"%u", msaa ? quality : 0); LVAddText(g_hwndLV, 2, strBuffer); } } else { - TCHAR strBuffer[32]; + WCHAR strBuffer[32]; if (msaa) - sprintf_s(strBuffer, 32, "Yes (%u)", quality); + swprintf_s(strBuffer, 32, L"Yes (%u)", quality); else - strcpy_s(strBuffer, 32, c_szNo); + wcscpy_s(strBuffer, 32, c_szNo); PrintStringValueLine(FormatName(fmt), strBuffer, pPrintInfo); } @@ -2638,16 +2624,16 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); if (lParam2 == D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET) { - LVAddColumn(g_hwndLV, 1, "Value", 25); - LVAddColumn(g_hwndLV, 2, "Quality Level", 25); + LVAddColumn(g_hwndLV, 1, L"Value", 25); + LVAddColumn(g_hwndLV, 2, L"Quality Level", 25); } else { - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } } @@ -2656,7 +2642,7 @@ namespace // General Direct3D 10.1 device information D3D10_FEATURE_LEVEL1 fl = pDevice->GetFeatureLevel(); - const char* szNote = nullptr; + const WCHAR* szNote = nullptr; switch (fl) { @@ -2680,27 +2666,27 @@ namespace if (!pPrintInfo) { - LVLINE("Feature Level", FLName(fl)); + LVLINE(L"Feature Level", FLName(fl)); if (g_DXGIFactory1 != nullptr && (fl >= D3D10_FEATURE_LEVEL_10_0)) { - LVYESNO("Extended Formats (BGRA, etc.)", ext); - LVYESNO("10-bit XR High Color Format", x2); + LVYESNO(L"Extended Formats (BGRA, etc.)", ext); + LVYESNO(L"10-bit XR High Color Format", x2); } - LVLINE("Note", szNote); + LVLINE(L"Note", szNote); } else { - PRINTLINE("Feature Level", FLName(fl)); + PRINTLINE(L"Feature Level", FLName(fl)); if (g_DXGIFactory1 != nullptr && (fl >= D3D10_FEATURE_LEVEL_10_0)) { - PRINTYESNO("Extended Formats (BGRA, etc.)", ext); - PRINTYESNO("10-bit XR High Color Format", x2); + PRINTYESNO(L"Extended Formats (BGRA, etc.)", ext); + PRINTYESNO(L"10-bit XR High Color Format", x2); } - PRINTLINE("Note", szNote); + PRINTLINE(L"Note", szNote); } return S_OK; @@ -2795,18 +2781,18 @@ namespace LVAddText(g_hwndLV, 0, FormatName(fmt)); LVAddText(g_hwndLV, 1, msaa ? c_szYes : c_szNo); \ - TCHAR strBuffer[16]; - sprintf_s(strBuffer, 16, "%u", msaa ? quality : 0); + WCHAR strBuffer[16]; + swprintf_s(strBuffer, 16, L"%u", msaa ? quality : 0); LVAddText(g_hwndLV, 2, strBuffer); } } else { - TCHAR strBuffer[32]; + WCHAR strBuffer[32]; if (msaa) - sprintf_s(strBuffer, 32, "Yes (%u)", quality); + swprintf_s(strBuffer, 32, L"Yes (%u)", quality); else - strcpy_s(strBuffer, 32, c_szNo); + wcscpy_s(strBuffer, 32, c_szNo); PrintStringValueLine(FormatName(fmt), strBuffer, pPrintInfo); } @@ -2843,7 +2829,7 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); UINT column = 1; for (UINT samples = 2; samples <= D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT; ++samples) @@ -2851,8 +2837,8 @@ namespace if (!sampCount[samples - 1] && !IsMSAAPowerOf2(samples)) continue; - TCHAR strBuffer[8]; - sprintf_s(strBuffer, 8, "%ux", samples); + WCHAR strBuffer[8]; + swprintf_s(strBuffer, 8, L"%ux", samples); LVAddColumn(g_hwndLV, column, strBuffer, 8); ++column; } @@ -2895,8 +2881,8 @@ namespace if (sampQ[samples - 1] > 0) { - TCHAR strBuffer[32]; - sprintf_s(strBuffer, 32, "Yes (%u)", sampQ[samples - 1]); + WCHAR strBuffer[32]; + swprintf_s(strBuffer, 32, L"Yes (%u)", sampQ[samples - 1]); LVAddText(g_hwndLV, column, strBuffer); } else @@ -2907,7 +2893,7 @@ namespace } else { - TCHAR buff[1024]; + WCHAR buff[1024]; *buff = 0; for (UINT samples = 2; samples <= D3D10_MAX_MULTISAMPLE_SAMPLE_COUNT; ++samples) @@ -2915,13 +2901,13 @@ namespace if (!sampCount[samples - 1] && !IsMSAAPowerOf2(samples)) continue; - TCHAR strBuffer[32]; + WCHAR strBuffer[32]; if (sampQ[samples - 1] > 0) - sprintf_s(strBuffer, 32, "%ux: Yes (%u) ", samples, sampQ[samples - 1]); + swprintf_s(strBuffer, 32, L"%ux: Yes (%u) ", samples, sampQ[samples - 1]); else - sprintf_s(strBuffer, 32, "%ux: No ", samples); + swprintf_s(strBuffer, 32, L"%ux: No ", samples); - strcat_s(buff, 1024, strBuffer); + wcscat_s(buff, 1024, strBuffer); } PrintStringValueLine(FormatName(fmt), buff, pPrintInfo); @@ -2941,16 +2927,16 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); if (lParam2 == D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET) { - LVAddColumn(g_hwndLV, 1, "Value", 25); - LVAddColumn(g_hwndLV, 2, "Quality Level", 25); + LVAddColumn(g_hwndLV, 1, L"Value", 25); + LVAddColumn(g_hwndLV, 2, L"Quality Level", 25); } else { - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } } @@ -2967,7 +2953,7 @@ namespace auto d3d10xhw = GetD3D11Options(pDevice); // Setup note - const char* szNote = nullptr; + const WCHAR* szNote = nullptr; switch (fl) { @@ -2989,25 +2975,25 @@ namespace if (!pPrintInfo) { - LVLINE("Feature Level", FLName(fl)); + LVLINE(L"Feature Level", FLName(fl)); - LVYESNO("Driver Concurrent Creates", threading.DriverConcurrentCreates); - LVYESNO("Driver Command Lists", threading.DriverCommandLists); - LVYESNO("Double-precision Shaders", doubles.DoublePrecisionFloatShaderOps); - LVYESNO("DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); + LVYESNO(L"Driver Concurrent Creates", threading.DriverConcurrentCreates); + LVYESNO(L"Driver Command Lists", threading.DriverCommandLists); + LVYESNO(L"Double-precision Shaders", doubles.DoublePrecisionFloatShaderOps); + LVYESNO(L"DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); - LVLINE("Note", szNote); + LVLINE(L"Note", szNote); } else { - PRINTLINE("Feature Level", FLName(fl)); + PRINTLINE(L"Feature Level", FLName(fl)); - PRINTYESNO("Driver Concurrent Creates", threading.DriverConcurrentCreates); - PRINTYESNO("Driver Command Lists", threading.DriverCommandLists); - PRINTYESNO("Double-precision Shaders", doubles.DoublePrecisionFloatShaderOps); - PRINTYESNO("DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); + PRINTYESNO(L"Driver Concurrent Creates", threading.DriverConcurrentCreates); + PRINTYESNO(L"Driver Command Lists", threading.DriverCommandLists); + PRINTYESNO(L"Double-precision Shaders", doubles.DoublePrecisionFloatShaderOps); + PRINTYESNO(L"DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); - PRINTLINE("Note", szNote); + PRINTLINE(L"Note", szNote); } return S_OK; @@ -3110,20 +3096,20 @@ namespace if (g_dwViewState == IDM_VIEWALL || msaa) { LVAddText(g_hwndLV, 0, FormatName(fmt)); - LVAddText(g_hwndLV, 1, msaa ? c_szYes : c_szNo); \ + LVAddText(g_hwndLV, 1, msaa ? c_szYes : c_szNo); - TCHAR strBuffer[16]; - sprintf_s(strBuffer, 16, "%u", msaa ? quality : 0); + WCHAR strBuffer[16]; + swprintf_s(strBuffer, 16, L"%u", msaa ? quality : 0); LVAddText(g_hwndLV, 2, strBuffer); } } else { - TCHAR strBuffer[32]; + WCHAR strBuffer[32]; if (msaa) - sprintf_s(strBuffer, 32, "Yes (%u)", quality); + swprintf_s(strBuffer, 32, L"Yes (%u)", quality); else - strcpy_s(strBuffer, 32, c_szNo); + wcscpy_s(strBuffer, 32, c_szNo); PrintStringValueLine(FormatName(fmt), strBuffer, pPrintInfo); } @@ -3171,20 +3157,20 @@ namespace d3d11opts1 = GetD3D11Options(pDevice); } - const char* clearview = nullptr; + const WCHAR* clearview = nullptr; if (d3d11opts.ClearView) { - clearview = d3d11opts1.ClearViewAlsoSupportsDepthOnlyFormats ? "RTV, UAV, and Depth (Driver sees)" : "RTV and UAV (Driver sees)"; + clearview = d3d11opts1.ClearViewAlsoSupportsDepthOnlyFormats ? L"RTV, UAV, and Depth (Driver sees)" : L"RTV and UAV (Driver sees)"; } else { - clearview = d3d11opts1.ClearViewAlsoSupportsDepthOnlyFormats ? "RTV, UAV, and Depth (Driver doesn't see)" : "RTV and UAV (Driver doesn't see)"; + clearview = d3d11opts1.ClearViewAlsoSupportsDepthOnlyFormats ? L"RTV, UAV, and Depth (Driver doesn't see)" : L"RTV and UAV (Driver doesn't see)"; } - const char* double_shaders = nullptr; + const WCHAR* double_shaders = nullptr; if (d3d11opts.ExtendedDoublesShaderInstructions) { - double_shaders = "Extended"; + double_shaders = L"Extended"; } else if (doubles.DoublePrecisionFloatShaderOps) { @@ -3195,97 +3181,97 @@ namespace double_shaders = c_szNo; } - const char* ps_precis = nullptr; + const WCHAR* ps_precis = nullptr; switch (minprecis.PixelShaderMinPrecision & (D3D11_SHADER_MIN_PRECISION_16_BIT | D3D11_SHADER_MIN_PRECISION_10_BIT)) { - case 0: ps_precis = "Full"; break; - case D3D11_SHADER_MIN_PRECISION_16_BIT: ps_precis = "16/32-bit"; break; - case D3D11_SHADER_MIN_PRECISION_10_BIT: ps_precis = "10/32-bit"; break; - default: ps_precis = "10/16/32-bit"; break; + case 0: ps_precis = L"Full"; break; + case D3D11_SHADER_MIN_PRECISION_16_BIT: ps_precis = L"16/32-bit"; break; + case D3D11_SHADER_MIN_PRECISION_10_BIT: ps_precis = L"10/32-bit"; break; + default: ps_precis = L"10/16/32-bit"; break; } - const char* other_precis = nullptr; + const WCHAR* other_precis = nullptr; switch (minprecis.AllOtherShaderStagesMinPrecision & (D3D11_SHADER_MIN_PRECISION_16_BIT | D3D11_SHADER_MIN_PRECISION_10_BIT)) { - case 0: other_precis = "Full"; break; - case D3D11_SHADER_MIN_PRECISION_16_BIT: other_precis = "16/32-bit"; break; - case D3D11_SHADER_MIN_PRECISION_10_BIT: other_precis = "10/32-bit"; break; - default: other_precis = "10/16/32-bit"; break; + case 0: other_precis = L"Full"; break; + case D3D11_SHADER_MIN_PRECISION_16_BIT: other_precis = L"16/32-bit"; break; + case D3D11_SHADER_MIN_PRECISION_10_BIT: other_precis = L"10/32-bit"; break; + default: other_precis = L"10/16/32-bit"; break; } - const char* nonpow2 = (d3d9opts.FullNonPow2TextureSupport) ? "Full" : "Conditional"; + const WCHAR* nonpow2 = (d3d9opts.FullNonPow2TextureSupport) ? L"Full" : L"Conditional"; if (!pPrintInfo) { - LVLINE("Feature Level", FLName(fl)); + LVLINE(L"Feature Level", FLName(fl)); - LVYESNO("Driver Concurrent Creates", threading.DriverConcurrentCreates); - LVYESNO("Driver Command Lists", threading.DriverCommandLists); - LVLINE("Double-precision Shaders", double_shaders); - LVYESNO("DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); + LVYESNO(L"Driver Concurrent Creates", threading.DriverConcurrentCreates); + LVYESNO(L"Driver Command Lists", threading.DriverCommandLists); + LVLINE(L"Double-precision Shaders", double_shaders); + LVYESNO(L"DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); - LVYESNO("Driver sees DiscardResource/View", d3d11opts.DiscardAPIsSeenByDriver); - LVYESNO("Driver sees COPY_FLAGS", d3d11opts.FlagsForUpdateAndCopySeenByDriver); - LVLINE("ClearView", clearview); - LVYESNO("Copy w/ Overlapping Rect", d3d11opts.CopyWithOverlap); - LVYESNO("CB Partial Update", d3d11opts.ConstantBufferPartialUpdate); - LVYESNO("CB Offsetting", d3d11opts.ConstantBufferOffsetting); - LVYESNO("Map NO_OVERWRITE on Dynamic CB", d3d11opts.MapNoOverwriteOnDynamicConstantBuffer); + LVYESNO(L"Driver sees DiscardResource/View", d3d11opts.DiscardAPIsSeenByDriver); + LVYESNO(L"Driver sees COPY_FLAGS", d3d11opts.FlagsForUpdateAndCopySeenByDriver); + LVLINE(L"ClearView", clearview); + LVYESNO(L"Copy w/ Overlapping Rect", d3d11opts.CopyWithOverlap); + LVYESNO(L"CB Partial Update", d3d11opts.ConstantBufferPartialUpdate); + LVYESNO(L"CB Offsetting", d3d11opts.ConstantBufferOffsetting); + LVYESNO(L"Map NO_OVERWRITE on Dynamic CB", d3d11opts.MapNoOverwriteOnDynamicConstantBuffer); if (fl >= D3D_FEATURE_LEVEL_10_0) { - LVYESNO("Map NO_OVERWRITE on Dynamic SRV", d3d11opts.MapNoOverwriteOnDynamicBufferSRV); - LVYESNO("MSAA with ForcedSampleCount=1", d3d11opts.MultisampleRTVWithForcedSampleCountOne); - LVYESNO("Extended resource sharing", d3d11opts.ExtendedResourceSharing); + LVYESNO(L"Map NO_OVERWRITE on Dynamic SRV", d3d11opts.MapNoOverwriteOnDynamicBufferSRV); + LVYESNO(L"MSAA with ForcedSampleCount=1", d3d11opts.MultisampleRTVWithForcedSampleCountOne); + LVYESNO(L"Extended resource sharing", d3d11opts.ExtendedResourceSharing); } if (fl >= D3D_FEATURE_LEVEL_11_0) { - LVYESNO("Saturating Add Instruction", d3d11opts.SAD4ShaderInstructions); + LVYESNO(L"Saturating Add Instruction", d3d11opts.SAD4ShaderInstructions); } - LVYESNO("Tile-based Deferred Renderer", d3d11arch.TileBasedDeferredRenderer); + LVYESNO(L"Tile-based Deferred Renderer", d3d11arch.TileBasedDeferredRenderer); - LVLINE("Non-Power-of-2 Textures", nonpow2); + LVLINE(L"Non-Power-of-2 Textures", nonpow2); - LVLINE("Pixel Shader Precision", ps_precis); - LVLINE("Other Stage Precision", other_precis); + LVLINE(L"Pixel Shader Precision", ps_precis); + LVLINE(L"Other Stage Precision", other_precis); } else { - PRINTLINE("Feature Level", FLName(fl)); + PRINTLINE(L"Feature Level", FLName(fl)); - PRINTYESNO("Driver Concurrent Creates", threading.DriverConcurrentCreates); - PRINTYESNO("Driver Command Lists", threading.DriverCommandLists); - PRINTLINE("Double-precision Shaders", double_shaders); - PRINTYESNO("DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); + PRINTYESNO(L"Driver Concurrent Creates", threading.DriverConcurrentCreates); + PRINTYESNO(L"Driver Command Lists", threading.DriverCommandLists); + PRINTLINE(L"Double-precision Shaders", double_shaders); + PRINTYESNO(L"DirectCompute CS 4.x", d3d10xhw.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x); - PRINTYESNO("Driver sees DiscardResource/View", d3d11opts.DiscardAPIsSeenByDriver); - PRINTYESNO("Driver sees COPY_FLAGS", d3d11opts.FlagsForUpdateAndCopySeenByDriver); - PRINTLINE("ClearView", clearview); - PRINTYESNO("Copy w/ Overlapping Rect", d3d11opts.CopyWithOverlap); - PRINTYESNO("CB Partial Update", d3d11opts.ConstantBufferPartialUpdate); - PRINTYESNO("CB Offsetting", d3d11opts.ConstantBufferOffsetting); - PRINTYESNO("Map NO_OVERWRITE on Dynamic CB", d3d11opts.MapNoOverwriteOnDynamicConstantBuffer); + PRINTYESNO(L"Driver sees DiscardResource/View", d3d11opts.DiscardAPIsSeenByDriver); + PRINTYESNO(L"Driver sees COPY_FLAGS", d3d11opts.FlagsForUpdateAndCopySeenByDriver); + PRINTLINE(L"ClearView", clearview); + PRINTYESNO(L"Copy w/ Overlapping Rect", d3d11opts.CopyWithOverlap); + PRINTYESNO(L"CB Partial Update", d3d11opts.ConstantBufferPartialUpdate); + PRINTYESNO(L"CB Offsetting", d3d11opts.ConstantBufferOffsetting); + PRINTYESNO(L"Map NO_OVERWRITE on Dynamic CB", d3d11opts.MapNoOverwriteOnDynamicConstantBuffer); if (fl >= D3D_FEATURE_LEVEL_10_0) { - PRINTYESNO("Map NO_OVERWRITE on Dynamic SRV", d3d11opts.MapNoOverwriteOnDynamicBufferSRV); - PRINTYESNO("MSAA with ForcedSampleCount=1", d3d11opts.MultisampleRTVWithForcedSampleCountOne); - PRINTYESNO("Extended resource sharing", d3d11opts.ExtendedResourceSharing); + PRINTYESNO(L"Map NO_OVERWRITE on Dynamic SRV", d3d11opts.MapNoOverwriteOnDynamicBufferSRV); + PRINTYESNO(L"MSAA with ForcedSampleCount=1", d3d11opts.MultisampleRTVWithForcedSampleCountOne); + PRINTYESNO(L"Extended resource sharing", d3d11opts.ExtendedResourceSharing); } if (fl >= D3D_FEATURE_LEVEL_11_0) { - PRINTYESNO("Saturating Add Instruction", d3d11opts.SAD4ShaderInstructions); + PRINTYESNO(L"Saturating Add Instruction", d3d11opts.SAD4ShaderInstructions); } - PRINTYESNO("Tile-based Deferred Renderer", d3d11arch.TileBasedDeferredRenderer); + PRINTYESNO(L"Tile-based Deferred Renderer", d3d11arch.TileBasedDeferredRenderer); - PRINTLINE("Non-Power-of-2 Textures", nonpow2); + PRINTLINE(L"Non-Power-of-2 Textures", nonpow2); - PRINTLINE("Pixel Shader Precision", ps_precis); - PRINTLINE("Other Stage Precision", other_precis); + PRINTLINE(L"Pixel Shader Precision", ps_precis); + PRINTLINE(L"Other Stage Precision", other_precis); } } @@ -3297,16 +3283,16 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); if (lParam2 == D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET) { - LVAddColumn(g_hwndLV, 1, "Value", 25); - LVAddColumn(g_hwndLV, 2, "Quality Level", 25); + LVAddColumn(g_hwndLV, 1, L"Value", 25); + LVAddColumn(g_hwndLV, 2, L"Quality Level", 25); } else { - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } } @@ -3318,7 +3304,7 @@ namespace D3D11FeatureSupportInfo1(pDevice, false, pPrintInfo); // Setup note - const char* szNote = nullptr; + const WCHAR* szNote = nullptr; switch (fl) { @@ -3344,11 +3330,11 @@ namespace if (!pPrintInfo) { - LVLINE("Note", szNote); + LVLINE(L"Note", szNote); } else { - PRINTLINE("Note", szNote); + PRINTLINE(L"Note", szNote); } return S_OK; @@ -3626,20 +3612,20 @@ namespace if (g_dwViewState == IDM_VIEWALL || msaa) { LVAddText(g_hwndLV, 0, FormatName(fmt)); - LVAddText(g_hwndLV, 1, msaa ? c_szYes : c_szNo); \ + LVAddText(g_hwndLV, 1, msaa ? c_szYes : c_szNo); - TCHAR strBuffer[16]; - sprintf_s(strBuffer, 16, "%u", msaa ? quality : 0); + WCHAR strBuffer[16]; + swprintf_s(strBuffer, 16, L"%u", msaa ? quality : 0); LVAddText(g_hwndLV, 2, strBuffer); } } else { - TCHAR strBuffer[32]; + WCHAR strBuffer[32]; if (msaa) - sprintf_s(strBuffer, 32, "Yes (%u)", quality); + swprintf_s(strBuffer, 32, L"Yes (%u)", quality); else - strcpy_s(strBuffer, 32, c_szNo); + wcscpy_s(strBuffer, 32, c_szNo); PrintStringValueLine(FormatName(fmt), strBuffer, pPrintInfo); } @@ -3691,8 +3677,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } // General Direct3D 11.2 device information @@ -3705,7 +3691,7 @@ namespace auto marker = GetD3D11Options(pDevice); // Setup note - const char* szNote = nullptr; + const WCHAR* szNote = nullptr; switch (fl) { @@ -3735,15 +3721,15 @@ namespace if (!pPrintInfo) { - LVYESNO("Profile Marker Support", marker.Profile); + LVYESNO(L"Profile Marker Support", marker.Profile); - LVLINE("Note", szNote); + LVLINE(L"Note", szNote); } else { - PRINTYESNO("Profile Marker Support", marker.Profile); + PRINTYESNO(L"Profile Marker Support", marker.Profile); - PRINTLINE("Note", szNote); + PRINTLINE(L"Note", szNote); } return S_OK; @@ -3869,8 +3855,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } // General Direct3D 11.3/11.4 device information @@ -3889,7 +3875,7 @@ namespace auto d3d11vm = GetD3D11Options(pDevice); // Setup note - const char* szNote = nullptr; + const WCHAR* szNote = nullptr; switch (fl) { @@ -3917,108 +3903,108 @@ namespace break; } - char tiled_rsc[16]; + WCHAR tiled_rsc[16]; if (d3d11opts2.TiledResourcesTier == D3D11_TILED_RESOURCES_NOT_SUPPORTED) - strcpy_s(tiled_rsc, "Not supported"); + wcscpy_s(tiled_rsc, L"Not supported"); else - sprintf_s(tiled_rsc, "Tier %d", d3d11opts2.TiledResourcesTier); + swprintf_s(tiled_rsc, L"Tier %d", d3d11opts2.TiledResourcesTier); - char consrv_rast[16]; + WCHAR consrv_rast[16]; if (d3d11opts2.ConservativeRasterizationTier == D3D11_CONSERVATIVE_RASTERIZATION_NOT_SUPPORTED) - strcpy_s(consrv_rast, "Not supported"); + wcscpy_s(consrv_rast, L"Not supported"); else - sprintf_s(consrv_rast, "Tier %d", d3d11opts2.ConservativeRasterizationTier); + swprintf_s(consrv_rast, L"Tier %d", d3d11opts2.ConservativeRasterizationTier); - const char* sharedResTier = nullptr; + const WCHAR* sharedResTier = nullptr; switch (d3d11opts5.SharedResourceTier) { - case D3D11_SHARED_RESOURCE_TIER_0: sharedResTier = "Yes - Tier 0"; break; - case D3D11_SHARED_RESOURCE_TIER_1: sharedResTier = "Yes - Tier 1"; break; - case D3D11_SHARED_RESOURCE_TIER_2: sharedResTier = "Yes - Tier 2"; break; - case D3D11_SHARED_RESOURCE_TIER_3: sharedResTier = "Yes - Tier 3"; break; + case D3D11_SHARED_RESOURCE_TIER_0: sharedResTier = L"Yes - Tier 0"; break; + case D3D11_SHARED_RESOURCE_TIER_1: sharedResTier = L"Yes - Tier 1"; break; + case D3D11_SHARED_RESOURCE_TIER_2: sharedResTier = L"Yes - Tier 2"; break; + case D3D11_SHARED_RESOURCE_TIER_3: sharedResTier = L"Yes - Tier 3"; break; default: sharedResTier = c_szYes; break; } - char vmRes[16]; - sprintf_s(vmRes, 16, "%u", d3d11vm.MaxGPUVirtualAddressBitsPerResource); + WCHAR vmRes[16]; + swprintf_s(vmRes, L"%u", d3d11vm.MaxGPUVirtualAddressBitsPerResource); - char vmProcess[16]; - sprintf_s(vmProcess, 16, "%u", d3d11vm.MaxGPUVirtualAddressBitsPerProcess); + WCHAR vmProcess[16]; + swprintf_s(vmProcess, L"%u", d3d11vm.MaxGPUVirtualAddressBitsPerProcess); - char shaderCache[32] = {}; + WCHAR shaderCache[32] = {}; if (d3d11sc.SupportFlags) { if (d3d11sc.SupportFlags & D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE) { - strcat_s(shaderCache, "In-Proc "); + wcscat_s(shaderCache, L"In-Proc "); } if (d3d11sc.SupportFlags & D3D11_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE) { - strcat_s(shaderCache, "Disk "); + wcscat_s(shaderCache, L"Disk "); } } else { - strcpy_s(shaderCache, "None"); + wcscpy_s(shaderCache, L"None"); } if (!pPrintInfo) { - LVYESNO("Profile Marker Support", marker.Profile); + LVYESNO(L"Profile Marker Support", marker.Profile); - LVYESNO("Map DEFAULT Textures", d3d11opts2.MapOnDefaultTextures); - LVYESNO("Standard Swizzle", d3d11opts2.StandardSwizzle); - LVYESNO("Unified Memory Architecture (UMA)", d3d11opts2.UnifiedMemoryArchitecture); - LVYESNO("Extended formats TypedUAVLoad", d3d11opts2.TypedUAVLoadAdditionalFormats); + LVYESNO(L"Map DEFAULT Textures", d3d11opts2.MapOnDefaultTextures); + LVYESNO(L"Standard Swizzle", d3d11opts2.StandardSwizzle); + LVYESNO(L"Unified Memory Architecture (UMA)", d3d11opts2.UnifiedMemoryArchitecture); + LVYESNO(L"Extended formats TypedUAVLoad", d3d11opts2.TypedUAVLoadAdditionalFormats); - LVLINE("Conservative Rasterization", consrv_rast); - LVLINE("Tiled Resources", tiled_rsc); - LVYESNO("PS-Specified Stencil Ref", d3d11opts2.PSSpecifiedStencilRefSupported); - LVYESNO("Rasterizer Ordered Views", d3d11opts2.ROVsSupported); + LVLINE(L"Conservative Rasterization", consrv_rast); + LVLINE(L"Tiled Resources", tiled_rsc); + LVYESNO(L"PS-Specified Stencil Ref", d3d11opts2.PSSpecifiedStencilRefSupported); + LVYESNO(L"Rasterizer Ordered Views", d3d11opts2.ROVsSupported); - LVYESNO("VP/RT from Rast-feeding Shader", d3d11opts3.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer); + LVYESNO(L"VP/RT from Rast-feeding Shader", d3d11opts3.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer); if (lParam3 != 0) { - LVLINE("Max GPU VM bits per resource", vmRes); - LVLINE("Max GPU VM bits per process", vmProcess); + LVLINE(L"Max GPU VM bits per resource", vmRes); + LVLINE(L"Max GPU VM bits per process", vmProcess); - LVYESNO("Extended Shared NV12", d3d11opts4.ExtendedNV12SharedTextureSupported); - LVLINE("Shader Cache", shaderCache); + LVYESNO(L"Extended Shared NV12", d3d11opts4.ExtendedNV12SharedTextureSupported); + LVLINE(L"Shader Cache", shaderCache); - LVLINE("Shared Resource Tier", sharedResTier); + LVLINE(L"Shared Resource Tier", sharedResTier); } - LVLINE("Note", szNote); + LVLINE(L"Note", szNote); } else { - PRINTYESNO("Profile Marker Support", marker.Profile); + PRINTYESNO(L"Profile Marker Support", marker.Profile); - PRINTYESNO("Map DEFAULT Textures", d3d11opts2.MapOnDefaultTextures); - PRINTYESNO("Standard Swizzle", d3d11opts2.StandardSwizzle); - PRINTYESNO("Unified Memory Architecture (UMA)", d3d11opts2.UnifiedMemoryArchitecture); - PRINTYESNO("Extended formats TypedUAVLoad", d3d11opts2.TypedUAVLoadAdditionalFormats); + PRINTYESNO(L"Map DEFAULT Textures", d3d11opts2.MapOnDefaultTextures); + PRINTYESNO(L"Standard Swizzle", d3d11opts2.StandardSwizzle); + PRINTYESNO(L"Unified Memory Architecture (UMA)", d3d11opts2.UnifiedMemoryArchitecture); + PRINTYESNO(L"Extended formats TypedUAVLoad", d3d11opts2.TypedUAVLoadAdditionalFormats); - PRINTLINE("Conservative Rasterization", consrv_rast); - PRINTLINE("Tiled Resources", tiled_rsc); - PRINTYESNO("PS-Specified Stencil Ref", d3d11opts2.PSSpecifiedStencilRefSupported); - PRINTYESNO("Rasterizer Ordered Views", d3d11opts2.ROVsSupported); + PRINTLINE(L"Conservative Rasterization", consrv_rast); + PRINTLINE(L"Tiled Resources", tiled_rsc); + PRINTYESNO(L"PS-Specified Stencil Ref", d3d11opts2.PSSpecifiedStencilRefSupported); + PRINTYESNO(L"Rasterizer Ordered Views", d3d11opts2.ROVsSupported); - PRINTYESNO("VP/RT from Rast-feeding Shader", d3d11opts3.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer); + PRINTYESNO(L"VP/RT from Rast-feeding Shader", d3d11opts3.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer); if (lParam3 != 0) { - PRINTLINE("Max GPU VM bits per resource", vmRes); - PRINTLINE("Max GPU VM bits per process", vmProcess); + PRINTLINE(L"Max GPU VM bits per resource", vmRes); + PRINTLINE(L"Max GPU VM bits per process", vmProcess); - PRINTYESNO("Extended Shared NV12", d3d11opts4.ExtendedNV12SharedTextureSupported); - PRINTLINE("Shader Cache", shaderCache); + PRINTYESNO(L"Extended Shared NV12", d3d11opts4.ExtendedNV12SharedTextureSupported); + PRINTLINE(L"Shader Cache", shaderCache); - PRINTLINE("Shared Resource Tier", sharedResTier); + PRINTLINE(L"Shared Resource Tier", sharedResTier); } - PRINTLINE("Note", szNote); + PRINTLINE(L"Note", szNote); } return S_OK; @@ -4145,7 +4131,7 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); UINT column = 1; for (UINT samples = 2; samples <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; ++samples) @@ -4153,8 +4139,8 @@ namespace if (!sampCount[samples - 1] && !IsMSAAPowerOf2(samples)) continue; - TCHAR strBuffer[8]; - sprintf_s(strBuffer, 8, "%ux", samples); + WCHAR strBuffer[8]; + swprintf_s(strBuffer, 8, L"%ux", samples); LVAddColumn(g_hwndLV, column, strBuffer, 8); ++column; } @@ -4202,8 +4188,8 @@ namespace if (sampQ[samples - 1] > 0) { - TCHAR strBuffer[32]; - sprintf_s(strBuffer, 32, "Yes (%u)", sampQ[samples - 1]); + WCHAR strBuffer[32]; + swprintf_s(strBuffer, 32, L"Yes (%u)", sampQ[samples - 1]); LVAddText(g_hwndLV, column, strBuffer); } else @@ -4214,7 +4200,7 @@ namespace } else { - TCHAR buff[1024]; + WCHAR buff[1024]; *buff = 0; for (UINT samples = 2; samples <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; ++samples) @@ -4222,13 +4208,13 @@ namespace if (!sampCount[samples - 1] && !IsMSAAPowerOf2(samples)) continue; - TCHAR strBuffer[32]; + WCHAR strBuffer[32]; if (sampQ[samples - 1] > 0) - sprintf_s(strBuffer, 32, "%ux: Yes (%u) ", samples, sampQ[samples - 1]); + swprintf_s(strBuffer, 32, L"%ux: Yes (%u) ", samples, sampQ[samples - 1]); else - sprintf_s(strBuffer, 32, "%ux: No ", samples); + swprintf_s(strBuffer, 32, L"%ux: No ", samples); - strcat_s(buff, 1024, strBuffer); + wcscat_s(buff, 1024, strBuffer); } PrintStringValueLine(FormatName(fmt), buff, pPrintInfo); @@ -4305,11 +4291,11 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Texture2D", 15); - LVAddColumn(g_hwndLV, 2, "Input", 15); - LVAddColumn(g_hwndLV, 3, "Output", 15); - LVAddColumn(g_hwndLV, 4, "Encoder", 15); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Texture2D", 15); + LVAddColumn(g_hwndLV, 2, L"Input", 15); + LVAddColumn(g_hwndLV, 3, L"Output", 15); + LVAddColumn(g_hwndLV, 4, L"Encoder", 15); } static const DXGI_FORMAT cfsVideo[] = @@ -4359,9 +4345,9 @@ namespace } else { - TCHAR buff[1024]; + WCHAR buff[1024]; - sprintf_s(buff, "Texture2D: %-3s Input: %-3s Output: %-3s Encoder: %-3s", + swprintf_s(buff, L"Texture2D: %-3s Input: %-3s Output: %-3s Encoder: %-3s", (fmtSupport & D3D11_FORMAT_SUPPORT_TEXTURE2D) ? c_szYes : c_szNo, (fmtSupport & D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_INPUT) ? c_szYes : c_szNo, (fmtSupport & D3D11_FORMAT_SUPPORT_VIDEO_PROCESSOR_OUTPUT) ? c_szYes : c_szNo, @@ -4385,8 +4371,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } auto d3d12opts = GetD3D12Options(pDevice); @@ -4399,98 +4385,98 @@ namespace auto d3d12eheaps = GetD3D12Options(pDevice); auto d3d12serial = GetD3D12Options(pDevice); - const char* shaderModel = "Unknown"; + const WCHAR* shaderModel = L"Unknown"; switch (GetD3D12ShaderModel(pDevice)) { - case D3D_SHADER_MODEL_6_9: shaderModel = "6.9"; break; - case D3D_SHADER_MODEL_6_8: shaderModel = "6.8"; break; - case D3D_SHADER_MODEL_6_7: shaderModel = "6.7"; break; - case D3D_SHADER_MODEL_6_6: shaderModel = "6.6"; break; - case D3D_SHADER_MODEL_6_5: shaderModel = "6.5"; break; - case D3D_SHADER_MODEL_6_4: shaderModel = "6.4"; break; - case D3D_SHADER_MODEL_6_3: shaderModel = "6.3"; break; - case D3D_SHADER_MODEL_6_2: shaderModel = "6.2"; break; - case D3D_SHADER_MODEL_6_1: shaderModel = "6.1"; break; - case D3D_SHADER_MODEL_6_0: shaderModel = "6.0"; break; - case D3D_SHADER_MODEL_5_1: shaderModel = "5.1"; break; + case D3D_SHADER_MODEL_6_9: shaderModel = L"6.9"; break; + case D3D_SHADER_MODEL_6_8: shaderModel = L"6.8"; break; + case D3D_SHADER_MODEL_6_7: shaderModel = L"6.7"; break; + case D3D_SHADER_MODEL_6_6: shaderModel = L"6.6"; break; + case D3D_SHADER_MODEL_6_5: shaderModel = L"6.5"; break; + case D3D_SHADER_MODEL_6_4: shaderModel = L"6.4"; break; + case D3D_SHADER_MODEL_6_3: shaderModel = L"6.3"; break; + case D3D_SHADER_MODEL_6_2: shaderModel = L"6.2"; break; + case D3D_SHADER_MODEL_6_1: shaderModel = L"6.1"; break; + case D3D_SHADER_MODEL_6_0: shaderModel = L"6.0"; break; + case D3D_SHADER_MODEL_5_1: shaderModel = L"5.1"; break; } - const char* rootSig = "Unknown"; + const WCHAR* rootSig = L"Unknown"; switch (GetD3D12RootSignature(pDevice)) { - case D3D_ROOT_SIGNATURE_VERSION_1_0: rootSig = "1.0"; break; - case D3D_ROOT_SIGNATURE_VERSION_1_1: rootSig = "1.1"; break; - case D3D_ROOT_SIGNATURE_VERSION_1_2: rootSig = "1.2"; break; + case D3D_ROOT_SIGNATURE_VERSION_1_0: rootSig = L"1.0"; break; + case D3D_ROOT_SIGNATURE_VERSION_1_1: rootSig = L"1.1"; break; + case D3D_ROOT_SIGNATURE_VERSION_1_2: rootSig = L"1.2"; break; } - char heap[16]; - sprintf_s(heap, "Tier %d", d3d12opts.ResourceHeapTier); + WCHAR heap[16]; + swprintf_s(heap, L"Tier %d", d3d12opts.ResourceHeapTier); - char tiled_rsc[64] = {}; + WCHAR tiled_rsc[64] = {}; if (d3d12opts.TiledResourcesTier == D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED) - strcpy_s(tiled_rsc, "Not supported"); + wcscpy_s(tiled_rsc, L"Not supported"); else { - sprintf_s(tiled_rsc, "Tier %d", d3d12opts.TiledResourcesTier); + swprintf_s(tiled_rsc, L"Tier %d", d3d12opts.TiledResourcesTier); if ((d3d12opts.TiledResourcesTier < D3D12_TILED_RESOURCES_TIER_3) && d3d12opts5.SRVOnlyTiledResourceTier3) { - strcat_s(tiled_rsc, " (plus SRV only Volume textures)"); + wcscat_s(tiled_rsc, L" (plus SRV only Volume textures)"); } } - char consrv_rast[16]; + WCHAR consrv_rast[16]; if (d3d12opts.ConservativeRasterizationTier == D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED) - strcpy_s(consrv_rast, "Not supported"); + wcscpy_s(consrv_rast, L"Not supported"); else - sprintf_s(consrv_rast, "Tier %d", d3d12opts.ConservativeRasterizationTier); + swprintf_s(consrv_rast, L"Tier %d", d3d12opts.ConservativeRasterizationTier); - char binding_rsc[16]; - sprintf_s(binding_rsc, "Tier %d", d3d12opts.ResourceBindingTier); + WCHAR binding_rsc[16]; + swprintf_s(binding_rsc, L"Tier %d", d3d12opts.ResourceBindingTier); - const char* prgSamplePos = nullptr; + const WCHAR* prgSamplePos = nullptr; switch (d3d12opts2.ProgrammableSamplePositionsTier) { case D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED: prgSamplePos = c_szNo; break; - case D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1: prgSamplePos = "Yes - Tier 1"; break; - case D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2: prgSamplePos = "Yes - Tier 2"; break; + case D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1: prgSamplePos = L"Yes - Tier 1"; break; + case D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2: prgSamplePos = L"Yes - Tier 2"; break; default: prgSamplePos = c_szYes; break; } - const char* viewInstTier = nullptr; + const WCHAR* viewInstTier = nullptr; switch (d3d12opts3.ViewInstancingTier) { case D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED: viewInstTier = c_szNo; break; - case D3D12_VIEW_INSTANCING_TIER_1: viewInstTier = "Yes - Tier 1"; break; - case D3D12_VIEW_INSTANCING_TIER_2: viewInstTier = "Yes - Tier 2"; break; - case D3D12_VIEW_INSTANCING_TIER_3: viewInstTier = "Yes - Tier 3"; break; + case D3D12_VIEW_INSTANCING_TIER_1: viewInstTier = L"Yes - Tier 1"; break; + case D3D12_VIEW_INSTANCING_TIER_2: viewInstTier = L"Yes - Tier 2"; break; + case D3D12_VIEW_INSTANCING_TIER_3: viewInstTier = L"Yes - Tier 3"; break; default: viewInstTier = c_szYes; break; } - const char* renderPasses = nullptr; + const WCHAR* renderPasses = nullptr; switch (d3d12opts5.RenderPassesTier) { case D3D12_RENDER_PASS_TIER_0: renderPasses = c_szNo; break; - case D3D12_RENDER_PASS_TIER_1: renderPasses = "Yes - Tier 1"; break; - case D3D12_RENDER_PASS_TIER_2: renderPasses = "Yes - Tier 2"; break; + case D3D12_RENDER_PASS_TIER_1: renderPasses = L"Yes - Tier 1"; break; + case D3D12_RENDER_PASS_TIER_2: renderPasses = L"Yes - Tier 2"; break; default: renderPasses = c_szYes; break; } - const char* dxr = nullptr; + const WCHAR* dxr = nullptr; switch (d3d12opts5.RaytracingTier) { case D3D12_RAYTRACING_TIER_NOT_SUPPORTED: dxr = c_szNo; break; - case D3D12_RAYTRACING_TIER_1_0: dxr = "Yes - Tier 1.0"; break; - case D3D12_RAYTRACING_TIER_1_1: dxr = "Yes - Tier 1.1"; break; + case D3D12_RAYTRACING_TIER_1_0: dxr = L"Yes - Tier 1.0"; break; + case D3D12_RAYTRACING_TIER_1_1: dxr = L"Yes - Tier 1.1"; break; default: dxr = c_szYes; break; } - const char* heapSerial = nullptr; + const WCHAR* heapSerial = nullptr; switch (d3d12serial.HeapSerializationTier) { case D3D12_HEAP_SERIALIZATION_TIER_0: heapSerial = c_szNo; break; - case D3D12_HEAP_SERIALIZATION_TIER_10: heapSerial = "Yes - Tier 10"; break; + case D3D12_HEAP_SERIALIZATION_TIER_10: heapSerial = L"Yes - Tier 10"; break; default: heapSerial = c_szYes; break; } @@ -4502,18 +4488,18 @@ namespace auto d3d12opts12 = GetD3D12Options(pDevice); auto d3d12opts13 = GetD3D12Options(pDevice); - char vp_flips[16] = {}; + WCHAR vp_flips[16] = {}; if (d3d12opts13.InvertedViewportHeightFlipsYSupported) { - strcat_s(vp_flips, "Y "); + wcscat_s(vp_flips, L"Y "); } if (d3d12opts13.InvertedViewportDepthFlipsZSupported) { - strcat_s(vp_flips, "Z "); + wcscat_s(vp_flips, L"Z "); } if (vp_flips[0] == 0) { - strcpy_s(vp_flips, c_szNo); + wcscpy_s(vp_flips, c_szNo); } #endif @@ -4536,130 +4522,130 @@ namespace if (!pPrintInfo) { - LVLINE("Feature Level", FLName(fl)); - LVLINE("Shader Model", shaderModel); - LVLINE("Root Signature", rootSig); + LVLINE(L"Feature Level", FLName(fl)); + LVLINE(L"Shader Model", shaderModel); + LVLINE(L"Root Signature", rootSig); - LVYESNO("Standard Swizzle 64KB", d3d12opts.StandardSwizzle64KBSupported); - LVYESNO("Extended formats TypedUAVLoad", d3d12opts.TypedUAVLoadAdditionalFormats); + LVYESNO(L"Standard Swizzle 64KB", d3d12opts.StandardSwizzle64KBSupported); + LVYESNO(L"Extended formats TypedUAVLoad", d3d12opts.TypedUAVLoadAdditionalFormats); - LVLINE("Conservative Rasterization", consrv_rast); - LVLINE("Resource Binding", binding_rsc); - LVLINE("Tiled Resources", tiled_rsc); - LVLINE("Resource Heap", heap); - LVYESNO("Rasterizer Ordered Views", d3d12opts.ROVsSupported); + LVLINE(L"Conservative Rasterization", consrv_rast); + LVLINE(L"Resource Binding", binding_rsc); + LVLINE(L"Tiled Resources", tiled_rsc); + LVLINE(L"Resource Heap", heap); + LVYESNO(L"Rasterizer Ordered Views", d3d12opts.ROVsSupported); - LVYESNO("VP/RT without GS Emulation", d3d12opts.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation); + LVYESNO(L"VP/RT without GS Emulation", d3d12opts.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation); - LVYESNO("Depth bound test supported", d3d12opts2.DepthBoundsTestSupported); - LVLINE("Programmable Sample Positions", prgSamplePos); + LVYESNO(L"Depth bound test supported", d3d12opts2.DepthBoundsTestSupported); + LVLINE(L"Programmable Sample Positions", prgSamplePos); - LVLINE("View Instancing", viewInstTier); + LVLINE(L"View Instancing", viewInstTier); - LVYESNO("Casting fully typed formats", d3d12opts3.CastingFullyTypedFormatSupported); - LVYESNO("Copy queue timestamp queries", d3d12opts3.CopyQueueTimestampQueriesSupported); + LVYESNO(L"Casting fully typed formats", d3d12opts3.CastingFullyTypedFormatSupported); + LVYESNO(L"Copy queue timestamp queries", d3d12opts3.CopyQueueTimestampQueriesSupported); - LVYESNO("Create heaps from existing system memory", d3d12eheaps.Supported); + LVYESNO(L"Create heaps from existing system memory", d3d12eheaps.Supported); - LVYESNO("64KB aligned MSAA textures", d3d12opts4.MSAA64KBAlignedTextureSupported); + LVYESNO(L"64KB aligned MSAA textures", d3d12opts4.MSAA64KBAlignedTextureSupported); - LVLINE("Heap serialization", heapSerial); + LVLINE(L"Heap serialization", heapSerial); - LVLINE("Render Passes", renderPasses); + LVLINE(L"Render Passes", renderPasses); - LVLINE("DirectX Raytracing", dxr); + LVLINE(L"DirectX Raytracing", dxr); - LVYESNO("Background processing supported", d3d12opts6.BackgroundProcessingSupported); + LVYESNO(L"Background processing supported", d3d12opts6.BackgroundProcessingSupported); #if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) - LVYESNO("Unaligned BC texture (not a multiple of 4)", d3d12opts8.UnalignedBlockTexturesSupported); + LVYESNO(L"Unaligned BC texture (not a multiple of 4)", d3d12opts8.UnalignedBlockTexturesSupported); #endif #if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) - LVYESNO("Enhanced Barriers", d3d12opts12.EnhancedBarriersSupported); - LVYESNO("Relaxed format casting", d3d12opts12.RelaxedFormatCastingSupported); - LVYESNO("Alpha blend factor support", d3d12opts13.AlphaBlendFactorSupported); - LVYESNO("Unrestricted buffer/texture copy pitch", d3d12opts13.UnrestrictedBufferTextureCopyPitchSupported); - LVYESNO("Unrestricted vertex alignment", d3d12opts13.UnrestrictedVertexElementAlignmentSupported); - LVYESNO("Copy between textures of any dimension", d3d12opts13.TextureCopyBetweenDimensionsSupported); - LVLINE("Inverted viewport flips support", vp_flips) + LVYESNO(L"Enhanced Barriers", d3d12opts12.EnhancedBarriersSupported); + LVYESNO(L"Relaxed format casting", d3d12opts12.RelaxedFormatCastingSupported); + LVYESNO(L"Alpha blend factor support", d3d12opts13.AlphaBlendFactorSupported); + LVYESNO(L"Unrestricted buffer/texture copy pitch", d3d12opts13.UnrestrictedBufferTextureCopyPitchSupported); + LVYESNO(L"Unrestricted vertex alignment", d3d12opts13.UnrestrictedVertexElementAlignmentSupported); + LVYESNO(L"Copy between textures of any dimension", d3d12opts13.TextureCopyBetweenDimensionsSupported); + LVLINE(L"Inverted viewport flips support", vp_flips) #endif #if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) - LVYESNO("Independent front/back stencil refmask", d3d12opts14.IndependentFrontAndBackStencilRefMaskSupported); - LVYESNO("Triangle fans primitives", d3d12opts15.TriangleFanSupported); - LVYESNO("Dynamic IB strip-cut support", d3d12opts15.DynamicIndexBufferStripCutSupported); - LVYESNO("Dynamic depth bias support", d3d12opts16.DynamicDepthBiasSupported); - LVYESNO("GPU upload heap support", d3d12opts16.GPUUploadHeapSupported); + LVYESNO(L"Independent front/back stencil refmask", d3d12opts14.IndependentFrontAndBackStencilRefMaskSupported); + LVYESNO(L"Triangle fans primitives", d3d12opts15.TriangleFanSupported); + LVYESNO(L"Dynamic IB strip-cut support", d3d12opts15.DynamicIndexBufferStripCutSupported); + LVYESNO(L"Dynamic depth bias support", d3d12opts16.DynamicDepthBiasSupported); + LVYESNO(L"GPU upload heap support", d3d12opts16.GPUUploadHeapSupported); #endif #if defined(NTDDI_WIN11_GE) || defined(USING_D3D12_AGILITY_SDK) - LVYESNO("Non-normalized coordinate samplers", d3d12opts17.NonNormalizedCoordinateSamplersSupported); - LVYESNO("Manual write tracking res", d3d12opts17.ManualWriteTrackingResourceSupported); + LVYESNO(L"Non-normalized coordinate samplers", d3d12opts17.NonNormalizedCoordinateSamplersSupported); + LVYESNO(L"Manual write tracking res", d3d12opts17.ManualWriteTrackingResourceSupported); #endif } else { - PRINTLINE("Feature Level", FLName(fl)); - PRINTLINE("Shader Model", shaderModel); - PRINTLINE("Root Signature", rootSig); + PRINTLINE(L"Feature Level", FLName(fl)); + PRINTLINE(L"Shader Model", shaderModel); + PRINTLINE(L"Root Signature", rootSig); - PRINTYESNO("Standard Swizzle 64KB", d3d12opts.StandardSwizzle64KBSupported); - PRINTYESNO("Extended formats TypedUAVLoad", d3d12opts.TypedUAVLoadAdditionalFormats); + PRINTYESNO(L"Standard Swizzle 64KB", d3d12opts.StandardSwizzle64KBSupported); + PRINTYESNO(L"Extended formats TypedUAVLoad", d3d12opts.TypedUAVLoadAdditionalFormats); - PRINTLINE("Conservative Rasterization", consrv_rast); - PRINTLINE("Resource Binding", binding_rsc); - PRINTLINE("Tiled Resources", tiled_rsc); - PRINTLINE("Resource Heap", heap); - PRINTYESNO("Rasterizer Ordered Views", d3d12opts.ROVsSupported); + PRINTLINE(L"Conservative Rasterization", consrv_rast); + PRINTLINE(L"Resource Binding", binding_rsc); + PRINTLINE(L"Tiled Resources", tiled_rsc); + PRINTLINE(L"Resource Heap", heap); + PRINTYESNO(L"Rasterizer Ordered Views", d3d12opts.ROVsSupported); - PRINTYESNO("VP/RT without GS Emulation", d3d12opts.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation); + PRINTYESNO(L"VP/RT without GS Emulation", d3d12opts.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation); - PRINTYESNO("Depth bound test supported", d3d12opts2.DepthBoundsTestSupported); - PRINTLINE("Programmable Sample Positions", prgSamplePos); + PRINTYESNO(L"Depth bound test supported", d3d12opts2.DepthBoundsTestSupported); + PRINTLINE(L"Programmable Sample Positions", prgSamplePos); - PRINTLINE("View Instancing", viewInstTier); + PRINTLINE(L"View Instancing", viewInstTier); - PRINTYESNO("Casting fully typed formats", d3d12opts3.CastingFullyTypedFormatSupported); - PRINTYESNO("Copy queue timestamp queries", d3d12opts3.CopyQueueTimestampQueriesSupported); + PRINTYESNO(L"Casting fully typed formats", d3d12opts3.CastingFullyTypedFormatSupported); + PRINTYESNO(L"Copy queue timestamp queries", d3d12opts3.CopyQueueTimestampQueriesSupported); - PRINTYESNO("Create heaps from existing system memory", d3d12eheaps.Supported); + PRINTYESNO(L"Create heaps from existing system memory", d3d12eheaps.Supported); - PRINTYESNO("64KB aligned MSAA textures", d3d12opts4.MSAA64KBAlignedTextureSupported); + PRINTYESNO(L"64KB aligned MSAA textures", d3d12opts4.MSAA64KBAlignedTextureSupported); - PRINTLINE("Heap serialization", heapSerial); + PRINTLINE(L"Heap serialization", heapSerial); - PRINTLINE("Render Passes", renderPasses); + PRINTLINE(L"Render Passes", renderPasses); - PRINTLINE("DirectX Raytracing", dxr); + PRINTLINE(L"DirectX Raytracing", dxr); - PRINTYESNO("Background processing supported", d3d12opts6.BackgroundProcessingSupported); + PRINTYESNO(L"Background processing supported", d3d12opts6.BackgroundProcessingSupported); #if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) - PRINTYESNO("Unaligned BC texture (not a multiple of 4)", d3d12opts8.UnalignedBlockTexturesSupported); + PRINTYESNO(L"Unaligned BC texture (not a multiple of 4)", d3d12opts8.UnalignedBlockTexturesSupported); #endif #if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) - PRINTYESNO("Enhanced Barriers", d3d12opts12.EnhancedBarriersSupported); - PRINTYESNO("Relaxed format casting", d3d12opts12.RelaxedFormatCastingSupported); - PRINTYESNO("Alpha blend factor support", d3d12opts13.AlphaBlendFactorSupported); - PRINTYESNO("Unrestricted buffer/texture copy pitch", d3d12opts13.UnrestrictedBufferTextureCopyPitchSupported); - PRINTYESNO("Unrestricted vertex alignment", d3d12opts13.UnrestrictedVertexElementAlignmentSupported); - PRINTYESNO("Copy between textures of any dimension", d3d12opts13.TextureCopyBetweenDimensionsSupported); - PRINTLINE("Inverted viewport flips support", vp_flips); + PRINTYESNO(L"Enhanced Barriers", d3d12opts12.EnhancedBarriersSupported); + PRINTYESNO(L"Relaxed format casting", d3d12opts12.RelaxedFormatCastingSupported); + PRINTYESNO(L"Alpha blend factor support", d3d12opts13.AlphaBlendFactorSupported); + PRINTYESNO(L"Unrestricted buffer/texture copy pitch", d3d12opts13.UnrestrictedBufferTextureCopyPitchSupported); + PRINTYESNO(L"Unrestricted vertex alignment", d3d12opts13.UnrestrictedVertexElementAlignmentSupported); + PRINTYESNO(L"Copy between textures of any dimension", d3d12opts13.TextureCopyBetweenDimensionsSupported); + PRINTLINE(L"Inverted viewport flips support", vp_flips); #endif #if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) - PRINTYESNO("Independent front/back stencil refmask", d3d12opts14.IndependentFrontAndBackStencilRefMaskSupported); - PRINTYESNO("Triangle fan primitives", d3d12opts15.TriangleFanSupported); - PRINTYESNO("Dynamic IB strip-cut support", d3d12opts15.DynamicIndexBufferStripCutSupported); - PRINTYESNO("Dynamic depth bias support", d3d12opts16.DynamicDepthBiasSupported); - PRINTYESNO("GPU upload heap support", d3d12opts16.GPUUploadHeapSupported); + PRINTYESNO(L"Independent front/back stencil refmask", d3d12opts14.IndependentFrontAndBackStencilRefMaskSupported); + PRINTYESNO(L"Triangle fan primitives", d3d12opts15.TriangleFanSupported); + PRINTYESNO(L"Dynamic IB strip-cut support", d3d12opts15.DynamicIndexBufferStripCutSupported); + PRINTYESNO(L"Dynamic depth bias support", d3d12opts16.DynamicDepthBiasSupported); + PRINTYESNO(L"GPU upload heap support", d3d12opts16.GPUUploadHeapSupported); #endif #if defined(NTDDI_WIN11_GE) || defined(USING_D3D12_AGILITY_SDK) - PRINTYESNO("Non-normalized coordinate samplers", d3d12opts17.NonNormalizedCoordinateSamplersSupported); - PRINTYESNO("Manual write tracking res", d3d12opts17.ManualWriteTrackingResourceSupported); + PRINTYESNO(L"Non-normalized coordinate samplers", d3d12opts17.NonNormalizedCoordinateSamplersSupported); + PRINTYESNO(L"Manual write tracking res", d3d12opts17.ManualWriteTrackingResourceSupported); #endif } @@ -4674,8 +4660,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } auto d3d12arch = GetD3D12Options(pDevice); @@ -4690,37 +4676,37 @@ namespace auto d3d12vm = GetD3D12Options(pDevice); - char vmRes[16]; - sprintf_s(vmRes, 16, "%u", d3d12vm.MaxGPUVirtualAddressBitsPerResource); + WCHAR vmRes[16]; + swprintf_s(vmRes, 16, L"%u", d3d12vm.MaxGPUVirtualAddressBitsPerResource); - char vmProcess[16]; - sprintf_s(vmProcess, 16, "%u", d3d12vm.MaxGPUVirtualAddressBitsPerProcess); + WCHAR vmProcess[16]; + swprintf_s(vmProcess, 16, L"%u", d3d12vm.MaxGPUVirtualAddressBitsPerProcess); if (!pPrintInfo) { - LVYESNO("Tile-based Renderer", d3d12arch.TileBasedRenderer); - LVYESNO("Unified Memory Architecture (UMA)", d3d12arch.UMA); - LVYESNO("Cache Coherent UMA", d3d12arch.CacheCoherentUMA); + LVYESNO(L"Tile-based Renderer", d3d12arch.TileBasedRenderer); + LVYESNO(L"Unified Memory Architecture (UMA)", d3d12arch.UMA); + LVYESNO(L"Cache Coherent UMA", d3d12arch.CacheCoherentUMA); if (usearch1) { - LVYESNO("Isolated MMU", d3d12arch1.IsolatedMMU); + LVYESNO(L"Isolated MMU", d3d12arch1.IsolatedMMU); } - LVLINE("Max GPU VM bits per resource", vmRes); - LVLINE("Max GPU VM bits per process", vmProcess); + LVLINE(L"Max GPU VM bits per resource", vmRes); + LVLINE(L"Max GPU VM bits per process", vmProcess); } else { - PRINTYESNO("Tile-based Renderer", d3d12arch.TileBasedRenderer); - PRINTYESNO("Unified Memory Architecture (UMA)", d3d12arch.UMA); - PRINTYESNO("Cache Coherent UMA", d3d12arch.CacheCoherentUMA); + PRINTYESNO(L"Tile-based Renderer", d3d12arch.TileBasedRenderer); + PRINTYESNO(L"Unified Memory Architecture (UMA)", d3d12arch.UMA); + PRINTYESNO(L"Cache Coherent UMA", d3d12arch.CacheCoherentUMA); if (usearch1) { - PRINTYESNO("Isolated MMU", d3d12arch1.IsolatedMMU); + PRINTYESNO(L"Isolated MMU", d3d12arch1.IsolatedMMU); } - PRINTLINE("Max GPU VM bits per resource", vmRes); - PRINTLINE("Max GPU VM bits per process", vmProcess); + PRINTLINE(L"Max GPU VM bits per resource", vmRes); + PRINTLINE(L"Max GPU VM bits per process", vmProcess); } return S_OK; @@ -4734,8 +4720,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } auto d3d12opts = GetD3D12Options(pDevice); @@ -4747,65 +4733,65 @@ namespace auto d3d12sc = GetD3D12Options(pDevice); - const char* precis = nullptr; + const WCHAR* precis = nullptr; switch (d3d12opts.MinPrecisionSupport & (D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT | D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT)) { - case 0: precis = "Full"; break; - case D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT: precis = "16/32-bit"; break; - case D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT: precis = "10/32-bit"; break; - default: precis = "10/16/32-bit"; break; + case 0: precis = L"Full"; break; + case D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT: precis = L"16/32-bit"; break; + case D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT: precis = L"10/32-bit"; break; + default: precis = L"10/16/32-bit"; break; } - char lane_count[16]; - sprintf_s(lane_count, "%u", d3d12opts1.TotalLaneCount); + WCHAR lane_count[16]; + swprintf_s(lane_count, L"%u", d3d12opts1.TotalLaneCount); - char wave_lane_count[16]; - sprintf_s(wave_lane_count, "%u/%u", d3d12opts1.WaveLaneCountMin, d3d12opts1.WaveLaneCountMax); + WCHAR wave_lane_count[16]; + swprintf_s(wave_lane_count, L"%u/%u", d3d12opts1.WaveLaneCountMin, d3d12opts1.WaveLaneCountMax); - const char* vrs = nullptr; + const WCHAR* vrs = nullptr; switch (d3d12opts6.VariableShadingRateTier) { case D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED: vrs = c_szNo; break; - case D3D12_VARIABLE_SHADING_RATE_TIER_1: vrs = "Yes - 1"; break; - case D3D12_VARIABLE_SHADING_RATE_TIER_2: vrs = "Yes - 2"; break; + case D3D12_VARIABLE_SHADING_RATE_TIER_1: vrs = L"Yes - 1"; break; + case D3D12_VARIABLE_SHADING_RATE_TIER_2: vrs = L"Yes - 2"; break; default: vrs = c_szYes; break; } - char vrs_tile_size[16]; - sprintf_s(vrs_tile_size, "%u", d3d12opts6.ShadingRateImageTileSize); + WCHAR vrs_tile_size[16]; + swprintf_s(vrs_tile_size, L"%u", d3d12opts6.ShadingRateImageTileSize); - const char* meshShaders = nullptr; + const WCHAR* meshShaders = nullptr; switch (d3d12opts7.MeshShaderTier) { case D3D12_MESH_SHADER_TIER_NOT_SUPPORTED: meshShaders = c_szNo; break; - case D3D12_MESH_SHADER_TIER_1: meshShaders = "Yes - Tier 1"; break; + case D3D12_MESH_SHADER_TIER_1: meshShaders = L"Yes - Tier 1"; break; default: meshShaders = c_szYes; break; } - const char* feedbackTier = nullptr; + const WCHAR* feedbackTier = nullptr; switch (d3d12opts7.SamplerFeedbackTier) { case D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED: feedbackTier = c_szNo; break; - case D3D12_SAMPLER_FEEDBACK_TIER_0_9: feedbackTier = "Yes - Tier 0.9"; break; - case D3D12_SAMPLER_FEEDBACK_TIER_1_0: feedbackTier = "Yes - Tier 1"; break; + case D3D12_SAMPLER_FEEDBACK_TIER_0_9: feedbackTier = L"Yes - Tier 0.9"; break; + case D3D12_SAMPLER_FEEDBACK_TIER_1_0: feedbackTier = L"Yes - Tier 1"; break; default: feedbackTier = c_szYes; break; } - const char* wavemmatier = nullptr; - const char* msderiv = nullptr; - const char* msrtarrayindex = nullptr; - char atomicInt64[64] = {}; + const WCHAR* wavemmatier = nullptr; + const WCHAR* msderiv = nullptr; + const WCHAR* msrtarrayindex = nullptr; + WCHAR atomicInt64[64] = {}; #if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) auto d3d12opts9 = GetD3D12Options(pDevice); if (d3d12opts9.AtomicInt64OnTypedResourceSupported) { - strcat_s(atomicInt64, "Typed "); + wcscat_s(atomicInt64, L"Typed "); } if (d3d12opts9.AtomicInt64OnGroupSharedSupported) { - strcat_s(atomicInt64, "GroupShared "); + wcscat_s(atomicInt64, L"GroupShared "); } msderiv = (d3d12opts9.DerivativesInMeshAndAmplificationShadersSupported) ? c_szYes : c_szNo; @@ -4814,54 +4800,54 @@ namespace switch (d3d12opts9.WaveMMATier) { case D3D12_WAVE_MMA_TIER_NOT_SUPPORTED: wavemmatier = c_szNo; break; - case D3D12_WAVE_MMA_TIER_1_0: wavemmatier = "Yes - Tier 1"; break; + case D3D12_WAVE_MMA_TIER_1_0: wavemmatier = L"Yes - Tier 1"; break; default: wavemmatier = c_szYes; break; } #endif // FE - char shaderCache[64] = {}; + WCHAR shaderCache[64] = {}; if (d3d12sc.SupportFlags) { if (d3d12sc.SupportFlags & D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO) { - strcat_s(shaderCache, "SinglePSO "); + wcscat_s(shaderCache, L"SinglePSO "); } if (d3d12sc.SupportFlags & D3D12_SHADER_CACHE_SUPPORT_LIBRARY) { - strcat_s(shaderCache, "Library "); + wcscat_s(shaderCache, L"Library "); } if (d3d12sc.SupportFlags & D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE) { - strcat_s(shaderCache, "In-Proc "); + wcscat_s(shaderCache, L"In-Proc "); } if (d3d12sc.SupportFlags & D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE) { - strcat_s(shaderCache, "Disk "); + wcscat_s(shaderCache, L"Disk "); } #if defined(NTDDI_WIN10_FE) || defined(USING_D3D12_AGILITY_SDK) if (d3d12sc.SupportFlags & D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE) { - strcat_s(shaderCache, "DrvMng "); + wcscat_s(shaderCache, L"DrvMng "); } #endif // FE #if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) if (d3d12sc.SupportFlags & D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR) { - strcat_s(shaderCache, "Clear "); + wcscat_s(shaderCache, L"Clear "); } if (d3d12sc.SupportFlags & D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE) { - strcat_s(shaderCache, "Delete "); + wcscat_s(shaderCache, L"Delete "); } #endif // CO } else { - strcpy_s(shaderCache, "None"); + wcscpy_s(shaderCache, L"None"); } - const char* vrssum = nullptr; - const char* msperprim = nullptr; + const WCHAR* vrssum = nullptr; + const WCHAR* msperprim = nullptr; #if defined(NTDDI_WIN10_CO) || defined(USING_D3D12_AGILITY_SDK) auto d3d12opts10 = GetD3D12Options(pDevice); vrssum = (d3d12opts10.VariableRateShadingSumCombinerSupported) ? c_szYes : c_szNo; @@ -4870,25 +4856,25 @@ namespace auto d3d12opts11 = GetD3D12Options(pDevice); if (d3d12opts11.AtomicInt64OnDescriptorHeapResourceSupported) { - strcat_s(atomicInt64, "DescHeap "); + wcscat_s(atomicInt64, L"DescHeap "); } #endif // CO - const char* ms_stats_culled = nullptr; + const WCHAR* ms_stats_culled = nullptr; #if defined(NTDDI_WIN10_NI) || defined(USING_D3D12_AGILITY_SDK) auto d3d12opts12 = GetD3D12Options(pDevice); ms_stats_culled = d3d12opts12.MSPrimitivesPipelineStatisticIncludesCulledPrimitives ? c_szYes : c_szNo; #endif - const char* adv_texture_ops = nullptr; - const char* writeable_msaa_txt = nullptr; + const WCHAR* adv_texture_ops = nullptr; + const WCHAR* writeable_msaa_txt = nullptr; #if defined(NTDDI_WIN10_CU) || defined(USING_D3D12_AGILITY_SDK) auto d3d12opts14 = GetD3D12Options(pDevice); adv_texture_ops = d3d12opts14.AdvancedTextureOpsSupported ? c_szYes : c_szNo; writeable_msaa_txt = d3d12opts14.WriteableMSAATexturesSupported ? c_szYes : c_szNo; #endif - const char* nonNormalizedCoords = nullptr; + const WCHAR* nonNormalizedCoords = nullptr; #if defined(NTDDI_WIN10_CU) auto d3d12opts17 = GetD3D12Options(pDevice); nonNormalizedCoords = d3d12opts17.NonNormalizedCoordinateSamplersSupported ? c_szYes : c_szNo; @@ -4896,172 +4882,172 @@ namespace if (!pPrintInfo) { - LVYESNO("Double-precision Shaders", d3d12opts.DoublePrecisionFloatShaderOps); + LVYESNO(L"Double-precision Shaders", d3d12opts.DoublePrecisionFloatShaderOps); - LVLINE("Minimum Precision", precis); - LVYESNO("Native 16-bit Shader Ops", d3d12opts4.Native16BitShaderOpsSupported); + LVLINE(L"Minimum Precision", precis); + LVYESNO(L"Native 16-bit Shader Ops", d3d12opts4.Native16BitShaderOpsSupported); - LVYESNO("Wave operations", d3d12opts1.WaveOps); + LVYESNO(L"Wave operations", d3d12opts1.WaveOps); if (d3d12opts1.WaveOps) { - LVLINE("Wave lane count", wave_lane_count); - LVLINE("Total lane count", lane_count); - LVYESNO("Expanded compute resource states", d3d12opts1.ExpandedComputeResourceStates); + LVLINE(L"Wave lane count", wave_lane_count); + LVLINE(L"Total lane count", lane_count); + LVYESNO(L"Expanded compute resource states", d3d12opts1.ExpandedComputeResourceStates); } if (wavemmatier) { - LVLINE("Wave MMA", wavemmatier); + LVLINE(L"Wave MMA", wavemmatier); } - LVYESNO("PS-Specified Stencil Ref", d3d12opts.PSSpecifiedStencilRefSupported); + LVYESNO(L"PS-Specified Stencil Ref", d3d12opts.PSSpecifiedStencilRefSupported); - LVYESNO("Barycentrics", d3d12opts3.BarycentricsSupported); + LVYESNO(L"Barycentrics", d3d12opts3.BarycentricsSupported); if (*atomicInt64) { - LVLINE("atomic", atomicInt64); + LVLINE(L"atomic", atomicInt64); } - LVLINE("Variable Rate Shading (VRS)", vrs); + LVLINE(L"Variable Rate Shading (VRS)", vrs); if (d3d12opts6.VariableShadingRateTier != D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED) { - LVYESNO("VRS: Additional shading rates", d3d12opts6.AdditionalShadingRatesSupported); - LVYESNO("VRS: Per-primitive SV_ViewportIndex", d3d12opts6.PerPrimitiveShadingRateSupportedWithViewportIndexing); - LVLINE("VRS: Screen-space tile size", vrs_tile_size); + LVYESNO(L"VRS: Additional shading rates", d3d12opts6.AdditionalShadingRatesSupported); + LVYESNO(L"VRS: Per-primitive SV_ViewportIndex", d3d12opts6.PerPrimitiveShadingRateSupportedWithViewportIndexing); + LVLINE(L"VRS: Screen-space tile size", vrs_tile_size); if (vrssum) { - LVLINE("VRS: Sum combiner", vrssum); + LVLINE(L"VRS: Sum combiner", vrssum); } } - LVLINE("Mesh & Amplification Shaders", meshShaders); + LVLINE(L"Mesh & Amplification Shaders", meshShaders); if (d3d12opts7.MeshShaderTier != D3D12_MESH_SHADER_TIER_NOT_SUPPORTED) { if (msderiv) { - LVLINE("MS/AS: Derivatives Support", msderiv); + LVLINE(L"MS/AS: Derivatives Support", msderiv); } if (msperprim) { - LVLINE("MS: Per-Primitive Shading", msperprim); + LVLINE(L"MS: Per-Primitive Shading", msperprim); } if (msrtarrayindex) { - LVLINE("MS: RT Array Index Support", msrtarrayindex); + LVLINE(L"MS: RT Array Index Support", msrtarrayindex); } if (ms_stats_culled) { - LVLINE("MS: Stats incl culled prims", ms_stats_culled); + LVLINE(L"MS: Stats incl culled prims", ms_stats_culled); } } - LVLINE("Sampler Feedback", feedbackTier); + LVLINE(L"Sampler Feedback", feedbackTier); - LVLINE("Shader Cache", shaderCache); + LVLINE(L"Shader Cache", shaderCache); if (adv_texture_ops) { - LVLINE("Advanced texture ops", adv_texture_ops); + LVLINE(L"Advanced texture ops", adv_texture_ops); } if (writeable_msaa_txt) { - LVLINE("Writeable MSAA textures", writeable_msaa_txt); + LVLINE(L"Writeable MSAA textures", writeable_msaa_txt); } if (nonNormalizedCoords) { - LVLINE("Non-normalized sampler coordinates", nonNormalizedCoords); + LVLINE(L"Non-normalized sampler coordinates", nonNormalizedCoords); } } else { - PRINTYESNO("Double-precision Shaders", d3d12opts.DoublePrecisionFloatShaderOps); + PRINTYESNO(L"Double-precision Shaders", d3d12opts.DoublePrecisionFloatShaderOps); - PRINTLINE("Minimum Precision", precis); - PRINTYESNO("Native 16-bit Shader Ops", d3d12opts4.Native16BitShaderOpsSupported); + PRINTLINE(L"Minimum Precision", precis); + PRINTYESNO(L"Native 16-bit Shader Ops", d3d12opts4.Native16BitShaderOpsSupported); - PRINTYESNO("Wave operations", d3d12opts1.WaveOps); + PRINTYESNO(L"Wave operations", d3d12opts1.WaveOps); if (d3d12opts1.WaveOps) { - PRINTLINE("Wave lane count", wave_lane_count); - PRINTLINE("Total lane count", lane_count); - PRINTYESNO("Expanded compute resource states", d3d12opts1.ExpandedComputeResourceStates); + PRINTLINE(L"Wave lane count", wave_lane_count); + PRINTLINE(L"Total lane count", lane_count); + PRINTYESNO(L"Expanded compute resource states", d3d12opts1.ExpandedComputeResourceStates); } if (wavemmatier) { - PRINTLINE("Wave MMA", wavemmatier); + PRINTLINE(L"Wave MMA", wavemmatier); } - PRINTYESNO("PS-Specified Stencil Ref", d3d12opts.PSSpecifiedStencilRefSupported); + PRINTYESNO(L"PS-Specified Stencil Ref", d3d12opts.PSSpecifiedStencilRefSupported); - PRINTYESNO("Barycentrics", d3d12opts3.BarycentricsSupported); + PRINTYESNO(L"Barycentrics", d3d12opts3.BarycentricsSupported); if (*atomicInt64) { - PRINTLINE("atomic", atomicInt64); + PRINTLINE(L"atomic", atomicInt64); } - PRINTLINE("Variable Rate Shading (VRS)", vrs); + PRINTLINE(L"Variable Rate Shading (VRS)", vrs); if (d3d12opts6.VariableShadingRateTier != D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED) { - PRINTYESNO("VRS: Additional shading rates", d3d12opts6.AdditionalShadingRatesSupported); - PRINTYESNO("VRS: Per-primitive SV_ViewportIndex", d3d12opts6.PerPrimitiveShadingRateSupportedWithViewportIndexing); - PRINTLINE("VRS: Screen-space tile size", vrs_tile_size); + PRINTYESNO(L"VRS: Additional shading rates", d3d12opts6.AdditionalShadingRatesSupported); + PRINTYESNO(L"VRS: Per-primitive SV_ViewportIndex", d3d12opts6.PerPrimitiveShadingRateSupportedWithViewportIndexing); + PRINTLINE(L"VRS: Screen-space tile size", vrs_tile_size); if (vrssum) { - PRINTLINE("VRS: Sum combiner", vrssum); + PRINTLINE(L"VRS: Sum combiner", vrssum); } } - PRINTLINE("Mesh & Amplification Shaders", meshShaders); + PRINTLINE(L"Mesh & Amplification Shaders", meshShaders); if (d3d12opts7.MeshShaderTier != D3D12_MESH_SHADER_TIER_NOT_SUPPORTED) { if (msderiv) { - PRINTLINE("MS/AS: Derivatives Support", msderiv); + PRINTLINE(L"MS/AS: Derivatives Support", msderiv); } if (msperprim) { - PRINTLINE("MS: Per-Primitive Shading", msperprim); + PRINTLINE(L"MS: Per-Primitive Shading", msperprim); } if (msrtarrayindex) { - PRINTLINE("MS: RT Array Index Support", msrtarrayindex); + PRINTLINE(L"MS: RT Array Index Support", msrtarrayindex); } if (ms_stats_culled) { - PRINTLINE("MS: Stats incl culled prims", ms_stats_culled); + PRINTLINE(L"MS: Stats incl culled prims", ms_stats_culled); } } - PRINTLINE("Sampler Feedback", feedbackTier); + PRINTLINE(L"Sampler Feedback", feedbackTier); - PRINTLINE("Shader Cache", shaderCache); + PRINTLINE(L"Shader Cache", shaderCache); if (adv_texture_ops) { - PRINTLINE("Advanced texture ops", adv_texture_ops); + PRINTLINE(L"Advanced texture ops", adv_texture_ops); } if (writeable_msaa_txt) { - PRINTLINE("Writeable MSAA textures", writeable_msaa_txt); + PRINTLINE(L"Writeable MSAA textures", writeable_msaa_txt); } if (nonNormalizedCoords) { - PRINTLINE("Non-normalized sampler coordinates", nonNormalizedCoords); + PRINTLINE(L"Non-normalized sampler coordinates", nonNormalizedCoords); } } @@ -5076,8 +5062,8 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 60); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 60); } auto d3d12opts = GetD3D12Options(pDevice); @@ -5085,41 +5071,41 @@ namespace auto d3d12xnode = GetD3D12Options(pDevice); - char sharing[16]; + WCHAR sharing[16]; switch (d3d12opts.CrossNodeSharingTier) { - case D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED: strcpy_s(sharing, c_szNo); break; - case D3D12_CROSS_NODE_SHARING_TIER_1_EMULATED: strcpy_s(sharing, "Yes - Tier 1 (Emulated)"); break; - case D3D12_CROSS_NODE_SHARING_TIER_1: strcpy_s(sharing, "Yes - Tier 1"); break; - case D3D12_CROSS_NODE_SHARING_TIER_2: strcpy_s(sharing, "Yes - Tier 2"); break; - case D3D12_CROSS_NODE_SHARING_TIER_3: strcpy_s(sharing, "Yes - Tier 3"); break; - default: strcpy_s(sharing, c_szYes); break; + case D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED: wcscpy_s(sharing, c_szNo); break; + case D3D12_CROSS_NODE_SHARING_TIER_1_EMULATED: wcscpy_s(sharing, L"Yes - Tier 1 (Emulated)"); break; + case D3D12_CROSS_NODE_SHARING_TIER_1: wcscpy_s(sharing, L"Yes - Tier 1"); break; + case D3D12_CROSS_NODE_SHARING_TIER_2: wcscpy_s(sharing, L"Yes - Tier 2"); break; + case D3D12_CROSS_NODE_SHARING_TIER_3: wcscpy_s(sharing, L"Yes - Tier 3"); break; + default: wcscpy_s(sharing, c_szYes); break; } - const char* sharedResTier = nullptr; + const WCHAR* sharedResTier = nullptr; switch (d3d12opts4.SharedResourceCompatibilityTier) { - case D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0: sharedResTier = "Yes - Tier 0"; break; - case D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1: sharedResTier = "Yes - Tier 1"; break; - case D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2: sharedResTier = "Yes - Tier 2"; break; + case D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0: sharedResTier = L"Yes - Tier 0"; break; + case D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1: sharedResTier = L"Yes - Tier 1"; break; + case D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2: sharedResTier = L"Yes - Tier 2"; break; default: sharedResTier = c_szYes; break; } if (!pPrintInfo) { - LVLINE("Cross-node Sharing", sharing); - LVYESNO("Cross-adapter Row-Major Texture", d3d12opts.CrossAdapterRowMajorTextureSupported); + LVLINE(L"Cross-node Sharing", sharing); + LVYESNO(L"Cross-adapter Row-Major Texture", d3d12opts.CrossAdapterRowMajorTextureSupported); - LVLINE("Shared Resource Tier", sharedResTier); - LVYESNO("Atomic Shader Instructions", d3d12xnode.AtomicShaderInstructions); + LVLINE(L"Shared Resource Tier", sharedResTier); + LVYESNO(L"Atomic Shader Instructions", d3d12xnode.AtomicShaderInstructions); } else { - PRINTLINE("Cross-node Sharing", sharing); - PRINTYESNO("Cross-adapter Row-Major Texture", d3d12opts.CrossAdapterRowMajorTextureSupported); + PRINTLINE(L"Cross-node Sharing", sharing); + PRINTYESNO(L"Cross-adapter Row-Major Texture", d3d12opts.CrossAdapterRowMajorTextureSupported); - PRINTLINE("Shared Resource Tier", sharedResTier); - PRINTYESNO("Atomic Shader Instructions", d3d12xnode.AtomicShaderInstructions); + PRINTLINE(L"Shared Resource Tier", sharedResTier); + PRINTYESNO(L"Atomic Shader Instructions", d3d12xnode.AtomicShaderInstructions); } return S_OK; @@ -5128,39 +5114,39 @@ namespace //----------------------------------------------------------------------------- void D3D10_FillTree(HTREEITEM hTree, ID3D10Device* pDevice, D3D_DRIVER_TYPE devType) { - HTREEITEM hTreeD3D = TVAddNodeEx(hTree, "Direct3D 10.0", TRUE, IDI_CAPS, D3D10Info, + HTREEITEM hTreeD3D = TVAddNodeEx(hTree, L"Direct3D 10.0", TRUE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, 0, 0); - TVAddNodeEx(hTreeD3D, "Features", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeD3D, L"Features", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D10(devType)); - TVAddNodeEx(hTreeD3D, "Shader sample (any filter)", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"Shader sample (any filter)", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_SHADER_SAMPLE, 0); - TVAddNodeEx(hTreeD3D, "Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MIP_AUTOGEN, 0); - TVAddNodeEx(hTreeD3D, "Render Target", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"Render Target", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_RENDER_TARGET, 0); - TVAddNodeEx(hTreeD3D, "Blendable Render Target", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"Blendable Render Target", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_BLENDABLE, 0); // MSAA FillMSAASampleTable(pDevice, g_sampCount10, FALSE); - TVAddNodeEx(hTreeD3D, "2x MSAA", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"2x MSAA", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 2); - TVAddNodeEx(hTreeD3D, "4x MSAA", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"4x MSAA", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 4); - TVAddNodeEx(hTreeD3D, "8x MSAA", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"8x MSAA", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 8); - TVAddNode(hTreeD3D, "Other MSAA", FALSE, IDI_CAPS, D3D10InfoMSAA, (LPARAM)pDevice, (LPARAM)g_sampCount10); + TVAddNode(hTreeD3D, L"Other MSAA", FALSE, IDI_CAPS, D3D10InfoMSAA, (LPARAM)pDevice, (LPARAM)g_sampCount10); - TVAddNodeEx(hTreeD3D, "MSAA Load", FALSE, IDI_CAPS, D3D10Info, + TVAddNodeEx(hTreeD3D, L"MSAA Load", FALSE, IDI_CAPS, D3D10Info, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD, 0); } @@ -5168,7 +5154,7 @@ namespace { D3D10_FEATURE_LEVEL1 fl = pDevice->GetFeatureLevel(); - HTREEITEM hTreeD3D = TVAddNodeEx(hTree, "Direct3D 10.1", TRUE, + HTREEITEM hTreeD3D = TVAddNodeEx(hTree, L"Direct3D 10.1", TRUE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, 0, 0); TVAddNodeEx(hTreeD3D, FLName(fl), FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)fl, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D10_1(devType)); @@ -5176,14 +5162,14 @@ namespace if ((g_DXGIFactory1 != nullptr && fl != D3D10_FEATURE_LEVEL_9_1) || (g_DXGIFactory1 == nullptr && fl != D3D10_FEATURE_LEVEL_10_0)) { - HTREEITEM hTreeF = TVAddNode(hTreeD3D, "Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeF = TVAddNode(hTreeD3D, L"Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); switch (fl) { case D3D10_FEATURE_LEVEL_10_1: if (flMask & FLMASK_10_0) { - TVAddNodeEx(hTreeF, "D3D10_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D10_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D10_1(devType)); } // Fall thru @@ -5191,7 +5177,7 @@ namespace case D3D10_FEATURE_LEVEL_10_0: if (flMask & FLMASK_9_3) { - TVAddNodeEx(hTreeF, "D3D10_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D10_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_3, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D10_1(devType)); } // Fall thru @@ -5199,7 +5185,7 @@ namespace case D3D10_FEATURE_LEVEL_9_3: if (flMask & FLMASK_9_2) { - TVAddNodeEx(hTreeF, "D3D10_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D10_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_2, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D10_1(devType)); } // Fall thru @@ -5207,7 +5193,7 @@ namespace case D3D10_FEATURE_LEVEL_9_2: if (flMask & FLMASK_9_1) { - TVAddNodeEx(hTreeF, "D3D10_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D10_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D10_1(devType)); } break; @@ -5218,13 +5204,13 @@ namespace // Nothing optional about 10level9 feature levels if (fl == D3D10_FEATURE_LEVEL_10_1) { - TVAddNodeEx(hTreeD3D, "Shader sample (any filter)", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"Shader sample (any filter)", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_SHADER_SAMPLE, 0); - TVAddNodeEx(hTreeD3D, "Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MIP_AUTOGEN, 0); - TVAddNodeEx(hTreeD3D, "Render Target", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"Render Target", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_RENDER_TARGET, 0); } @@ -5235,25 +5221,25 @@ namespace if (fl == D3D10_FEATURE_LEVEL_10_1) { - TVAddNodeEx(hTreeD3D, "2x MSAA", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"2x MSAA", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 2); - TVAddNodeEx(hTreeD3D, "4x MSAA (most required)", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"4x MSAA (most required)", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 4); - TVAddNodeEx(hTreeD3D, "8x MSAA", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"8x MSAA", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 8); - TVAddNode(hTreeD3D, "Other MSAA", FALSE, IDI_CAPS, D3D10InfoMSAA, (LPARAM)pDevice, (LPARAM)g_sampCount10_1); + TVAddNode(hTreeD3D, L"Other MSAA", FALSE, IDI_CAPS, D3D10InfoMSAA, (LPARAM)pDevice, (LPARAM)g_sampCount10_1); } else // 10level9 { - TVAddNodeEx(hTreeD3D, "2x MSAA", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"2x MSAA", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 2); if (fl >= D3D10_FEATURE_LEVEL_9_3) { - TVAddNodeEx(hTreeD3D, "4x MSAA", FALSE, IDI_CAPS, D3D10Info1, + TVAddNodeEx(hTreeD3D, L"4x MSAA", FALSE, IDI_CAPS, D3D10Info1, (LPARAM)pDevice, (LPARAM)D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 4); } } @@ -5269,11 +5255,11 @@ namespace if (!pPrintInfo) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Texture2D", 15); - LVAddColumn(g_hwndLV, 2, "Input", 15); - LVAddColumn(g_hwndLV, 3, "Output", 15); - LVAddColumn(g_hwndLV, 4, "Encoder", 15); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Texture2D", 15); + LVAddColumn(g_hwndLV, 2, L"Input", 15); + LVAddColumn(g_hwndLV, 3, L"Output", 15); + LVAddColumn(g_hwndLV, 4, L"Encoder", 15); } static const DXGI_FORMAT cfsVideo[] = @@ -5326,9 +5312,9 @@ namespace } else { - TCHAR buff[1024]; + WCHAR buff[1024]; - sprintf_s(buff, "Texture2D: %-3s Input: %-3s Output: %-3s Encoder: %-3s", + swprintf_s(buff, L"Texture2D: %-3s Input: %-3s Output: %-3s Encoder: %-3s", (fmtSupport.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE2D) ? c_szYes : c_szNo, (fmtSupport.Support1 & D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT) ? c_szYes : c_szNo, (fmtSupport.Support1 & D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT) ? c_szYes : c_szNo, @@ -5348,7 +5334,7 @@ namespace if (fl > D3D_FEATURE_LEVEL_11_0) fl = D3D_FEATURE_LEVEL_11_0; - HTREEITEM hTreeD3D = TVAddNodeEx(hTree, "Direct3D 11.0", TRUE, + HTREEITEM hTreeD3D = TVAddNodeEx(hTree, L"Direct3D 11.0", TRUE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, 0, 0); TVAddNodeEx(hTreeD3D, FLName(fl), FALSE, IDI_CAPS, D3D_FeatureLevel, @@ -5356,14 +5342,14 @@ namespace if (fl != D3D_FEATURE_LEVEL_9_1) { - HTREEITEM hTreeF = TVAddNode(hTreeD3D, "Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeF = TVAddNode(hTreeD3D, L"Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); switch (fl) { case D3D_FEATURE_LEVEL_11_0: if (flMask & FLMASK_10_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11(devType)); } // Fall thru @@ -5371,7 +5357,7 @@ namespace case D3D_FEATURE_LEVEL_10_1: if (flMask & FLMASK_10_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11(devType)); } // Fall thru @@ -5379,7 +5365,7 @@ namespace case D3D_FEATURE_LEVEL_10_0: if (flMask & FLMASK_9_3) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_3, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11(devType)); } // Fall thru @@ -5387,7 +5373,7 @@ namespace case D3D_FEATURE_LEVEL_9_3: if (flMask & FLMASK_9_2) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_2, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11(devType)); } // Fall thru @@ -5395,7 +5381,7 @@ namespace case D3D_FEATURE_LEVEL_9_2: if (flMask & FLMASK_9_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11(devType)); } break; @@ -5404,31 +5390,31 @@ namespace if (fl >= D3D_FEATURE_LEVEL_11_0) { - TVAddNodeEx(hTreeD3D, "Shader sample (any filter)", FALSE, IDI_CAPS, D3D11Info, + TVAddNodeEx(hTreeD3D, L"Shader sample (any filter)", FALSE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_SHADER_SAMPLE, 0); - TVAddNodeEx(hTreeD3D, "Shader gather4", FALSE, IDI_CAPS, D3D11Info, + TVAddNodeEx(hTreeD3D, L"Shader gather4", FALSE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_SHADER_GATHER, 0); - TVAddNodeEx(hTreeD3D, "Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D11Info, + TVAddNodeEx(hTreeD3D, L"Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MIP_AUTOGEN, 0); - TVAddNodeEx(hTreeD3D, "Render Target", FALSE, IDI_CAPS, D3D11Info, + TVAddNodeEx(hTreeD3D, L"Render Target", FALSE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_RENDER_TARGET, 0); // MSAA (MSAA data for 10level9 is shown under the 10.1 node) FillMSAASampleTable(pDevice, g_sampCount11); - TVAddNodeEx(hTreeD3D, "2x MSAA", FALSE, IDI_CAPS, D3D11Info, + TVAddNodeEx(hTreeD3D, L"2x MSAA", FALSE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 2); - TVAddNodeEx(hTreeD3D, "4x MSAA (all required)", FALSE, IDI_CAPS, D3D11Info, + TVAddNodeEx(hTreeD3D, L"4x MSAA (all required)", FALSE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 4); - TVAddNodeEx(hTreeD3D, "8x MSAA (most required)", FALSE, IDI_CAPS, D3D11Info, + TVAddNodeEx(hTreeD3D, L"8x MSAA (most required)", FALSE, IDI_CAPS, D3D11Info, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 8); - TVAddNodeEx(hTreeD3D, "Other MSAA", FALSE, IDI_CAPS, D3D11InfoMSAA, + TVAddNodeEx(hTreeD3D, L"Other MSAA", FALSE, IDI_CAPS, D3D11InfoMSAA, (LPARAM)pDevice, (LPARAM)g_sampCount11, 0); } } @@ -5439,7 +5425,7 @@ namespace if (fl > D3D_FEATURE_LEVEL_11_1) fl = D3D_FEATURE_LEVEL_11_1; - HTREEITEM hTreeD3D = TVAddNodeEx(hTree, "Direct3D 11.1", TRUE, + HTREEITEM hTreeD3D = TVAddNodeEx(hTree, L"Direct3D 11.1", TRUE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, 0, 0); TVAddNodeEx(hTreeD3D, FLName(fl), FALSE, IDI_CAPS, D3D_FeatureLevel, @@ -5447,14 +5433,14 @@ namespace if (fl != D3D_FEATURE_LEVEL_9_1) { - HTREEITEM hTreeF = TVAddNode(hTreeD3D, "Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeF = TVAddNode(hTreeD3D, L"Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); switch (fl) { case D3D_FEATURE_LEVEL_11_1: if (flMask & FLMASK_11_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_11_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_1(devType)); } // Fall thru @@ -5462,7 +5448,7 @@ namespace case D3D_FEATURE_LEVEL_11_0: if (flMask & FLMASK_10_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_1(devType)); } // Fall thru @@ -5470,7 +5456,7 @@ namespace case D3D_FEATURE_LEVEL_10_1: if (flMask & FLMASK_10_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_1(devType)); } // Fall thru @@ -5478,7 +5464,7 @@ namespace case D3D_FEATURE_LEVEL_10_0: if (flMask & FLMASK_9_3) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_3, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_1(devType)); } // Fall thru @@ -5486,7 +5472,7 @@ namespace case D3D_FEATURE_LEVEL_9_3: if (flMask & FLMASK_9_2) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_2, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_1(devType)); } // Fall thru @@ -5494,7 +5480,7 @@ namespace case D3D_FEATURE_LEVEL_9_2: if (flMask & FLMASK_9_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_1(devType)); } break; @@ -5503,65 +5489,65 @@ namespace if (fl >= D3D_FEATURE_LEVEL_10_0) { - TVAddNodeEx(hTreeD3D, "IA Vertex Buffer", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"IA Vertex Buffer", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER, 0); - TVAddNodeEx(hTreeD3D, "Shader sample (any filter)", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"Shader sample (any filter)", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_SHADER_SAMPLE, 0); if (fl >= D3D_FEATURE_LEVEL_11_0) { - TVAddNodeEx(hTreeD3D, "Shader gather4", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"Shader gather4", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_SHADER_GATHER, 0); } - TVAddNodeEx(hTreeD3D, "Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"Mipmap Auto-Generation", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MIP_AUTOGEN, 0); - TVAddNodeEx(hTreeD3D, "Render Target", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"Render Target", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_RENDER_TARGET, 0); - TVAddNodeEx(hTreeD3D, "Blendable Render Target", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"Blendable Render Target", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_BLENDABLE, 0); if (fl < D3D_FEATURE_LEVEL_11_1) { // This is required for 11.1, but is optional for 10.x and 11.0 - TVAddNodeEx(hTreeD3D, "OM Logic Ops", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"OM Logic Ops", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)-1, (LPARAM)D3D11_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP); } if (fl >= D3D_FEATURE_LEVEL_11_0) { - TVAddNodeEx(hTreeD3D, "Typed UAV (most required)", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"Typed UAV (most required)", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW, 0); - TVAddNodeEx(hTreeD3D, "UAV Typed Store (most required)", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"UAV Typed Store (most required)", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)-1, (LPARAM)D3D11_FORMAT_SUPPORT2_UAV_TYPED_STORE); } // MSAA (MSAA data for 10level9 is shown under the 10.1 node) FillMSAASampleTable(pDevice, g_sampCount11_1); - TVAddNodeEx(hTreeD3D, "2x MSAA", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"2x MSAA", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 2); - TVAddNodeEx(hTreeD3D, "4x MSAA (all required)", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"4x MSAA (all required)", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 4); - TVAddNodeEx(hTreeD3D, "8x MSAA (most required)", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"8x MSAA (most required)", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET, 8); - TVAddNodeEx(hTreeD3D, "Other MSAA", FALSE, IDI_CAPS, D3D11InfoMSAA, + TVAddNodeEx(hTreeD3D, L"Other MSAA", FALSE, IDI_CAPS, D3D11InfoMSAA, (LPARAM)pDevice, (LPARAM)g_sampCount11_1, 1); - TVAddNodeEx(hTreeD3D, "MSAA Load", FALSE, IDI_CAPS, D3D11Info1, + TVAddNodeEx(hTreeD3D, L"MSAA Load", FALSE, IDI_CAPS, D3D11Info1, (LPARAM)pDevice, (LPARAM)D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD, 0); } if (devType != D3D_DRIVER_TYPE_REFERENCE) { - TVAddNodeEx(hTreeD3D, "Video", FALSE, IDI_CAPS, D3D11InfoVideo, (LPARAM)pDevice, 0, 0); + TVAddNodeEx(hTreeD3D, L"Video", FALSE, IDI_CAPS, D3D11InfoVideo, (LPARAM)pDevice, 0, 0); } } @@ -5571,7 +5557,7 @@ namespace if (fl > D3D_FEATURE_LEVEL_11_1) fl = D3D_FEATURE_LEVEL_11_1; - HTREEITEM hTreeD3D = TVAddNodeEx(hTree, "Direct3D 11.2", TRUE, + HTREEITEM hTreeD3D = TVAddNodeEx(hTree, L"Direct3D 11.2", TRUE, IDI_CAPS, D3D11Info2, (LPARAM)pDevice, 0, 0); TVAddNodeEx(hTreeD3D, FLName(fl), FALSE, IDI_CAPS, D3D_FeatureLevel, @@ -5579,14 +5565,14 @@ namespace if (fl != D3D_FEATURE_LEVEL_9_1) { - HTREEITEM hTreeF = TVAddNode(hTreeD3D, "Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeF = TVAddNode(hTreeD3D, L"Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); switch (fl) { case D3D_FEATURE_LEVEL_11_1: if (flMask & FLMASK_11_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_11_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_2(devType)); } // Fall thru @@ -5594,7 +5580,7 @@ namespace case D3D_FEATURE_LEVEL_11_0: if (flMask & FLMASK_10_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_2(devType)); } // Fall thru @@ -5602,7 +5588,7 @@ namespace case D3D_FEATURE_LEVEL_10_1: if (flMask & FLMASK_10_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_2(devType)); } // Fall thru @@ -5610,7 +5596,7 @@ namespace case D3D_FEATURE_LEVEL_10_0: if (flMask & FLMASK_9_3) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_3, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_2(devType)); } // Fall thru @@ -5618,7 +5604,7 @@ namespace case D3D_FEATURE_LEVEL_9_3: if (flMask & FLMASK_9_2) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_2, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_2(devType)); } // Fall thru @@ -5626,7 +5612,7 @@ namespace case D3D_FEATURE_LEVEL_9_2: if (flMask & FLMASK_9_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_2(devType)); } break; @@ -5635,7 +5621,7 @@ namespace // The majority of this data is already shown under the DirectX 11.1 node, so we only show the 'new' info - TVAddNodeEx(hTreeD3D, "Shareable", FALSE, IDI_CAPS, D3D11Info2, + TVAddNodeEx(hTreeD3D, L"Shareable", FALSE, IDI_CAPS, D3D11Info2, (LPARAM)pDevice, (LPARAM)-1, (LPARAM)D3D11_FORMAT_SUPPORT2_SHAREABLE); } @@ -5643,7 +5629,7 @@ namespace { D3D_FEATURE_LEVEL fl = pDevice->GetFeatureLevel(); - HTREEITEM hTreeD3D = TVAddNodeEx(hTree, (pDevice4) ? "Direct3D 11.3/11.4" : "Direct3D 11.3", TRUE, + HTREEITEM hTreeD3D = TVAddNodeEx(hTree, (pDevice4) ? L"Direct3D 11.3/11.4" : L"Direct3D 11.3", TRUE, IDI_CAPS, D3D11Info3, (LPARAM)pDevice, 0, (LPARAM)pDevice4); TVAddNodeEx(hTreeD3D, FLName(fl), FALSE, IDI_CAPS, D3D_FeatureLevel, @@ -5651,14 +5637,14 @@ namespace if (fl != D3D_FEATURE_LEVEL_9_1) { - HTREEITEM hTreeF = TVAddNode(hTreeD3D, "Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeF = TVAddNode(hTreeD3D, L"Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); switch (fl) { case D3D_FEATURE_LEVEL_12_2: if (flMask & FLMASK_12_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_12_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_12_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_12_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5666,7 +5652,7 @@ namespace case D3D_FEATURE_LEVEL_12_1: if (flMask & FLMASK_12_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_12_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_12_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_12_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5674,7 +5660,7 @@ namespace case D3D_FEATURE_LEVEL_12_0: if (flMask & FLMASK_11_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_11_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_11_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_11_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5682,7 +5668,7 @@ namespace case D3D_FEATURE_LEVEL_11_1: if (flMask & FLMASK_11_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_11_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5690,7 +5676,7 @@ namespace case D3D_FEATURE_LEVEL_11_0: if (flMask & FLMASK_10_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5698,7 +5684,7 @@ namespace case D3D_FEATURE_LEVEL_10_1: if (flMask & FLMASK_10_0) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_10_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_10_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5706,7 +5692,7 @@ namespace case D3D_FEATURE_LEVEL_10_0: if (flMask & FLMASK_9_3) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_3", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_3, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5714,7 +5700,7 @@ namespace case D3D_FEATURE_LEVEL_9_3: if (flMask & FLMASK_9_2) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_2", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_2, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } // Fall thru @@ -5722,7 +5708,7 @@ namespace case D3D_FEATURE_LEVEL_9_2: if (flMask & FLMASK_9_1) { - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_9_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_9_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D11_3(devType)); } break; @@ -5731,7 +5717,7 @@ namespace // The majority of this data is already shown under the DirectX 11.1 or 11.2 node, so we only show the 'new' info - TVAddNodeEx(hTreeD3D, "UAV Typed Load", FALSE, IDI_CAPS, D3D11Info3, + TVAddNodeEx(hTreeD3D, L"UAV Typed Load", FALSE, IDI_CAPS, D3D11Info3, (LPARAM)pDevice, (LPARAM)-1, (LPARAM)D3D11_FORMAT_SUPPORT2_UAV_TYPED_LOAD); } @@ -5740,45 +5726,45 @@ namespace { D3D_FEATURE_LEVEL fl = GetD3D12FeatureLevel(pDevice); - HTREEITEM hTreeD3D = TVAddNodeEx(hTree, "Direct3D 12", TRUE, IDI_CAPS, D3D12Info, (LPARAM)pDevice, (LPARAM)fl, 0); + HTREEITEM hTreeD3D = TVAddNodeEx(hTree, L"Direct3D 12", TRUE, IDI_CAPS, D3D12Info, (LPARAM)pDevice, (LPARAM)fl, 0); TVAddNodeEx(hTreeD3D, FLName(fl), FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)fl, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D12(devType)); if (fl != D3D_FEATURE_LEVEL_11_0) { - HTREEITEM hTreeF = TVAddNode(hTreeD3D, "Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeF = TVAddNode(hTreeD3D, L"Additional Feature Levels", TRUE, IDI_CAPS, nullptr, 0, 0); switch (fl) { case D3D_FEATURE_LEVEL_12_2: - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_12_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_12_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_12_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D12(devType)); // Fall thru case D3D_FEATURE_LEVEL_12_1: - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_12_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_12_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_12_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D12(devType)); // Fall thru case D3D_FEATURE_LEVEL_12_0: - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_11_1", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_11_1", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_11_1, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D12(devType)); // Fall thru case D3D_FEATURE_LEVEL_11_1: - TVAddNodeEx(hTreeF, "D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, + TVAddNodeEx(hTreeF, L"D3D_FEATURE_LEVEL_11_0", FALSE, IDI_CAPS, D3D_FeatureLevel, (LPARAM)D3D_FEATURE_LEVEL_11_0, (LPARAM)pDevice, D3D_FL_LPARAM3_D3D12(devType)); break; } } - TVAddNodeEx(hTreeD3D, "Architecture", FALSE, IDI_CAPS, D3D12Architecture, (LPARAM)pDevice, 0, 0); + TVAddNodeEx(hTreeD3D, L"Architecture", FALSE, IDI_CAPS, D3D12Architecture, (LPARAM)pDevice, 0, 0); - TVAddNodeEx(hTreeD3D, "Extended Shader Features", FALSE, IDI_CAPS, D3D12ExShaderInfo, (LPARAM)pDevice, 0, 0); + TVAddNodeEx(hTreeD3D, L"Extended Shader Features", FALSE, IDI_CAPS, D3D12ExShaderInfo, (LPARAM)pDevice, 0, 0); - TVAddNodeEx(hTreeD3D, "Multi-GPU", FALSE, IDI_CAPS, D3D12MultiGPU, (LPARAM)pDevice, 0, 0); + TVAddNodeEx(hTreeD3D, L"Multi-GPU", FALSE, IDI_CAPS, D3D12MultiGPU, (LPARAM)pDevice, 0, 0); - TVAddNodeEx(hTreeD3D, "Video", FALSE, IDI_CAPS, D3D12InfoVideo, (LPARAM)pDevice, 0, 1); + TVAddNodeEx(hTreeD3D, L"Video", FALSE, IDI_CAPS, D3D12InfoVideo, (LPARAM)pDevice, 0, 1); } } @@ -5788,7 +5774,7 @@ namespace VOID DXGI_Init() { // DXGI - g_dxgi = LoadLibraryEx("dxgi.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); + g_dxgi = LoadLibraryEx(L"dxgi.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_dxgi) { auto fpCreateDXGIFactory = reinterpret_cast(GetProcAddress(g_dxgi, "CreateDXGIFactory1")); @@ -5870,14 +5856,14 @@ VOID DXGI_Init() } // Direct3D 10.x - g_d3d10_1 = LoadLibraryEx("d3d10_1.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); + g_d3d10_1 = LoadLibraryEx(L"d3d10_1.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_d3d10_1) { g_D3D10CreateDevice1 = reinterpret_cast(GetProcAddress(g_d3d10_1, "D3D10CreateDevice1")); } else { - g_d3d10 = LoadLibraryEx("d3d10.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); + g_d3d10 = LoadLibraryEx(L"d3d10.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_d3d10) { g_D3D10CreateDevice = reinterpret_cast(GetProcAddress(g_d3d10, "D3D10CreateDevice")); @@ -5885,14 +5871,14 @@ VOID DXGI_Init() } // Direct3D 11 - g_d3d11 = LoadLibraryEx("d3d11.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); + g_d3d11 = LoadLibraryEx(L"d3d11.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_d3d11) { g_D3D11CreateDevice = reinterpret_cast(GetProcAddress(g_d3d11, "D3D11CreateDevice")); } // Direct3D 12 - g_d3d12 = LoadLibraryEx("d3d12.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); + g_d3d12 = LoadLibraryEx(L"d3d12.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32); if (g_d3d12) { g_D3D12CreateDevice = reinterpret_cast(GetProcAddress(g_d3d12, "D3D12CreateDevice")); @@ -5908,7 +5894,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (!g_DXGIFactory) return; - HTREEITEM hTree = TVAddNode(TVI_ROOT, "DXGI Devices", TRUE, IDI_DIRECTX, nullptr, 0, 0); + HTREEITEM hTree = TVAddNode(TVI_ROOT, L"DXGI Devices", TRUE, IDI_DIRECTX, nullptr, 0, 0); // Hardware driver types IDXGIAdapter* pAdapter = nullptr; @@ -5961,24 +5947,21 @@ VOID DXGI_FillTree(HWND hwndTV) if (FAILED(hr)) continue; - char szDesc[128]; - wcstombs_s(nullptr, szDesc, aDesc.Description, 128); - HTREEITEM hTreeA; // No need for DXGIAdapterInfo3 as there's no extra desc information to display if (pAdapter2) { - hTreeA = TVAddNode(hTree, szDesc, TRUE, IDI_CAPS, DXGIAdapterInfo2, iAdapter, (LPARAM)(pAdapter2)); + hTreeA = TVAddNode(hTree, aDesc.Description, TRUE, IDI_CAPS, DXGIAdapterInfo2, iAdapter, (LPARAM)(pAdapter2)); } else if (pAdapter1) { - hTreeA = TVAddNode(hTree, szDesc, TRUE, IDI_CAPS, DXGIAdapterInfo1, iAdapter, (LPARAM)(pAdapter1)); + hTreeA = TVAddNode(hTree, aDesc.Description, TRUE, IDI_CAPS, DXGIAdapterInfo1, iAdapter, (LPARAM)(pAdapter1)); } else { - hTreeA = TVAddNode(hTree, szDesc, TRUE, IDI_CAPS, DXGIAdapterInfo, iAdapter, (LPARAM)(pAdapter)); + hTreeA = TVAddNode(hTree, aDesc.Description, TRUE, IDI_CAPS, DXGIAdapterInfo, iAdapter, (LPARAM)(pAdapter)); } // Outputs @@ -5994,23 +5977,20 @@ VOID DXGI_FillTree(HWND hwndTV) if (iOutput == 0) { - hTreeO = TVAddNode(hTreeA, "Outputs", TRUE, IDI_CAPS, DXGIFeatures, 0, 0); + hTreeO = TVAddNode(hTreeA, L"Outputs", TRUE, IDI_CAPS, DXGIFeatures, 0, 0); } DXGI_OUTPUT_DESC oDesc; pOutput->GetDesc(&oDesc); - char szDeviceName[32]; - wcstombs_s(nullptr, szDeviceName, oDesc.DeviceName, 32); - - HTREEITEM hTreeD = TVAddNode(hTreeO, szDeviceName, TRUE, IDI_CAPS, DXGIOutputInfo, iOutput, (LPARAM)pOutput); + HTREEITEM hTreeD = TVAddNode(hTreeO, oDesc.DeviceName, TRUE, IDI_CAPS, DXGIOutputInfo, iOutput, (LPARAM)pOutput); - TVAddNode(hTreeD, "Display Modes", FALSE, IDI_CAPS, DXGIOutputModes, iOutput, (LPARAM)pOutput); + TVAddNode(hTreeD, L"Display Modes", FALSE, IDI_CAPS, DXGIOutputModes, iOutput, (LPARAM)pOutput); } // Direct3D 12 #ifdef EXTRA_DEBUG - OutputDebugStringA("Direct3D 12\n"); + OutputDebugStringW(L"Direct3D 12\n"); #endif ID3D12Device* pDevice12 = nullptr; @@ -6028,9 +6008,9 @@ VOID DXGI_FillTree(HWND hwndTV) else { #ifdef EXTRA_DEBUG - char buff[64] = {}; - sprintf_s(buff, ": Failed (%08X)\n", hr); - OutputDebugStringA(buff); + WCHAR buff[64] = {}; + swprintf_s(buff, L": Failed (%08X)\n", hr); + OutputDebugStringW(buff); #endif pDevice12 = nullptr; } @@ -6038,7 +6018,7 @@ VOID DXGI_FillTree(HWND hwndTV) // Direct3D 11.x #ifdef EXTRA_DEBUG - OutputDebugStringA("Direct3D 11.x\n"); + OutputDebugStringW(L"Direct3D 11.x\n"); #endif ID3D11Device* pDevice11 = nullptr; @@ -6062,7 +6042,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (SUCCEEDED(hr)) { #ifdef EXTRA_DEBUG - OutputDebugString(": Success\n"); + OutputDebugString(L": Success\n"); #endif switch (g_featureLevels[i]) { @@ -6084,9 +6064,9 @@ VOID DXGI_FillTree(HWND hwndTV) else { #ifdef EXTRA_DEBUG - char buff[64] = {}; - sprintf_s(buff, ": Failed (%08X)\n", hr); - OutputDebugStringA(buff); + WCHAR buff[64] = {}; + swprintf_s(buff, L": Failed (%08X)\n", hr); + OutputDebugStringW(buff); #endif pDevice11 = nullptr; } @@ -6133,7 +6113,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (pDevice11 || pDevice11_1 || pDevice11_2 || pDevice11_3) { HTREEITEM hTree11 = (pDevice11_1 || pDevice11_2 || pDevice11_3) - ? TVAddNode(hTreeA, "Direct3D 11", TRUE, IDI_CAPS, nullptr, 0, 0) + ? TVAddNode(hTreeA, L"Direct3D 11", TRUE, IDI_CAPS, nullptr, 0, 0) : hTreeA; if (pDevice11) @@ -6151,7 +6131,7 @@ VOID DXGI_FillTree(HWND hwndTV) // Direct3D 10.x #ifdef EXTRA_DEBUG - OutputDebugStringA("Direct3D 10.x\n"); + OutputDebugStringW(L"Direct3D 10.x\n"); #endif ID3D10Device* pDevice10 = nullptr; ID3D10Device1* pDevice10_1 = nullptr; @@ -6186,7 +6166,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (SUCCEEDED(hr)) { #ifdef EXTRA_DEBUG - OutputDebugString(": Success\n"); + OutputDebugString(L": Success\n"); #endif switch (lvl[i]) @@ -6204,9 +6184,9 @@ VOID DXGI_FillTree(HWND hwndTV) else { #ifdef EXTRA_DEBUG - char buff[64] = {}; - sprintf_s(buff, ": Failed (%08X)\n", hr); - OutputDebugStringA(buff); + WCHAR buff[64] = {}; + swprintf_s(buff, L": Failed (%08X)\n", hr); + OutputDebugStringW(buff); #endif pDevice10_1 = nullptr; } @@ -6247,7 +6227,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (pDevice10 || pDevice10_1) { HTREEITEM hTree10 = (pDevice10_1) - ? TVAddNode(hTreeA, "Direct3D 10", TRUE, IDI_CAPS, nullptr, 0, 0) + ? TVAddNode(hTreeA, L"Direct3D 10", TRUE, IDI_CAPS, nullptr, 0, 0) : hTreeA; if (pDevice10) @@ -6265,7 +6245,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (g_D3D10CreateDevice1) { #ifdef EXTRA_DEBUG - OutputDebugString("WARP10\n"); + OutputDebugString(L"WARP10\n"); #endif hr = g_D3D10CreateDevice1(nullptr, D3D10_DRIVER_TYPE_WARP, nullptr, 0, D3D10_FEATURE_LEVEL_10_1, @@ -6282,7 +6262,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (g_D3D11CreateDevice) { #ifdef EXTRA_DEBUG - OutputDebugString("WARP11\n"); + OutputDebugString(L"WARP11\n"); #endif D3D_FEATURE_LEVEL fl; // Skip 12.2 @@ -6344,7 +6324,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (g_D3D12CreateDevice != 0 && g_DXGIFactory4 != 0) { #ifdef EXTRA_DEBUG - OutputDebugString("WARP12\n"); + OutputDebugString(L"WARP12\n"); #endif IDXGIAdapter* warpAdapter = nullptr; hr = g_DXGIFactory4->EnumWarpAdapter(IID_PPV_ARGS(&warpAdapter)); @@ -6361,9 +6341,9 @@ VOID DXGI_FillTree(HWND hwndTV) else { #ifdef EXTRA_DEBUG - char buff[64] = {}; - sprintf_s(buff, ": Failed (%08X)\n", hr); - OutputDebugStringA(buff); + WCHAR buff[64] = {}; + swprintf_s(buff, L": Failed (%08X)\n", hr); + OutputDebugStringW(buff); #endif pDeviceWARP12 = nullptr; } @@ -6373,14 +6353,14 @@ VOID DXGI_FillTree(HWND hwndTV) #ifdef EXTRA_DEBUG else { - OutputDebugString("WARP12 adapter not found!\n"); + OutputDebugString(L"WARP12 adapter not found!\n"); } #endif } if (pDeviceWARP10 || pDeviceWARP11 || pDeviceWARP11_1 || pDeviceWARP11_2 || pDeviceWARP11_3 || pDeviceWARP11_4 || pDeviceWARP12) { - HTREEITEM hTreeW = TVAddNode(hTree, "Windows Advanced Rasterization Platform (WARP)", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeW = TVAddNode(hTree, L"Windows Advanced Rasterization Platform (WARP)", TRUE, IDI_CAPS, nullptr, 0, 0); // DirectX 12 (WARP) if (pDeviceWARP12) @@ -6390,7 +6370,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (pDeviceWARP11 || pDeviceWARP11_1 || pDeviceWARP11_2 || pDeviceWARP11_3) { HTREEITEM hTree11 = (pDeviceWARP11_1 || pDeviceWARP11_2 || pDeviceWARP11_3) - ? TVAddNode(hTreeW, "Direct3D 11", TRUE, IDI_CAPS, nullptr, 0, 0) + ? TVAddNode(hTreeW, L"Direct3D 11", TRUE, IDI_CAPS, nullptr, 0, 0) : hTreeW; if (pDeviceWARP11) @@ -6410,7 +6390,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (pDeviceWARP10) { // WARP supported both 10 and 10.1 when first released - HTREEITEM hTree10 = TVAddNode(hTreeW, "Direct3D 10", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTree10 = TVAddNode(hTreeW, L"Direct3D 10", TRUE, IDI_CAPS, nullptr, 0, 0); D3D10_FillTree(hTree10, pDeviceWARP10, D3D_DRIVER_TYPE_WARP); D3D10_FillTree1(hTree10, pDeviceWARP10, flMaskWARP, D3D_DRIVER_TYPE_WARP); @@ -6486,7 +6466,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (pDeviceREF10 || pDeviceREF10_1 || pDeviceREF11 || pDeviceREF11_1 || pDeviceREF11_2 || pDeviceREF11_3) { - HTREEITEM hTreeR = TVAddNode(hTree, "Reference", TRUE, IDI_CAPS, nullptr, 0, 0); + HTREEITEM hTreeR = TVAddNode(hTree, L"Reference", TRUE, IDI_CAPS, nullptr, 0, 0); // No REF for Direct3D 12 @@ -6494,7 +6474,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (pDeviceREF11 || pDeviceREF11_1 || pDeviceREF11_2 || pDeviceREF11_3) { HTREEITEM hTree11 = (pDeviceREF11_1 || pDeviceREF11_2 || pDeviceREF11_3) - ? TVAddNode(hTreeR, "Direct3D 11", TRUE, IDI_CAPS, nullptr, 0, 0) + ? TVAddNode(hTreeR, L"Direct3D 11", TRUE, IDI_CAPS, nullptr, 0, 0) : hTreeR; if (pDeviceREF11) @@ -6514,7 +6494,7 @@ VOID DXGI_FillTree(HWND hwndTV) if (pDeviceREF10 || pDeviceREF10_1) { HTREEITEM hTree10 = (pDeviceREF10_1) - ? TVAddNode(hTreeR, "Direct3D 10", TRUE, IDI_CAPS, nullptr, 0, 0) + ? TVAddNode(hTreeR, L"Direct3D 10", TRUE, IDI_CAPS, nullptr, 0, 0) : hTreeR; if (pDeviceREF10) diff --git a/dxprint.cpp b/dxprint.cpp index 40d005f..be9b3b3 100644 --- a/dxprint.cpp +++ b/dxprint.cpp @@ -15,7 +15,7 @@ #include BOOL g_PrintToFile = FALSE; // Don't print to printer print to dxview.log -TCHAR g_PrintToFilePath[MAX_PATH]; // "Print" to this file instead of dxview.log +WCHAR g_PrintToFilePath[MAX_PATH]; // "Print" to this file instead of dxview.log namespace { @@ -151,8 +151,8 @@ namespace //----------------------------------------------------------------------------- VOID DoMessage(DWORD dwTitle, DWORD dwMsg) { - TCHAR strTitle[MAX_TITLE]; - TCHAR strMsg[MAX_MESSAGE]; + WCHAR strTitle[MAX_TITLE]; + WCHAR strMsg[MAX_MESSAGE]; LoadString(GetModuleHandle(nullptr), dwTitle, strTitle, MAX_TITLE); LoadString(GetModuleHandle(nullptr), dwMsg, strMsg, MAX_MESSAGE); @@ -184,10 +184,11 @@ namespace BOOL fResult = FALSE; BOOL fStartDoc = FALSE; BOOL fDisableWindow = FALSE; - LPTSTR pstrTitle = nullptr; - LPTSTR pstrBuff = nullptr; + LPWSTR pstrTitle = nullptr; + LPWSTR pstrBuff = nullptr; DWORD dwCurrCopy; HANDLE hHeap = nullptr; + DWORD buffCnt; DWORD buffSize; DWORD cchLen; TV_ITEM tvi; @@ -246,8 +247,9 @@ namespace } // Create line buffer - buffSize = (pci.dwCharsPerLine + 1) * sizeof(TCHAR); - pstrBuff = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, buffSize); + buffCnt = (pci.dwCharsPerLine + 1); + buffSize = buffCnt * sizeof(WCHAR); + pstrBuff = (LPWSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, buffSize); if (!pstrBuff) { // Error, not enough memory @@ -281,32 +283,32 @@ namespace { SetWindowText(g_hAbortPrintDlg, pstrBuff); SetAbortProc(pd.hDC, AbortProc); - cchLen = static_cast(_tcsclen(pstrBuff)); - DWORD cbSize = (cchLen + 1) * sizeof(TCHAR); - pstrTitle = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, cbSize); + cchLen = static_cast(wcslen(pstrBuff)); + DWORD cbSize = (cchLen + 1) * sizeof(WCHAR); + pstrTitle = (LPWSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, cbSize); if (!pstrTitle) { // Error, not enough memory goto lblCLEANUP; } - strcpy_s(pstrTitle, cbSize, pstrBuff); + wcscpy_s(pstrTitle, cchLen + 1, pstrBuff); pstrTitle[cchLen] = 0; } else { - SetWindowText(g_hAbortPrintDlg, TEXT("Unknown")); + SetWindowText(g_hAbortPrintDlg, L"Unknown"); SetAbortProc(pd.hDC, AbortProc); - cchLen = static_cast(_tcsclen(TEXT("Unknown"))); - DWORD cbSize = (cchLen + 1) * sizeof(TCHAR); - pstrTitle = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, cbSize); + cchLen = static_cast(wcslen(L"Unknown")); + DWORD cbSize = (cchLen + 1) * sizeof(WCHAR); + pstrTitle = (LPWSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, cbSize); if (!pstrTitle) { // Error, not enough memory goto lblCLEANUP; } - strcpy_s(pstrTitle, cbSize, TEXT("Unknown")); + wcscpy_s(pstrTitle, cchLen + 1, L"Unknown"); pstrTitle[cchLen] = 0; } @@ -320,20 +322,20 @@ namespace // Start document if (g_PrintToFile) { - const TCHAR* pstrFile; - TCHAR buff[MAX_PATH]; - if (strlen(g_PrintToFilePath) > 0) + const WCHAR* pstrFile; + WCHAR buff[MAX_PATH]; + if (wcslen(g_PrintToFilePath) > 0) pstrFile = g_PrintToFilePath; else { HRESULT hr = SHGetFolderPath(nullptr, CSIDL_DESKTOP, nullptr, SHGFP_TYPE_CURRENT, buff); if (SUCCEEDED(hr)) { - strcat_s(buff, MAX_PATH, TEXT("\\dxview.log")); + wcscat_s(buff, MAX_PATH, L"\\dxview.log"); pstrFile = buff; } else - pstrFile = TEXT("dxview.log"); + pstrFile = L"dxview.log"; } g_FileHandle = CreateFile(pstrFile, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); @@ -381,8 +383,8 @@ namespace tvi.cchTextMax = pci.dwCharsPerLine; if (TreeView_GetItem(hTreeWnd, &tvi)) { - cchLen = static_cast(_tcslen(pstrBuff)); - cchLen = __min(cchLen, buffSize); + cchLen = static_cast(wcslen(pstrBuff)); + cchLen = __min(cchLen, buffCnt); if (cchLen > 0) { int xOffset = (int)(pci.dwCurrIndent * DEF_TAB_SIZE * pci.dwCharWidth); @@ -643,7 +645,7 @@ BOOL DXView_OnFile(HWND hWnd, HWND hTreeWnd, BOOL bPrintAll) // Desc: Prints text to page at specified location //----------------------------------------------------------------------------- _Use_decl_annotations_ -HRESULT PrintLine(int xOffset, int yOffset, LPCTSTR pszBuff, size_t cchBuff, +HRESULT PrintLine(int xOffset, int yOffset, LPCWSTR pszBuff, size_t cchBuff, PRINTCBINFO* pci) { if (!pci) @@ -661,19 +663,19 @@ HRESULT PrintLine(int xOffset, int yOffset, LPCTSTR pszBuff, size_t cchBuff, if (g_PrintToFile) { DWORD dwDummy; - TCHAR Temp[80]; + WCHAR Temp[80]; int offset = (xOffset - iLastXPos) / pci->dwCharWidth; if (offset < 0 || offset >= 80) return S_OK; - memset(Temp, ' ', sizeof(TCHAR) * 79); + for (auto& c : Temp) c = L' '; Temp[offset] = 0; - WriteFile(g_FileHandle, Temp, (xOffset - iLastXPos) / pci->dwCharWidth, &dwDummy, nullptr); + WriteFile(g_FileHandle, Temp, (xOffset - iLastXPos) * sizeof(WCHAR) / pci->dwCharWidth, &dwDummy, nullptr); iLastXPos = (xOffset - iLastXPos) + (pci->dwCharWidth * static_cast(cchBuff)); - WriteFile(g_FileHandle, pszBuff, static_cast(cchBuff), &dwDummy, nullptr); + WriteFile(g_FileHandle, pszBuff, static_cast(cchBuff) * sizeof(WCHAR), &dwDummy, nullptr); } else { @@ -695,7 +697,7 @@ HRESULT PrintNextLine(PRINTCBINFO* pci) { DWORD dwDummy; - WriteFile(g_FileHandle, "\r\n", 2, &dwDummy, nullptr); + WriteFile(g_FileHandle, L"\r\n", 4, &dwDummy, nullptr); iLastXPos = 0; return S_OK; } diff --git a/dxview.cpp b/dxview.cpp index d522ed9..5176156 100644 --- a/dxview.cpp +++ b/dxview.cpp @@ -27,14 +27,14 @@ static_assert(c_tabStop >= c_DefNameLength, "print stop should be at least as lo HINSTANCE g_hInstance = nullptr; HWND g_hwndMain = nullptr; -CHAR g_strAppName[] = "DXView"; -CHAR g_strClassName[] = "DXView"; -CHAR g_strTitle[] = "DirectX Caps Viewer"; +WCHAR g_strAppName[] = L"DXView"; +WCHAR g_strClassName[] = L"DXView"; +WCHAR g_strTitle[] = L"DirectX Caps Viewer"; -extern const char c_szYes[] = "Yes"; -extern const char c_szNo[] = "No"; -extern const char c_szCurrentMode[] = "Current Mode"; -extern const char c_szNA[] = "n/a"; +extern const WCHAR c_szYes[] = L"Yes"; +extern const WCHAR c_szNo[] = L"No"; +extern const WCHAR c_szCurrentMode[] = L"Current Mode"; +extern const WCHAR c_szNA[] = L"n/a"; HWND g_hwndLV = nullptr; // List view HWND g_hwndTV = nullptr; // Tree view @@ -47,9 +47,9 @@ DWORD g_dwViewState; DWORD g_dwView9Ex; DWORD g_tmAveCharWidth; extern BOOL g_PrintToFile; -extern TCHAR g_PrintToFilePath[MAX_PATH]; -CHAR g_szClip[c_maxPasteBuffer]; -TCHAR g_helpPath[MAX_PATH] = {}; +extern WCHAR g_PrintToFilePath[MAX_PATH]; +WCHAR g_szClip[c_maxPasteBuffer]; +WCHAR g_helpPath[MAX_PATH] = {}; //----------------------------------------------------------------------------- // Local function prototypes @@ -93,27 +93,27 @@ BOOL DXG_Is9Ex(); // Name: Int2Str() // Desc: Get number as a string //----------------------------------------------------------------------------- -HRESULT Int2Str( _Out_z_cap_(nDestLen) LPTSTR strDest, UINT nDestLen, DWORD i ) +HRESULT Int2Str( _Out_z_cap_(nDestLen) LPWSTR strDest, UINT nDestLen, DWORD i ) { *strDest = 0; - char strDec[2]; + WCHAR strDec[2]; GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, strDec, 2 ); - char strIn[32]; - sprintf_s( strIn, sizeof(strIn), "%u",i ); + WCHAR strIn[32]; + swprintf_s( strIn, 32, L"%u", i ); - char strOut[32]; + WCHAR strOut[32]; if( 0 == GetNumberFormat( LOCALE_USER_DEFAULT, 0, strIn, nullptr, strOut, 32 ) ) { - strcpy_s( strDest, nDestLen, strIn ); + wcscpy_s( strDest, nDestLen, strIn ); return E_FAIL; } - char * pstrDec = strrchr( strOut, strDec[0] ); + WCHAR * pstrDec = wcschr( strOut, strDec[0] ); if( pstrDec) *pstrDec = '\0'; - if( strcpy_s( strDest, nDestLen, strOut ) != 0) + if( wcscpy_s( strDest, nDestLen, strOut ) != 0) { *strDest = 0; return E_FAIL; @@ -125,7 +125,7 @@ HRESULT Int2Str( _Out_z_cap_(nDestLen) LPTSTR strDest, UINT nDestLen, DWORD i ) //----------------------------------------------------------------------------- _Use_decl_annotations_ -HRESULT PrintStringValueLine(const char * szText, const char * szText2, PRINTCBINFO *lpInfo) +HRESULT PrintStringValueLine(const WCHAR * szText, const WCHAR * szText2, PRINTCBINFO *lpInfo) { // Calculate Name and Value column x offsets int xName = (lpInfo->dwCurrIndent * DEF_TAB_SIZE * lpInfo->dwCharWidth); @@ -133,17 +133,17 @@ HRESULT PrintStringValueLine(const char * szText, const char * szText2, PRINTCBI int yLine = (lpInfo->dwCurrLine * lpInfo->dwLineHeight); // Print name - char szBuff[c_maxPrintLine]; - strcpy_s(szBuff, sizeof(szBuff), szText); - szBuff[c_maxPrintLine - 1] = '\0'; - auto cchLen = static_cast(_tcslen(szText)); + WCHAR szBuff[c_maxPrintLine]; + wcscpy_s(szBuff, c_maxPrintLine, szText); + szBuff[c_maxPrintLine - 1] = L'\0'; + auto cchLen = static_cast(wcslen(szText)); if( FAILED( PrintLine (xName, yLine, szBuff, cchLen, lpInfo) ) ) return E_FAIL; // Print value - strcpy_s(szBuff, sizeof(szBuff), szText2); - szBuff[c_maxPrintLine - 1] = '\0'; - cchLen = static_cast(_tcslen(szText2)); + wcscpy_s(szBuff, c_maxPrintLine, szText2); + szBuff[c_maxPrintLine - 1] = L'\0'; + cchLen = static_cast(wcslen(szText2)); if( FAILED( PrintLine (xVal, yLine, szBuff, cchLen, lpInfo) ) ) return E_FAIL; @@ -157,9 +157,9 @@ HRESULT PrintStringValueLine(const char * szText, const char * szText2, PRINTCBI //----------------------------------------------------------------------------- _Use_decl_annotations_ -HRESULT PrintValueLine(const char * szText, DWORD dwValue, PRINTCBINFO *lpInfo) +HRESULT PrintValueLine(const WCHAR * szText, DWORD dwValue, PRINTCBINFO *lpInfo) { - char szBuff[c_maxPrintLine]; + WCHAR szBuff[c_maxPrintLine]; Int2Str(szBuff, c_maxPrintLine, dwValue); return PrintStringValueLine( szText, szBuff, lpInfo ); } @@ -167,27 +167,27 @@ HRESULT PrintValueLine(const char * szText, DWORD dwValue, PRINTCBINFO *lpInfo) //----------------------------------------------------------------------------- _Use_decl_annotations_ -HRESULT PrintHexValueLine(const char * szText, DWORD dwValue, PRINTCBINFO *lpInfo) +HRESULT PrintHexValueLine(const WCHAR * szText, DWORD dwValue, PRINTCBINFO *lpInfo) { - char szBuff[c_maxPrintLine]; - sprintf_s( szBuff, sizeof(szBuff), "0x%08x", dwValue ); + WCHAR szBuff[c_maxPrintLine]; + swprintf_s( szBuff, c_maxPrintLine, L"0x%08x", dwValue ); return PrintStringValueLine( szText, szBuff, lpInfo ); } //----------------------------------------------------------------------------- _Use_decl_annotations_ -HRESULT PrintStringLine(const char * szText, PRINTCBINFO *lpInfo) +HRESULT PrintStringLine(const WCHAR* szText, PRINTCBINFO *lpInfo) { // Calculate Name and Value column x offsets int xName = (lpInfo->dwCurrIndent * DEF_TAB_SIZE * lpInfo->dwCharWidth); int yLine = (lpInfo->dwCurrLine * lpInfo->dwLineHeight); // Print name - char szBuff[c_maxPrintLine]; - strcpy_s(szBuff, sizeof(szBuff), szText); - szBuff[c_maxPrintLine - 1] = '\0'; - auto cchLen = static_cast(_tcslen(szText)); + WCHAR szBuff[c_maxPrintLine]; + wcscpy_s(szBuff, c_maxPrintLine, szText); + szBuff[c_maxPrintLine - 1] = L'\0'; + auto cchLen = static_cast(wcslen(szText)); if( FAILED( PrintLine (xName, yLine, szBuff, cchLen, lpInfo) ) ) return E_FAIL; @@ -202,11 +202,11 @@ HRESULT PrintStringLine(const char * szText, PRINTCBINFO *lpInfo) //----------------------------------------------------------------------------- // Name: WinMain //----------------------------------------------------------------------------- -int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE /*hPrevInstance*/, - _In_ LPSTR /*strCmdLine*/, _In_ int /*nCmdShow*/) +int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE /*hPrevInstance*/, + _In_ LPWSTR /*strCmdLine*/, _In_ int /*nCmdShow*/) { g_hInstance = hInstance; // Store instance handle in our global variable - g_PrintToFilePath[0] = TEXT('\0'); + g_PrintToFilePath[0] = L'\0'; // Initialize COM HRESULT hr = CoInitializeEx(nullptr, COINITBASE_MULTITHREADED); @@ -228,7 +228,7 @@ int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE /*hPrevInstance* wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DIRECTX)); // Icon name from .RC wc.hCursor = LoadCursor(NULL, IDC_SIZEWE);// Cursor wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); // Default color - wc.lpszMenuName = "Menu"; // Menu name from .RC + wc.lpszMenuName = L"Menu"; // Menu name from .RC wc.lpszClassName = g_strClassName; // Name to register as RegisterClass(&wc); @@ -244,50 +244,50 @@ int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE /*hPrevInstance* return -1; } - TCHAR* pszCmdLine = GetCommandLine(); + WCHAR* pszCmdLine = GetCommandLine(); // Skip past program name (first token in command line). - if (*pszCmdLine == TEXT('"')) // Check for and handle quoted program name + if (*pszCmdLine == L'"') // Check for and handle quoted program name { pszCmdLine++; // Scan, and skip over, subsequent characters until another // double-quote or a null is encountered - while (*pszCmdLine && (*pszCmdLine != TEXT('"'))) + while (*pszCmdLine && (*pszCmdLine != L'"')) pszCmdLine++; // If we stopped on a double-quote (usual case), skip over it. - if (*pszCmdLine == TEXT('"')) + if (*pszCmdLine == L'"') pszCmdLine++; } else // First token wasn't a quote { - while (*pszCmdLine > TEXT(' ')) + while (*pszCmdLine > L' ') pszCmdLine++; } // Skip past any white space preceeding the next token. - while (*pszCmdLine && (*pszCmdLine <= TEXT(' '))) + while (*pszCmdLine && (*pszCmdLine <= L' ')) pszCmdLine++; // Treat the rest of the command line as a filename to save the whole tree to - TCHAR* pstrSave = g_PrintToFilePath; - if (*pszCmdLine == TEXT('"')) // Check for and handle quoted program name + WCHAR* pstrSave = g_PrintToFilePath; + if (*pszCmdLine == L'"') // Check for and handle quoted program name { pszCmdLine++; // Scan, and copy, subsequent characters until another // double-quote or a null is encountered - while (*pszCmdLine && (*pszCmdLine != TEXT('"'))) + while (*pszCmdLine && (*pszCmdLine != L'"')) *pstrSave++ = *pszCmdLine++; // If we stopped on a double-quote (usual case), skip over it. - if (*pszCmdLine == TEXT('"')) + if (*pszCmdLine == L'"') pszCmdLine++; } else // First token wasn't a quote { - while (*pszCmdLine > TEXT(' ')) + while (*pszCmdLine > L' ') *pstrSave++ = *pszCmdLine++; } - *pstrSave = TEXT('\0'); + *pstrSave = L'\0'; - if (strlen(g_PrintToFilePath) > 0) + if (wcslen(g_PrintToFilePath) > 0) { PostMessage(g_hwndMain, WM_COMMAND, IDM_PRINTWHOLETREETOFILE, 0); PostMessage(g_hwndMain, WM_CLOSE, 0, 0); @@ -438,7 +438,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) //----------------------------------------------------------------------------- VOID CreateCopyMenu(VOID) { - HMENU hPopupMenu = LoadMenu(nullptr, "POPUP"); + HMENU hPopupMenu = LoadMenu(nullptr, L"POPUP"); if (!hPopupMenu) return; HMENU hMenu = GetSubMenu(hPopupMenu, 0); @@ -447,11 +447,11 @@ VOID CreateCopyMenu(VOID) DestroyMenu(hPopupMenu); return; } - TCHAR szMenu[c_maxPasteBuffer]; + WCHAR szMenu[c_maxPasteBuffer]; GetMenuString(hMenu, IDM_COPY, szMenu, c_maxPasteBuffer, MF_BYCOMMAND); - TCHAR szMenuNew[c_maxPasteBuffer]; - sprintf_s(szMenuNew, sizeof(szMenuNew), szMenu, g_szClip); + WCHAR szMenuNew[c_maxPasteBuffer]; + swprintf_s(szMenuNew, c_maxPasteBuffer, szMenu, g_szClip); MENUITEMINFO mii = {}; mii.cbSize = sizeof(mii); @@ -499,13 +499,13 @@ BOOL DXView_OnCreate(HWND hWnd) CheckMenuItem(GetMenu(hWnd), g_dwViewState, MF_BYCOMMAND | MF_CHECKED); // Create the list view window. - g_hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, "", + g_hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, L"", WS_VISIBLE | WS_CHILD | LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL, 0, 0, 0, 0, hWnd, (HMENU)IDC_LV, g_hInstance, nullptr); ListView_SetExtendedListViewStyleEx(g_hwndLV, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); // create the tree view window. - g_hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, "", + g_hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, L"", WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SHOWSELALWAYS, 0, 0, 0, 0, hWnd, (HMENU)IDC_TV, g_hInstance, nullptr); @@ -534,10 +534,10 @@ void AddCapsToTV(HTREEITEM hRoot, CAPDEFS* pcds, LPARAM lParam1) hParent[0] = hRoot; int level = 0; - const char* name; + const WCHAR* name; while ((name = pcds->strName) != nullptr) { - if (name[0] == '-') + if (name[0] == L'-') { level--; if (level < 0) @@ -545,7 +545,7 @@ void AddCapsToTV(HTREEITEM hRoot, CAPDEFS* pcds, LPARAM lParam1) name++; } - if (name[0] == '+') + if (name[0] == L'+') { bRoot = TRUE; name++; @@ -577,7 +577,7 @@ void AddCapsToTV(HTREEITEM hRoot, CAPDEFS* pcds, LPARAM lParam1) // column headers like AddCapsToLV does. void AddMoreCapsToLV(CAPDEF* pcd, LPVOID pv) { - TCHAR szBuff[64]; + WCHAR szBuff[64]; while (pcd->strName && *pcd->strName) { @@ -592,46 +592,46 @@ void AddMoreCapsToLV(CAPDEF* pcd, LPVOID pv) switch (pcd->dwFlag) { case 0: - LVAddText(g_hwndLV, 0, "%s", pcd->strName); + LVAddText(g_hwndLV, 0, L"%s", pcd->strName); Int2Str(szBuff, 64, dwValue); - LVAddText(g_hwndLV, 1, "%s", szBuff); + LVAddText(g_hwndLV, 1, L"%s", szBuff); break; case 0xFFFFFFFF: // Hex - LVAddText(g_hwndLV, 0, "%s", pcd->strName); - LVAddText(g_hwndLV, 1, "0x%08X", dwValue); + LVAddText(g_hwndLV, 0, L"%s", pcd->strName); + LVAddText(g_hwndLV, 1, L"0x%08X", dwValue); break; case 0xEFFFFFFF: // Shader Version - LVAddText(g_hwndLV, 0, "%s", pcd->strName); - LVAddText(g_hwndLV, 1, "%d.%0d", D3DSHADER_VERSION_MAJOR(dwValue), D3DSHADER_VERSION_MINOR(dwValue)); + LVAddText(g_hwndLV, 0, L"%s", pcd->strName); + LVAddText(g_hwndLV, 1, L"%d.%0d", D3DSHADER_VERSION_MAJOR(dwValue), D3DSHADER_VERSION_MINOR(dwValue)); break; case 0xBFFFFFFF: // FLOAT Support for new DX6 "D3DVALUE" values in D3DDeviceDesc { - LVAddText(g_hwndLV, 0, "%s", pcd->strName); + LVAddText(g_hwndLV, 0, L"%s", pcd->strName); auto fValue = *reinterpret_cast(static_cast(pv) + pcd->dwOffset); - LVAddText(g_hwndLV, 1, "%G", fValue); + LVAddText(g_hwndLV, 1, L"%G", fValue); break; } case 0x7FFFFFFF: // HEX Support for new DX6 "WORD" values in D3DDeviceDesc - LVAddText(g_hwndLV, 0, "%s", pcd->strName); + LVAddText(g_hwndLV, 0, L"%s", pcd->strName); dwValue = *reinterpret_cast(static_cast(pv) + pcd->dwOffset); - LVAddText(g_hwndLV, 1, "0x%04X", dwValue); + LVAddText(g_hwndLV, 1, L"0x%04X", dwValue); break; case 0x3FFFFFFF: // VAL Support for new DX6 "WORD" values in D3DDeviceDesc - LVAddText(g_hwndLV, 0, "%s", pcd->strName); + LVAddText(g_hwndLV, 0, L"%s", pcd->strName); dwValue = *reinterpret_cast(static_cast(pv) + pcd->dwOffset); Int2Str(szBuff, 64, dwValue); - LVAddText(g_hwndLV, 1, "%s", szBuff); + LVAddText(g_hwndLV, 1, L"%s", szBuff); break; case 0x1FFFFFFF: // "-1 == unlimited" - LVAddText(g_hwndLV, 0, "%s", pcd->strName); + LVAddText(g_hwndLV, 0, L"%s", pcd->strName); if (dwValue == 0xFFFFFFFF) { - LVAddText(g_hwndLV, 1, "Unlimited"); + LVAddText(g_hwndLV, 1, L"Unlimited"); } else { Int2Str(szBuff, 64, dwValue); - LVAddText(g_hwndLV, 1, "%s", szBuff); + LVAddText(g_hwndLV, 1, L"%s", szBuff); } break; case 0x0fffffff: // Mask with 0xffff @@ -639,7 +639,7 @@ void AddMoreCapsToLV(CAPDEF* pcd, LPVOID pv) LVAddText(g_hwndLV, 0, pcd->strName); dwValue = (*reinterpret_cast(static_cast(pv) + pcd->dwOffset)) & 0xffff; Int2Str(szBuff, 64, dwValue); - LVAddText(g_hwndLV, 1, "%s", szBuff); + LVAddText(g_hwndLV, 1, L"%s", szBuff); } break; default: @@ -664,8 +664,8 @@ void AddMoreCapsToLV(CAPDEF* pcd, LPVOID pv) // AddColsToLV adds the column headers but no data. void AddColsToLV(void) { - LVAddColumn(g_hwndLV, 0, "Name", c_DefNameLength); - LVAddColumn(g_hwndLV, 1, "Value", 10); + LVAddColumn(g_hwndLV, 0, L"Name", c_DefNameLength); + LVAddColumn(g_hwndLV, 1, L"Value", 10); } @@ -682,7 +682,8 @@ _Use_decl_annotations_ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) { DWORD cchLen; - TCHAR szValue[100]; + const SIZE_T szValueLength = 100; + WCHAR szValue[szValueLength]; // Check Parameters if ((!pcd) || (!lpInfo)) @@ -709,12 +710,12 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) { case 0xFFFFFFFF: // Hex // Print name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print value in hex - sprintf_s(szValue, sizeof(szValue), "0x%08X", dwValue); - if (FAILED(PrintLine(xVal, yLine, szValue, strlen(szValue), lpInfo))) + swprintf_s(szValue, szValueLength, L"0x%08X", dwValue); + if (FAILED(PrintLine(xVal, yLine, szValue, wcslen(szValue), lpInfo))) return E_FAIL; // Advance to next line on page if (FAILED(PrintNextLine(lpInfo))) @@ -723,12 +724,12 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) case 0xEFFFFFFF: // Shader Version // Print name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print version - sprintf_s(szValue, sizeof(szValue), "%u.%0u", D3DSHADER_VERSION_MAJOR(dwValue), D3DSHADER_VERSION_MINOR(dwValue)); - if (FAILED(PrintLine(xVal, yLine, szValue, strlen(szValue), lpInfo))) + swprintf_s(szValue, szValueLength, L"%u.%0u", D3DSHADER_VERSION_MAJOR(dwValue), D3DSHADER_VERSION_MINOR(dwValue)); + if (FAILED(PrintLine(xVal, yLine, szValue, wcslen(szValue), lpInfo))) return E_FAIL; // Advance to next line on page if (FAILED(PrintNextLine(lpInfo))) @@ -738,13 +739,13 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) case 0xBFFFFFFF: // FLOAT Support for new DX6 "D3DVALUE" values in D3DDeviceDesc { // Print name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print value auto fValue = *reinterpret_cast(static_cast(pv) + pcd->dwOffset); - sprintf_s(szValue, sizeof(szValue), "%G", fValue); - if (FAILED(PrintLine(xVal, yLine, szValue, strlen(szValue), lpInfo))) + swprintf_s(szValue, szValueLength, L"%G", fValue); + if (FAILED(PrintLine(xVal, yLine, szValue, wcslen(szValue), lpInfo))) return E_FAIL; // Advance to next line on page if (FAILED(PrintNextLine(lpInfo))) @@ -754,13 +755,13 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) case 0x7FFFFFFF: // HEX Support for new DX6 "WORD" values in D3DDeviceDesc // Print name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print value dwValue = *reinterpret_cast(static_cast(pv) + pcd->dwOffset); - sprintf_s(szValue, sizeof(szValue), "0x%04X", dwValue); - if (FAILED(PrintLine(xVal, yLine, szValue, strlen(szValue), lpInfo))) + swprintf_s(szValue, szValueLength, L"0x%04X", dwValue); + if (FAILED(PrintLine(xVal, yLine, szValue, wcslen(szValue), lpInfo))) return E_FAIL; // Advance to next line on page if (FAILED(PrintNextLine(lpInfo))) @@ -769,14 +770,14 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) case 0x3FFFFFFF: // VAL Support for new DX6 "WORD" values in D3DDeviceDesc // Print name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print value dwValue = *reinterpret_cast(static_cast(pv) + pcd->dwOffset); *szValue = 0; Int2Str(szValue, 100, dwValue); - if (FAILED(PrintLine(xVal, yLine, szValue, strlen(szValue), lpInfo))) + if (FAILED(PrintLine(xVal, yLine, szValue, wcslen(szValue), lpInfo))) return E_FAIL; // Advance to next line on page if (FAILED(PrintNextLine(lpInfo))) @@ -785,16 +786,16 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) case 0x1FFFFFFF: // "-1 == unlimited" // Print name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print value *szValue = 0; if (dwValue == 0xFFFFFFFF) - strcpy_s(szValue, sizeof(szValue), "Unlimited"); + wcscpy_s(szValue, szValueLength, L"Unlimited"); else Int2Str(szValue, 100, dwValue); - if (FAILED(PrintLine(xVal, yLine, szValue, strlen(szValue), lpInfo))) + if (FAILED(PrintLine(xVal, yLine, szValue, wcslen(szValue), lpInfo))) return E_FAIL; // Advance to next line on page if (FAILED(PrintNextLine(lpInfo))) @@ -805,12 +806,12 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) if (pcd->dwFlag & dwValue) { // Print Name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print Yes in value column - cchLen = static_cast(_tcslen(c_szYes)); + cchLen = static_cast(wcslen(c_szYes)); if (FAILED(PrintLine(xVal, yLine, c_szYes, cchLen, lpInfo))) return E_FAIL; @@ -821,12 +822,12 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) else if (g_dwViewState == IDM_VIEWALL) { // Print name - cchLen = static_cast(_tcslen(pcd->strName)); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, pcd->strName, cchLen, lpInfo))) return E_FAIL; // Print No in value column - cchLen = static_cast(_tcslen(c_szNo)); + cchLen = static_cast(wcslen(c_szNo)); if (FAILED(PrintLine(xVal, yLine, c_szNo, cchLen, lpInfo))) return E_FAIL; @@ -839,17 +840,17 @@ HRESULT PrintCapsToDC(CAPDEF* pcd, LPVOID pv, PRINTCBINFO* lpInfo) } else { - char szBuff[c_maxPrintLine]; + WCHAR szBuff[c_maxPrintLine]; // Print name - sprintf_s(szBuff, sizeof(szBuff), pcd->strName, "test"); - cchLen = static_cast(_tcslen(pcd->strName)); + swprintf_s(szBuff, c_maxPrintLine, pcd->strName, L"test"); + cchLen = static_cast(wcslen(pcd->strName)); if (FAILED(PrintLine(xName, yLine, szBuff, cchLen, lpInfo))) return E_FAIL; // Print value Int2Str(szBuff, c_maxPrintLine, dwValue); - cchLen = static_cast(_tcslen(szBuff)); + cchLen = static_cast(wcslen(szBuff)); if (FAILED(PrintLine(xVal, yLine, szBuff, cchLen, lpInfo))) return E_FAIL; @@ -870,7 +871,7 @@ void DXView_OnTreeSelect(HWND /*hwndTV*/, NM_TREEVIEW* ptv) { SendMessage(g_hwndLV, WM_SETREDRAW, FALSE, 0); LVDeleteAllItems(g_hwndLV); - LVAddColumn(g_hwndLV, 0, "", 0); + LVAddColumn(g_hwndLV, 0, L"", 0); NODEINFO* pni = nullptr; if (!ptv) @@ -958,18 +959,18 @@ void DXView_OnCommand(HWND hWnd, WPARAM wParam) case IDM_COPY: { // Put g_szClip into the clipboard - UINT GlobalSize = static_cast(strlen(g_szClip) + 1); - HGLOBAL hGlobal = GlobalAlloc(GHND | GMEM_SHARE, GlobalSize); + UINT GlobalSize = static_cast(wcslen(g_szClip) + 1); + HGLOBAL hGlobal = GlobalAlloc(GHND | GMEM_SHARE, GlobalSize * sizeof(WCHAR)); if (hGlobal) { VOID* pGlobal = GlobalLock(hGlobal); if (pGlobal) { - strcpy_s((CHAR*)pGlobal, GlobalSize, g_szClip); + wcscpy_s((WCHAR*)pGlobal, GlobalSize, g_szClip); GlobalUnlock(hGlobal); OpenClipboard(g_hwndMain); EmptyClipboard(); - SetClipboardData(CF_TEXT, hGlobal); + SetClipboardData(CF_UNICODETEXT, hGlobal); CloseClipboard(); } } @@ -977,7 +978,7 @@ void DXView_OnCommand(HWND hWnd, WPARAM wParam) break; case IDM_ABOUT: - DialogBox(g_hInstance, "About", hWnd, (DLGPROC)About); + DialogBox(g_hInstance, L"About", hWnd, (DLGPROC)About); break; case IDM_EXIT: @@ -1045,10 +1046,10 @@ LRESULT CALLBACK About(HWND hDlg, UINT msg, WPARAM wParam, LPARAM /*lParam*/) case WM_INITDIALOG: { VS_FIXEDFILEINFO* pVersion = nullptr; - TCHAR strFmt[500]; + WCHAR strFmt[500]; GetWindowText(GetDlgItem(hDlg, IDC_VERSION), strFmt, 500); - TCHAR szFile[MAX_PATH]; + WCHAR szFile[MAX_PATH]; *szFile = 0; GetModuleFileName(nullptr, szFile, MAX_PATH); @@ -1064,18 +1065,18 @@ LRESULT CALLBACK About(HWND hDlg, UINT msg, WPARAM wParam, LPARAM /*lParam*/) if (GetFileVersionInfo(szFile, 0, cb, FileVersionBuffer)) { pVersion = nullptr; - if (VerQueryValue(FileVersionBuffer, "\\", (VOID**)&pVersion, &cb) + if (VerQueryValue(FileVersionBuffer, L"\\", (VOID**)&pVersion, &cb) && pVersion != nullptr) { - TCHAR strVersion[100]; - sprintf_s(strVersion, sizeof(strVersion), "%u.%02u.%02u.%04u", + WCHAR strVersion[100]; + swprintf_s(strVersion, 100, L"%u.%02u.%02u.%04u", HIWORD(pVersion->dwFileVersionMS), LOWORD(pVersion->dwFileVersionMS), HIWORD(pVersion->dwFileVersionLS), LOWORD(pVersion->dwFileVersionLS)); - TCHAR str[500]; - sprintf_s(str, sizeof(str), strFmt, strVersion); + WCHAR str[500]; + swprintf_s(str, 500, strFmt, strVersion); SetWindowText(GetDlgItem(hDlg, IDC_VERSION), str); } } @@ -1084,7 +1085,7 @@ LRESULT CALLBACK About(HWND hDlg, UINT msg, WPARAM wParam, LPARAM /*lParam*/) // Note: The warning text is static, but it must be set via code, // not in the .rc file, because it is > 256 characters (warning RC4206). { - const TCHAR* pstrWarning = TEXT("Warning: This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law."); + const WCHAR* pstrWarning = L"Warning: This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law."; SetWindowText(GetDlgItem(hDlg, IDC_WARNING), pstrWarning); } return TRUE; @@ -1147,7 +1148,7 @@ VOID DXView_OnSize(HWND hWnd) //----------------------------------------------------------------------------- -void LVAddColumn(HWND hwndLV, int i, const char* name, int width) +void LVAddColumn(HWND hwndLV, int i, const WCHAR* name, int width) { if (i == 0) { @@ -1158,21 +1159,21 @@ void LVAddColumn(HWND hwndLV, int i, const char* name, int width) LV_COLUMN col = {}; col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; col.fmt = LVCFMT_LEFT; - col.pszText = (char*)name; + col.pszText = (WCHAR*)name; col.cx = width * g_tmAveCharWidth; ListView_InsertColumn(hwndLV, i, &col); } //----------------------------------------------------------------------------- -int LVAddText(HWND hwndLV, int col, const char* sz, ...) +int LVAddText(HWND hwndLV, int col, const WCHAR* sz, ...) { va_list vl; va_start(vl, sz); - char ach[c_maxPrintLine]; - vsprintf_s(ach, sizeof(ach), sz, vl); - ach[c_maxPrintLine - 1] = '\0'; + WCHAR ach[c_maxPrintLine]; + vswprintf_s(ach, c_maxPrintLine, sz, vl); + ach[c_maxPrintLine - 1] = L'\0'; LV_ITEM lvi = {}; lvi.mask = LVIF_TEXT; @@ -1203,7 +1204,7 @@ void LVDeleteAllItems(HWND hwndLV) //----------------------------------------------------------------------------- -HTREEITEM TVAddNode(HTREEITEM hParent, LPCSTR strText, BOOL fKids, +HTREEITEM TVAddNode(HTREEITEM hParent, LPCWSTR strText, BOOL fKids, int iImage, DISPLAYCALLBACK fnDisplayCallback, LPARAM lParam1, LPARAM lParam2) { @@ -1227,14 +1228,14 @@ HTREEITEM TVAddNode(HTREEITEM hParent, LPCSTR strText, BOOL fKids, tvi.item.iSelectedImage = iImage - IDI_FIRSTIMAGE; tvi.item.lParam = (LPARAM)pni; tvi.item.cChildren = fKids; - tvi.item.pszText = (LPSTR)strText; + tvi.item.pszText = (LPWSTR)strText; return TreeView_InsertItem(g_hwndTV, &tvi); } //----------------------------------------------------------------------------- -HTREEITEM TVAddNodeEx(HTREEITEM hParent, LPCSTR strText, BOOL fKids, +HTREEITEM TVAddNodeEx(HTREEITEM hParent, LPCWSTR strText, BOOL fKids, int iImage, DISPLAYCALLBACKEX fnDisplayCallback, LPARAM lParam1, LPARAM lParam2, LPARAM lParam3) { @@ -1258,7 +1259,7 @@ HTREEITEM TVAddNodeEx(HTREEITEM hParent, LPCSTR strText, BOOL fKids, tvi.item.iSelectedImage = iImage - IDI_FIRSTIMAGE; tvi.item.lParam = (LPARAM)pni; tvi.item.cChildren = fKids; - tvi.item.pszText = (LPSTR)strText; + tvi.item.pszText = (LPWSTR)strText; return TreeView_InsertItem(g_hwndTV, &tvi); } diff --git a/dxview.h b/dxview.h index 029e91b..c8598c8 100644 --- a/dxview.h +++ b/dxview.h @@ -12,7 +12,6 @@ #include #include -#include #include #include @@ -74,7 +73,7 @@ struct NODEINFO struct CAPDEF { - const CHAR* strName; // Name of cap + const WCHAR* strName; // Name of cap LONG dwOffset; // Offset to cap DWORD dwFlag; // Bit flag for cal DWORD dwCapsFlags; // used for optional caps and such (see DXV_ values above) @@ -82,7 +81,7 @@ struct CAPDEF struct CAPDEFS { - const CHAR* strName; // Name of cap + const WCHAR* strName; // Name of cap DISPLAYCALLBACK fnDisplayCallback; LPARAM lParam2; }; @@ -99,23 +98,66 @@ struct LOCALAPP { LOCALAPP* pNext; GUID guidApplication; - CHAR strAppNameA[1]; + WCHAR strAppNameW[1]; }; +class WideString { +public: + explicit inline WideString(const char* str) : WideString(str, -1) + { + } + explicit inline WideString(const char* str, int strLen) : strBuffer(NULL), szCap(0), szLength(0) + { + const int cnt = MultiByteToWideChar(CP_ACP, 0, str, strLen, NULL, 0); + if (cnt <= 0) + return; + szCap = (SIZE_T)(cnt + 1); + strBuffer = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, szCap * sizeof(WCHAR)); + if (strBuffer == NULL) + { + szCap = 0; + return; + } + ZeroMemory(strBuffer, szCap * sizeof(WCHAR)); + const int len = MultiByteToWideChar(CP_ACP, 0, str, strLen, strBuffer, cnt); + if (len != cnt) + { + HeapFree(GetProcessHeap(), 0, strBuffer); + strBuffer = NULL; + szCap = 0; + return; + } + szLength = (SIZE_T)len; + } + explicit inline WideString(const char* str, SIZE_T strLen) : WideString(str, (int)strLen) + { + } + inline ~WideString() + { + if (strBuffer) + HeapFree(GetProcessHeap(), 0, strBuffer); + } + const WCHAR* c_str() const { return strBuffer ? strBuffer : L""; } +private: + WCHAR* strBuffer; + SIZE_T szCap; + SIZE_T szLength; +}; + //----------------------------------------------------------------------------- // DXView treeview/listview helper functions //----------------------------------------------------------------------------- -VOID LVAddColumn( HWND hwndLV, int i, const CHAR* strName, int width ); -int LVAddText( HWND hwndLV, int col, const CHAR* str, ... ); +VOID LVAddColumn( HWND hwndLV, int i, const WCHAR* strName, int width ); +int LVAddText( HWND hwndLV, int col, const WCHAR* str, ... ); VOID LVDeleteAllItems( HWND hwndLV ); -HTREEITEM TVAddNode(HTREEITEM hParent, LPCSTR strText, BOOL bKids, int iImage, +HTREEITEM TVAddNode(HTREEITEM hParent, LPCWSTR strText, BOOL bKids, int iImage, DISPLAYCALLBACK Callback, LPARAM lParam1, LPARAM lParam2 ); -HTREEITEM TVAddNodeEx(HTREEITEM hParent, LPCSTR strText, BOOL bKids, int iImage, - DISPLAYCALLBACKEX Callback, LPARAM lParam1, LPARAM lParam2, - LPARAM lParam3 ); +HTREEITEM TVAddNodeEx(HTREEITEM hParent, LPCWSTR strText, BOOL bKids, int iImage, + DISPLAYCALLBACKEX Callback, LPARAM lParam1, LPARAM lParam2, + LPARAM lParam3 ); VOID AddCapsToTV( HTREEITEM hParent, CAPDEFS *pcds, LPARAM lParam1 ); VOID AddColsToLV(); VOID AddCapsToLV( CAPDEF* pcd, VOID* pv ); @@ -123,12 +165,12 @@ VOID AddMoreCapsToLV( CAPDEF* pcd, VOID* pv ); HRESULT PrintCapsToDC( CAPDEF* pcd, VOID* pv, _In_ PRINTCBINFO* pInfo ); // Printer Helper functions -HRESULT PrintLine(int x, int y, _In_count_(cchBuff) LPCTSTR lpszBuff, size_t cchBuff, _In_ PRINTCBINFO* pci); +HRESULT PrintLine(int x, int y, _In_count_(cchBuff) LPCWSTR lpszBuff, size_t cchBuff, _In_ PRINTCBINFO* pci); HRESULT PrintNextLine(_In_ PRINTCBINFO* pci ); -HRESULT PrintValueLine(_In_z_ const char* szText, DWORD dwValue, _In_ PRINTCBINFO* lpInfo); -HRESULT PrintHexValueLine(_In_z_ const CHAR* szText, DWORD dwValue, _In_ PRINTCBINFO* lpInfo); -HRESULT PrintStringValueLine(_In_z_ const CHAR* szText, const CHAR* szText2, _In_ PRINTCBINFO* lpInfo); -HRESULT PrintStringLine(_In_z_ const CHAR* szText, _In_ PRINTCBINFO* lpInfo); +HRESULT PrintValueLine(_In_z_ const WCHAR* szText, DWORD dwValue, _In_ PRINTCBINFO* lpInfo); +HRESULT PrintHexValueLine(_In_z_ const WCHAR* szText, DWORD dwValue, _In_ PRINTCBINFO* lpInfo); +HRESULT PrintStringValueLine(_In_z_ const WCHAR* szText, const WCHAR* szText2, _In_ PRINTCBINFO* lpInfo); +HRESULT PrintStringLine(_In_z_ const WCHAR* szText, _In_ PRINTCBINFO* lpInfo); //----------------------------------------------------------------------------- diff --git a/dxview.rc b/dxview.rc index 0e4636d..07b0773 100644 --- a/dxview.rc +++ b/dxview.rc @@ -1,4 +1,4 @@ -// Microsoft Visual C++ generated resource script. +// Microsoft Visual C++ generated resource script. // #include "resource.h" From 684155b73f7b97027e35a1b49cc24aacb7e3ebf8 Mon Sep 17 00:00:00 2001 From: chuikingshek Date: Wed, 6 Aug 2025 12:03:41 +0800 Subject: [PATCH 2/2] Considering compatibility, convert the output file encoding to native encoding --- dxprint.cpp | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/dxprint.cpp b/dxprint.cpp index be9b3b3..f9ee54d 100644 --- a/dxprint.cpp +++ b/dxprint.cpp @@ -159,6 +159,70 @@ namespace MessageBox(nullptr, strMsg, strTitle, MB_OK); } + //----------------------------------------------------------------------------- + // Name: ConvertEncoding() + // Desc: Convert output file encoding + //----------------------------------------------------------------------------- + VOID ConvertEncoding(HANDLE hFile, UINT CodePage) + { + LARGE_INTEGER pos; + LARGE_INTEGER srcSize; + DWORD dwRead; + DWORD dwWrite; + WCHAR* srcStr = NULL; + int srcLen = 0; + char* dstStr = NULL; + int dstLen = 0; + + if (hFile == NULL || hFile == INVALID_HANDLE_VALUE) + goto lblCLEANUP; + + pos.QuadPart = 0; + if (!SetFilePointerEx(hFile, pos, &srcSize, FILE_CURRENT)) + goto lblCLEANUP; + if (srcSize.QuadPart == 0) + return; // no content + + srcStr = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, srcSize.LowPart); + if (srcStr == NULL) + goto lblCLEANUP; + + pos.QuadPart = 0; + if (!SetFilePointerEx(hFile, pos, NULL, FILE_BEGIN)) + goto lblCLEANUP; + + if (!ReadFile(hFile, srcStr, srcSize.LowPart, &dwRead, NULL)) + goto lblCLEANUP; + srcLen = (int)(dwRead / sizeof(WCHAR)); + + dstLen = WideCharToMultiByte(CodePage, 0, srcStr, srcLen, NULL, 0, NULL, NULL); + if (dstLen <= 0) + goto lblCLEANUP; + + dstStr = (char*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dstLen * sizeof(char)); + if (dstStr == NULL) + goto lblCLEANUP; + + if (WideCharToMultiByte(CodePage, 0, srcStr, srcLen, dstStr, dstLen, NULL, NULL) != dstLen) + goto lblCLEANUP; + + pos.QuadPart = 0; + if (!SetFilePointerEx(hFile, pos, NULL, FILE_BEGIN)) + goto lblCLEANUP; + + if (!WriteFile(hFile, dstStr, dstLen * sizeof(char), &dwWrite, NULL)) + goto lblCLEANUP; + if (dwWrite != dstLen * sizeof(char)) + goto lblCLEANUP; + + SetEndOfFile(hFile); // new file end + + lblCLEANUP: + if (srcStr != NULL) + HeapFree(GetProcessHeap(), 0, srcStr); + if (dstStr != NULL) + HeapFree(GetProcessHeap(), 0, dstStr); + } //----------------------------------------------------------------------------- // Name: PrintStats() @@ -337,7 +401,7 @@ namespace else pstrFile = L"dxview.log"; } - g_FileHandle = CreateFile(pstrFile, GENERIC_WRITE, 0, nullptr, + g_FileHandle = CreateFile(pstrFile, GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); } else @@ -519,6 +583,7 @@ namespace { if (g_PrintToFile) { + ConvertEncoding(g_FileHandle, CP_ACP); CloseHandle(g_FileHandle); } else