Unverified Commit 1423f749 authored by Chuck Walbourn's avatar Chuck Walbourn Committed by GitHub
Browse files

October 2018 releases of DirectX Tool Kit and DirectXTex (#13)

parent ad138b97
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ namespace DirectX
        #if !defined(NO_D3D11_DEBUG_NAME) && ( defined(_DEBUG) || defined(PROFILE) )
            #if defined(_XBOX_ONE) && defined(_TITLE)
                wchar_t wname[MAX_PATH];
                int result = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, TNameLength, wname, MAX_PATH);
                int result = MultiByteToWideChar(CP_UTF8, 0, name, TNameLength, wname, MAX_PATH);
                if (result > 0)
                {
                    resource->SetName(wname);
@@ -132,7 +132,7 @@ namespace DirectX
                resource->SetName( name );
            #else
                char aname[MAX_PATH];
                int result = WideCharToMultiByte(CP_ACP, 0, name, TNameLength, aname, MAX_PATH, nullptr, nullptr);
                int result = WideCharToMultiByte(CP_UTF8, 0, name, TNameLength, aname, MAX_PATH, nullptr, nullptr);
                if (result > 0)
                {
                    resource->SetPrivateData(WKPDID_D3DDebugObjectName, TNameLength - 1, aname);
+58 −39
Original line number Diff line number Diff line
@@ -4,21 +4,22 @@ DirectXTK - the DirectX Tool Kit for DirectX 11

Copyright (c) Microsoft Corporation. All rights reserved.

August 17, 2018
October 31, 2018

This package contains the "DirectX Tool Kit", a collection of helper classes for
writing Direct3D 11 C++ code for Universal Windows Platform (UWP) apps for Windows 10,
Windows Store apps, Windows phone 8.1 applications, Xbox One exclusive apps,
Windows 8.x Win32 desktop applications, Windows 7 Service Pack 1 applications, and
Windows Vista Service Pack 2 Direct3D 11.0 applications.
writing Direct3D 11 C++ code for Universal Windows Platform (UWP) apps for
Windows 10, Windows Store apps, Windows phone 8.1 applications, Xbox One,
Windows 8.x Win32 desktop applications, Windows 7 Service Pack 1 applications,
and Windows Vista Service Pack 2 Direct3D 11.0 applications.

This code is designed to build with Visual Studio 2015 Update 3 or Visual Studio 2017.
It is recommended that you make use of VS 2015 Update 3, Windows Tools 1.4.1, and the
Windows 10 Anniversary Update SDK (14393) or VS 2017 (15.8 update) with the
Windows 10 April 2018 Update SDK (17134).
This code is designed to build with Visual Studio 2015 Update 3 or
Visual Studio 2017. It is recommended that you make use of VS 2015 Update 3,
Windows Tools 1.4.1, and the Windows 10 Anniversary Update SDK (14393) -or-
VS 2017 (15.8 update) with the Windows 10 April 2018 Update SDK (17134).

These components are designed to work without requiring any content from the DirectX SDK. For details,
see "Where is the DirectX SDK?" <http://msdn.microsoft.com/en-us/library/ee663275.aspx>.
These components are designed to work without requiring any content from the
DirectX SDK. For details, see "Where is the DirectX SDK?"
<http://msdn.microsoft.com/en-us/library/ee663275.aspx>.

Inc\
    Public Header Files (in the DirectX C++ namespace):
@@ -54,51 +55,69 @@ MakeSpriteFont\
    Command line tool used to generate binary resources for use with SpriteFont

XWBTool\
    Command line tool for building XACT-style wave banks for use with DirectXTK for Audio's WaveBank class
    Command line tool for building XACT-style wave banks for use with DirectXTK
    for Audio's WaveBank class

All content and source code for this package are subject to the terms of the MIT License.
<http://opensource.org/licenses/MIT>.
All content and source code for this package are subject to the terms of the
MIT License. <http://opensource.org/licenses/MIT>.

Documentation is available at <https://github.com/Microsoft/DirectXTK/wiki>.

For the latest version of DirectX Tool Kit, bug reports, etc. please visit the project site.
For the latest version of DirectX Tool Kit, bug reports, etc. please visit
the project site. <http://go.microsoft.com/fwlink/?LinkId=248929>

http://go.microsoft.com/fwlink/?LinkId=248929
This project has adopted the Microsoft Open Source Code of Conduct. For more
information see the Code of Conduct FAQ or contact opencode@microsoft.com with
any additional questions or comments.

Note: Xbox One exclusive apps developers using the Xbox One XDK need to generate the
      Src\Shaders\Compiled\XboxOne*.inc files to build the library as they are not
      included in the distribution package. They are built by running the script
      in Src\Shaders - "CompileShaders xbox", and should be generated with the matching
      FXC compiler from the Xbox One XDK. While they will continue to work if outdated,
      a mismatch will cause runtime compilation overhead that would otherwise be avoided.
https://opensource.microsoft.com/codeofconduct/

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the
Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

https://opensource.microsoft.com/codeofconduct/
--------
XBOX ONE
--------

* Developers using the Xbox One XDK need to generate the
  Src\Shaders\Compiled\XboxOne*.inc files to build the library as they are not
  included in the distribution package. They are built by running the script
  in Src\Shaders - "CompileShaders xbox" from the "Xbox One XDK Command Prompt".
  They are XDK version-specific. While they will continue to work if outdated,
  a mismatch will cause runtime compilation overhead that would otherwise be
  avoided.


-------------
RELEASE NOTES
-------------

* The VS 2017 projects make use of /permissive- for improved C++ standard conformance. Use of a Windows 10 SDK prior to
  the Fall Creators Update (16299) or an Xbox One XDK prior to June 2017 QFE 4 may result in failures due to problems
  with the system headers. You can work around these by disabling this switch in the project files which is found
  in the <ConformanceMode> elements.
* The VS 2017 projects make use of /permissive- for improved C++ standard
  conformance. Use of a Windows 10 SDK prior to the Fall Creators Update (16299)
  or an Xbox One XDK prior to June 2017 QFE 4 may result in failures due to
  problems with the system headers. You can work around these by disabling this
  switch in the project files which is found in the <ConformanceMode> elements.

* The VS 2017 projects require the 15.5 update or later. For UWP and Win32 classic desktop projects with the 15.5
  or 15.6 updates, you need to install the standalone Windows 10 SDK (17134) which is otherwise included in
  the 15.7/15.8 update. Older VS 2017 updates will fail to load the projects due to use of the <ConformanceMode> element.
  If using the 15.5 or 15.6 updates, you will see "warning D9002: ignoring unknown option '/Zc:__cplusplus'" because
  this switch isn't supported until 15.7. It is safe to ignore this warning, or you can edit the project files
  <AdditionalOptions> elements.
* The VS 2017 projects require the 15.5 update or later. For UWP and Win32
  classic desktop projects with the 15.5 or 15.6 updates, you need to install
  the standalone Windows 10 SDK (17134) which is otherwise included in the
  15.7/15.8 update. Older VS 2017 updates will fail to load the projects due
  to use of the <ConformanceMode> element. If using the 15.5 or 15.6 updates,
  you will see "warning D9002: ignoring unknown option '/Zc:__cplusplus'"
  because this switch isn't supported until 15.7. It is safe to ignore this
  warning, or you can edit the project files <AdditionalOptions> elements.


---------------
RELEASE HISTORY
---------------

October 31, 2018
    Model loader for SDKMESH now attempts to use legacy DE3CN compressed normals
    - This is an approximation only and emits a warning in debug builds

October 25, 2018
    Use UTF-8 instead of ANSI for narrow strings
    Minor code review

August 17, 2018
    Improved validation for 16k textures and other large resources
    Improved debug output for failed texture loads and screengrabs
+4 −4
Original line number Diff line number Diff line
@@ -1168,14 +1168,14 @@ HRESULT DirectX::CreateDDSTextureFromFileEx(ID3D11Device* d3dDevice,
            }
        #else
            CHAR strFileA[MAX_PATH];
            int result = WideCharToMultiByte(CP_ACP,
            int result = WideCharToMultiByte(CP_UTF8,
                                             WC_NO_BEST_FIT_CHARS,
                                             fileName,
                                             -1,
                                             strFileA,
                                             MAX_PATH,
                                             nullptr,
                                             FALSE
                                             nullptr
            );
            if (result > 0)
            {
@@ -1302,14 +1302,14 @@ HRESULT DirectX::CreateDDSTextureFromFileEx(ID3D11DeviceX* d3dDevice,
            }
        #else
            CHAR strFileA[MAX_PATH];
            int result = WideCharToMultiByte(CP_ACP,
            int result = WideCharToMultiByte(CP_UTF8,
                                             WC_NO_BEST_FIT_CHARS,
                                             fileName,
                                             -1,
                                             strFileA,
                                             MAX_PATH,
                                             nullptr,
                                             FALSE
                                             nullptr
            );
            if (result > 0)
            {
+6 −4
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ using Microsoft::WRL::ComPtr;

namespace
{
    const float c_XboxOneThumbDeadZone = .24f;  // Recommended Xbox One controller deadzone

    float ApplyLinearDeadZone(float value, float maxValue, float deadZoneSize)
    {
        if (value < -deadZoneSize)
@@ -205,11 +207,11 @@ public:
                    state.dpad.left = (reading.Buttons & GamepadButtons::GamepadButtons_DPadLeft) != 0;

                    ApplyStickDeadZone(static_cast<float>(reading.LeftThumbstickX), static_cast<float>(reading.LeftThumbstickY),
                                       deadZoneMode, 1.f, .24f /* Recommended Xbox One deadzone */,
                                       deadZoneMode, 1.f, c_XboxOneThumbDeadZone,
                                       state.thumbSticks.leftX, state.thumbSticks.leftY);

                    ApplyStickDeadZone(static_cast<float>(reading.RightThumbstickX), static_cast<float>(reading.RightThumbstickY),
                                       deadZoneMode, 1.f, .24f /* Recommended Xbox One deadzone */,
                                       deadZoneMode, 1.f, c_XboxOneThumbDeadZone,
                                       state.thumbSticks.rightX, state.thumbSticks.rightY);

                    state.triggers.left = static_cast<float>(reading.LeftTrigger);
@@ -652,11 +654,11 @@ public:
                    state.dpad.left = (reading.Buttons & GamepadButtons::GamepadButtons_DPadLeft) != 0;

                    ApplyStickDeadZone(reading.LeftThumbstickX, reading.LeftThumbstickY,
                                       deadZoneMode, 1.f, .24f /* Recommended Xbox One deadzone */,
                                       deadZoneMode, 1.f, c_XboxOneThumbDeadZone,
                                       state.thumbSticks.leftX, state.thumbSticks.leftY);

                    ApplyStickDeadZone(reading.RightThumbstickX, reading.RightThumbstickY,
                                       deadZoneMode, 1.f, .24f /* Recommended Xbox One deadzone */,
                                       deadZoneMode, 1.f, c_XboxOneThumbDeadZone,
                                       state.thumbSticks.rightX, state.thumbSticks.rightY);

                    state.triggers.left = reading.LeftTrigger;
+26 −10
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ namespace
        DUAL_TEXTURE            = 0x4,
        NORMAL_MAPS             = 0x8,
        BIASED_VERTEX_NORMALS   = 0x10,
        USES_OBSOLETE_DEC3N     = 0x20,
    };

    struct MaterialRecordSDKMESH
@@ -46,17 +47,17 @@ namespace
                      IEffectFactory& fxFactory,
                      MaterialRecordSDKMESH& m)
    {
        wchar_t matName[DXUT::MAX_MATERIAL_NAME];
        MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.Name, -1, matName, DXUT::MAX_MATERIAL_NAME);
        wchar_t matName[DXUT::MAX_MATERIAL_NAME] = {};
        MultiByteToWideChar(CP_UTF8, 0, mh.Name, -1, matName, DXUT::MAX_MATERIAL_NAME);

        wchar_t diffuseName[DXUT::MAX_TEXTURE_NAME];
        MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.DiffuseTexture, -1, diffuseName, DXUT::MAX_TEXTURE_NAME);
        wchar_t diffuseName[DXUT::MAX_TEXTURE_NAME] = {};
        MultiByteToWideChar(CP_UTF8, 0, mh.DiffuseTexture, -1, diffuseName, DXUT::MAX_TEXTURE_NAME);

        wchar_t specularName[DXUT::MAX_TEXTURE_NAME];
        MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.SpecularTexture, -1, specularName, DXUT::MAX_TEXTURE_NAME);
        wchar_t specularName[DXUT::MAX_TEXTURE_NAME] = {};
        MultiByteToWideChar(CP_UTF8, 0, mh.SpecularTexture, -1, specularName, DXUT::MAX_TEXTURE_NAME);

        wchar_t normalName[DXUT::MAX_TEXTURE_NAME];
        MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.NormalTexture, -1, normalName, DXUT::MAX_TEXTURE_NAME);
        wchar_t normalName[DXUT::MAX_TEXTURE_NAME] = {};
        MultiByteToWideChar(CP_UTF8, 0, mh.NormalTexture, -1, normalName, DXUT::MAX_TEXTURE_NAME);

        if (flags & DUAL_TEXTURE && !mh.SpecularTexture[0])
        {
@@ -197,7 +198,10 @@ namespace
                    case D3DDECLTYPE_DXGI_R8G8B8A8_SNORM:    desc.Format = DXGI_FORMAT_R8G8B8A8_SNORM; offset += 4; break;

                    #if defined(_XBOX_ONE) && defined(_TITLE)
                    case D3DDECLTYPE_DEC3N:                  desc.Format = DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM; offset += 4; break;
                    case (32 + DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM): desc.Format = DXGI_FORMAT_R10G10B10_SNORM_A2_UNORM; offset += 4; break;
                    #else
                    case D3DDECLTYPE_DEC3N:                  desc.Format = DXGI_FORMAT_R10G10B10A2_UNORM; flags |= USES_OBSOLETE_DEC3N; offset += 4; break;
                    #endif

                    default:
@@ -420,6 +424,7 @@ std::unique_ptr<Model> DirectX::Model::CreateFromSDKMESH(ID3D11Device* d3dDevice
    std::vector<unsigned int> materialFlags;
    materialFlags.resize(header->NumVertexBuffers);

    bool dec3nwarning = false;
    for (UINT j = 0; j < header->NumVertexBuffers; ++j)
    {
        auto& vh = vbArray[j];
@@ -443,6 +448,11 @@ std::unique_ptr<Model> DirectX::Model::CreateFromSDKMESH(ID3D11Device* d3dDevice
            flags &= ~NORMAL_MAPS;
        }

        if (flags & USES_OBSOLETE_DEC3N)
        {
            dec3nwarning = true;
        }

        materialFlags[j] = flags;

        auto verts = bufferData + (vh.DataOffset - bufferDataOffset);
@@ -462,6 +472,12 @@ std::unique_ptr<Model> DirectX::Model::CreateFromSDKMESH(ID3D11Device* d3dDevice
        SetDebugObjectName(vbs[j].Get(), "ModelSDKMESH");
    }

    if (dec3nwarning)
    {
        DebugTrace("WARNING: Vertex declaration uses legacy Direct3D 9 D3DDECLTYPE_DEC3N which has no DXGI equivalent\n"
                   "         (treating as DXGI_FORMAT_R10G10B10A2_UNORM which is not a signed format)\n");
    }

    // Create index buffers
    std::vector<ComPtr<ID3D11Buffer>> ibs;
    ibs.resize(header->NumIndexBuffers);
@@ -532,8 +548,8 @@ std::unique_ptr<Model> DirectX::Model::CreateFromSDKMESH(ID3D11Device* d3dDevice
        }

        auto mesh = std::make_shared<ModelMesh>();
        wchar_t meshName[DXUT::MAX_MESH_NAME];
        MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, mh.Name, -1, meshName, DXUT::MAX_MESH_NAME);
        wchar_t meshName[DXUT::MAX_MESH_NAME] = {};
        MultiByteToWideChar(CP_UTF8, 0, mh.Name, -1, meshName, DXUT::MAX_MESH_NAME);
        mesh->name = meshName;
        mesh->ccw = ccw;
        mesh->pmalpha = pmalpha;
Loading