Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ For a full change history, see [CHANGELOG.md](https://github.com/microsoft/Direc

* The CMake projects require 3.21 or later.

* Starting with the July 2026 release, support for Direct3D Hardware Feature Level 9.x has been retired. All shaders are built using Shader Model 4, and therefore require `D3D_FEATURE_LEVEL_10_0` or greater.

* Starting with the March 2025 release, Windows 7 and Windows 8.0 support has been retired. For _DirectX ToolKit for Audio_ this means that `DirectXTKAudio_Desktop_*_Win7` has been removed, and `DirectXTKAudio_Desktop_*_Win8` has been integrated into the `DirectXTK_Desktop_*` vcxproj which uses XAudio 2.8 for Windows 8.1 compatibility.

* Remove any References to or use of `DirectXTKAudio_Desktop_*_Win8.vcxproj` or `DirectXTKAudio_Desktop_*_Win7`. If using `DirectXTK_Desktop_*.vcxproj` you will be using XAudio 2.8 as before. Client code will need to build with `_WIN32_WINNT=0x0603`.
Expand Down
17 changes: 11 additions & 6 deletions Src/BasicPostProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,17 @@ namespace
mVertexShader{},
mPixelShaders{},
mMutex{}
{}
{
if (!device)
{
throw std::invalid_argument("Direct3D device is null");
}

if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("DirectX Tool Kit requires Feature Level 10.0 or later");
}
}

DeviceResources(const DeviceResources&) = delete;
DeviceResources& operator=(const DeviceResources&) = delete;
Expand Down Expand Up @@ -219,11 +229,6 @@ BasicPostProcess::Impl::Impl(_In_ ID3D11Device* device)
mConstantBuffer(device),
mDeviceResources(deviceResourcesPool.DemandCreate(device))
{
if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("BasicPostProcess requires Feature Level 10.0 or later");
}

SetDebugObjectName(mConstantBuffer.GetBuffer(), "BasicPostProcess");
}

Expand Down
26 changes: 9 additions & 17 deletions Src/DDSTextureLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,29 +839,21 @@ namespace
{
case D3D_FEATURE_LEVEL_9_1:
case D3D_FEATURE_LEVEL_9_2:
if (isCubeMap)
{
maxsize = 512u /*D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION*/;
}
else
{
maxsize = (resDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
? 256u /*D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION*/
: 2048u /*D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION*/;
}
break;

case D3D_FEATURE_LEVEL_9_3:
maxsize = (resDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
? 256u /*D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION*/
: 4096u /*D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION*/;
break;
return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);

default: // D3D_FEATURE_LEVEL_10_0 & D3D_FEATURE_LEVEL_10_1
case D3D_FEATURE_LEVEL_10_0:
case D3D_FEATURE_LEVEL_10_1:
maxsize = (resDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
? 2048u /*D3D10_REQ_TEXTURE3D_U_V_OR_W_DIMENSION*/
: 8192u /*D3D10_REQ_TEXTURE2D_U_OR_V_DIMENSION*/;
break;

default: // D3D_FEATURE_LEVEL_11_0
maxsize = (resDim == D3D11_RESOURCE_DIMENSION_TEXTURE3D)
? D3D11_REQ_TEXTURE3D_U_V_OR_W_DIMENSION
: D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
break;
}

hr = FillInitData(width, height, depth, mipCount, arraySize, format,
Expand Down
7 changes: 0 additions & 7 deletions Src/DGSLEffectFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,6 @@ std::shared_ptr<IEffect> DGSLEffectFactory::Impl::CreateDGSLEffect(DGSLEffectFac
{
lighting = false;
}
else if (mDevice->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
// DGSL shaders are not compatible with Feature Level 9.x, use fallback shader
wcscat_s(root, L".cso");

factory->CreatePixelShader(root, ps.GetAddressOf());
}
else
{
// Create DGSL shader and use it for the effect
Expand Down
5 changes: 0 additions & 5 deletions Src/DebugEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ DebugEffect::Impl::Impl(_In_ ID3D11Device* device)
instancing(false),
debugMode(DebugEffect::Mode_Default)
{
if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("DebugEffect requires Feature Level 10.0 or later");
}

static_assert(static_cast<int>(std::size(EffectBase<DebugEffectTraits>::VertexShaderIndices)) == DebugEffectTraits::ShaderPermutationCount, "array/max mismatch");
static_assert(static_cast<int>(std::size(EffectBase<DebugEffectTraits>::VertexShaderBytecode)) == DebugEffectTraits::VertexShaderCount, "array/max mismatch");
static_assert(static_cast<int>(std::size(EffectBase<DebugEffectTraits>::PixelShaderBytecode)) == DebugEffectTraits::PixelShaderCount, "array/max mismatch");
Expand Down
17 changes: 11 additions & 6 deletions Src/DualPostProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@ namespace
mVertexShader{},
mPixelShaders{},
mMutex{}
{}
{
if (!device)
{
throw std::invalid_argument("Direct3D device is null");
}

if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("DirectX Tool Kit requires Feature Level 10.0 or later");
}
}

DeviceResources(const DeviceResources&) = delete;
DeviceResources& operator=(const DeviceResources&) = delete;
Expand Down Expand Up @@ -187,11 +197,6 @@ DualPostProcess::Impl::Impl(_In_ ID3D11Device* device)
mConstantBuffer(device),
mDeviceResources(deviceResourcesPool.DemandCreate(device))
{
if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("DualPostProcess requires Feature Level 10.0 or later");
}

SetDebugObjectName(mConstantBuffer.GetBuffer(), "DualPostProcess");
}

Expand Down
16 changes: 13 additions & 3 deletions Src/EffectCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,19 @@ namespace DirectX
class EffectDeviceResources
{
public:
EffectDeviceResources(_In_ ID3D11Device* device) noexcept
EffectDeviceResources(_In_ ID3D11Device* device)
: mDevice(device)
{}
{
if (!device)
{
throw std::invalid_argument("Direct3D device is null");
}

if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("DirectX Tool Kit requires Feature Level 10.0 or later");
}
}

ID3D11VertexShader* DemandCreateVertexShader(_Inout_ Microsoft::WRL::ComPtr<ID3D11VertexShader>& vertexShader, ShaderBytecode const& bytecode);
ID3D11PixelShader * DemandCreatePixelShader(_Inout_ Microsoft::WRL::ComPtr<ID3D11PixelShader> & pixelShader, ShaderBytecode const& bytecode);
Expand Down Expand Up @@ -286,7 +296,7 @@ namespace DirectX
class DeviceResources : protected EffectDeviceResources
{
public:
DeviceResources(_In_ ID3D11Device* device) noexcept
DeviceResources(_In_ ID3D11Device* device)
: EffectDeviceResources(device),
mVertexShaders{},
mPixelShaders{}
Expand Down
5 changes: 0 additions & 5 deletions Src/EffectFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ class EffectFactory::Impl
{
if (!device)
throw std::invalid_argument("Direct3D device is null");

if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
mUseNormalMapEffect = false;
}
}

Impl(const Impl&) = delete;
Expand Down
34 changes: 8 additions & 26 deletions Src/EnvironmentMapEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,12 @@ namespace
#include "EnvironmentMapEffect_VSEnvMapOneLight.inc"
#include "EnvironmentMapEffect_VSEnvMapOneLightFresnel.inc"
#include "EnvironmentMapEffect_VSEnvMapPixelLighting.inc"
#include "EnvironmentMapEffect_VSEnvMapPixelLightingSM4.inc"

#include "EnvironmentMapEffect_VSEnvMapBn.inc"
#include "EnvironmentMapEffect_VSEnvMapFresnelBn.inc"
#include "EnvironmentMapEffect_VSEnvMapOneLightBn.inc"
#include "EnvironmentMapEffect_VSEnvMapOneLightFresnelBn.inc"
#include "EnvironmentMapEffect_VSEnvMapPixelLightingBn.inc"
#include "EnvironmentMapEffect_VSEnvMapPixelLightingBnSM4.inc"

#include "EnvironmentMapEffect_PSEnvMap.inc"
#include "EnvironmentMapEffect_PSEnvMapNoFog.inc"
Expand Down Expand Up @@ -168,14 +166,6 @@ const ShaderBytecode EffectBase<EnvironmentMapEffectTraits>::VertexShaderBytecod
{ EnvironmentMapEffect_VSEnvMapOneLightBn, sizeof(EnvironmentMapEffect_VSEnvMapOneLightBn) },
{ EnvironmentMapEffect_VSEnvMapOneLightFresnelBn, sizeof(EnvironmentMapEffect_VSEnvMapOneLightFresnelBn) },
{ EnvironmentMapEffect_VSEnvMapPixelLightingBn, sizeof(EnvironmentMapEffect_VSEnvMapPixelLightingBn) },

#if defined(_XBOX_ONE) && defined(_TITLE)
{ EnvironmentMapEffect_VSEnvMapPixelLighting, sizeof(EnvironmentMapEffect_VSEnvMapPixelLighting) },
{ EnvironmentMapEffect_VSEnvMapPixelLightingBn, sizeof(EnvironmentMapEffect_VSEnvMapPixelLightingBn) },
#else
{ EnvironmentMapEffect_VSEnvMapPixelLightingSM4, sizeof(EnvironmentMapEffect_VSEnvMapPixelLightingSM4) },
{ EnvironmentMapEffect_VSEnvMapPixelLightingBnSM4, sizeof(EnvironmentMapEffect_VSEnvMapPixelLightingBnSM4) },
#endif
};


Expand Down Expand Up @@ -238,15 +228,15 @@ const int EffectBase<EnvironmentMapEffectTraits>::VertexShaderIndices[] =
9, // spheremap pixel lighting (biased vertex normals), fresnel
9, // spheremap pixel lighting (biased vertex normals), fresnel, no fog

10, // dual-parabola pixel lighting
10, // dual-parabola pixel lighting, no fog
10, // dual-parabola pixel lighting, fresnel
10, // dual-parabola pixel lighting, fresnel, no fog
4, // dual-parabola pixel lighting
4, // dual-parabola pixel lighting, no fog
4, // dual-parabola pixel lighting, fresnel
4, // dual-parabola pixel lighting, fresnel, no fog

11, // dual-parabola pixel lighting (biased vertex normals)
11, // dual-parabola pixel lighting (biased vertex normals), no fog
11, // dual-parabola pixel lighting (biased vertex normals), fresnel
11, // dual-parabola pixel lighting (biased vertex normals), fresnel, no fog
9, // dual-parabola pixel lighting (biased vertex normals)
9, // dual-parabola pixel lighting (biased vertex normals), no fog
9, // dual-parabola pixel lighting (biased vertex normals), fresnel
9, // dual-parabola pixel lighting (biased vertex normals), fresnel, no fog
};


Expand Down Expand Up @@ -672,14 +662,6 @@ void EnvironmentMapEffect::SetMode(EnvironmentMapEffect::Mapping mapping)
throw std::invalid_argument("Unsupported mapping");
}

if (mapping == Mapping_DualParabola)
{
if (pImpl->GetDeviceFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("Dual Parabola requires Feature Level 10.0 or later");
}
}

pImpl->mapping = mapping;
}

Expand Down
7 changes: 7 additions & 0 deletions Src/GraphicsMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,14 @@ class GraphicsMemory::Impl
void Initialize(_In_ ID3D11Device* device, unsigned int backBufferCount)
{
if (!device)
{
throw std::invalid_argument("Direct3D device is null");
}

if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("DirectX Tool Kit requires Feature Level 10.0 or later");
}

UNREFERENCED_PARAMETER(backBufferCount);
}
Expand Down
5 changes: 0 additions & 5 deletions Src/NormalMapEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ NormalMapEffect::Impl::Impl(_In_ ID3D11Device* device)
weightsPerVertex(0),
boneConstants{}
{
if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("NormalMapEffect requires Feature Level 10.0 or later");
}

static_assert(static_cast<int>(std::size(EffectBase<NormalMapEffectTraits>::VertexShaderIndices)) == NormalMapEffectTraits::ShaderPermutationCount, "array/max mismatch");
static_assert(static_cast<int>(std::size(EffectBase<NormalMapEffectTraits>::VertexShaderBytecode)) == NormalMapEffectTraits::VertexShaderCount, "array/max mismatch");
static_assert(static_cast<int>(std::size(EffectBase<NormalMapEffectTraits>::PixelShaderBytecode)) == NormalMapEffectTraits::PixelShaderCount, "array/max mismatch");
Expand Down
5 changes: 0 additions & 5 deletions Src/PBREffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,6 @@ PBREffect::Impl::Impl(_In_ ID3D11Device* device)
lightColor{},
boneConstants{}
{
if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0)
{
throw std::runtime_error("PBREffect requires Feature Level 10.0 or later");
}

static_assert(static_cast<int>(std::size(EffectBase<PBREffectTraits>::VertexShaderIndices)) == PBREffectTraits::ShaderPermutationCount, "array/max mismatch");
static_assert(static_cast<int>(std::size(EffectBase<PBREffectTraits>::VertexShaderBytecode)) == PBREffectTraits::VertexShaderCount, "array/max mismatch");
static_assert(static_cast<int>(std::size(EffectBase<PBREffectTraits>::PixelShaderBytecode)) == PBREffectTraits::PixelShaderCount, "array/max mismatch");
Expand Down
Loading
Loading