@@ -93,9 +93,11 @@ class DXUTState
9393 ID3D11RenderTargetView* m_D3D11RenderTargetView; // the D3D11 render target view
9494 ID3D11RasterizerState* m_D3D11RasterizerState; // the D3D11 Rasterizer state
9595
96+ #ifdef USE_DIRECT3D11_1
9697 // D3D11.1 specific
9798 ID3D11Device1* m_D3D11Device1; // the D3D11.1 rendering device
9899 ID3D11DeviceContext1* m_D3D11DeviceContext1; // the D3D11.1 immediate device context
100+ #endif
99101
100102#ifdef USE_DIRECT3D11_2
101103 // D3D11.2 specific
@@ -310,8 +312,10 @@ class DXUTState
310312 GET_SET_ACCESSOR ( ID3D11RenderTargetView*, D3D11RenderTargetView );
311313 GET_SET_ACCESSOR ( ID3D11RasterizerState*, D3D11RasterizerState );
312314
315+ #ifdef USE_DIRECT3D11_1
313316 GET_SET_ACCESSOR ( ID3D11Device1*, D3D11Device1 );
314317 GET_SET_ACCESSOR ( ID3D11DeviceContext1*, D3D11DeviceContext1 );
318+ #endif
315319
316320#ifdef USE_DIRECT3D11_2
317321 GET_SET_ACCESSOR (ID3D11Device2*, D3D11Device2);
@@ -607,8 +611,11 @@ IDXGIFactory1* WINAPI DXUTGetDXGIFactory() { DXUTDelayLoadDXGI()
607611
608612ID3D11Device* WINAPI DXUTGetD3D11Device () { return GetDXUTState ().GetD3D11Device (); }
609613ID3D11DeviceContext* WINAPI DXUTGetD3D11DeviceContext () { return GetDXUTState ().GetD3D11DeviceContext (); }
614+
615+ #ifdef USE_DIRECT3D11_1
610616ID3D11Device1* WINAPI DXUTGetD3D11Device1 () { return GetDXUTState ().GetD3D11Device1 (); }
611617ID3D11DeviceContext1* WINAPI DXUTGetD3D11DeviceContext1 () { return GetDXUTState ().GetD3D11DeviceContext1 (); }
618+ #endif
612619
613620#ifdef USE_DIRECT3D11_2
614621ID3D11Device2* WINAPI DXUTGetD3D11Device2 () { return GetDXUTState ().GetD3D11Device2 (); }
@@ -752,9 +759,13 @@ void DXUTParseCommandLine(WCHAR* strCommandLine,
752759 }
753760 else
754761#endif
762+ #ifdef USE_DIRECT3D11_1
755763 if (_wcsnicmp ( strFlag, L" D3D_FEATURE_LEVEL_11_1" , MAX_PATH) == 0 ) {
756764 GetDXUTState ().SetOverrideForceFeatureLevel (D3D_FEATURE_LEVEL_11_1);
757- }else if (_wcsnicmp ( strFlag, L" D3D_FEATURE_LEVEL_11_0" , MAX_PATH) == 0 ) {
765+ }
766+ else
767+ #endif
768+ if (_wcsnicmp ( strFlag, L" D3D_FEATURE_LEVEL_11_0" , MAX_PATH) == 0 ) {
758769 GetDXUTState ().SetOverrideForceFeatureLevel (D3D_FEATURE_LEVEL_11_0);
759770 }else if (_wcsnicmp ( strFlag, L" D3D_FEATURE_LEVEL_10_1" , MAX_PATH) == 0 ) {
760771 GetDXUTState ().SetOverrideForceFeatureLevel (D3D_FEATURE_LEVEL_10_1);
@@ -2572,6 +2583,7 @@ HRESULT DXUTCreate3DEnvironment11()
25722583 assert ( pd3dImmediateContext );
25732584 _Analysis_assume_ ( pd3dImmediateContext );
25742585
2586+ #ifdef USE_DIRECT3D11_1
25752587 // Direct3D 11.1
25762588 {
25772589 ID3D11Device1* pd3d11Device1 = nullptr ;
@@ -2588,6 +2600,7 @@ HRESULT DXUTCreate3DEnvironment11()
25882600 }
25892601 }
25902602 }
2603+ #endif
25912604
25922605#ifdef USE_DIRECT3D11_2
25932606 // Direct3D 11.2
@@ -3046,10 +3059,12 @@ void DXUTCleanup3DEnvironment( _In_ bool bReleaseSettings )
30463059 assert ( pImmediateContext );
30473060 pImmediateContext->ClearState ();
30483061 pImmediateContext->Flush ();
3062+ #ifdef USE_DIRECT3D11_1
30493063 auto pImmediateContext1 = DXUTGetD3D11DeviceContext1 ();
3050- assert ( pImmediateContext1 );
3064+ assert (pImmediateContext1);
30513065 pImmediateContext1->ClearState ();
30523066 pImmediateContext1->Flush ();
3067+ #endif
30533068#ifdef USE_DIRECT3D11_2
30543069 auto pImmediateContext2 = DXUTGetD3D11DeviceContext2 ();
30553070 assert (pImmediateContext2);
@@ -3067,8 +3082,10 @@ void DXUTCleanup3DEnvironment( _In_ bool bReleaseSettings )
30673082 SAFE_RELEASE ( pImmediateContext );
30683083 GetDXUTState ().SetD3D11DeviceContext ( nullptr );
30693084
3085+ #ifdef USE_DIRECT3D11_1
30703086 SAFE_RELEASE ( pImmediateContext1 );
30713087 GetDXUTState ().SetD3D11DeviceContext1 ( nullptr );
3088+ #endif
30723089
30733090#ifdef USE_DIRECT3D11_2
30743091 SAFE_RELEASE (pImmediateContext2);
@@ -3083,9 +3100,11 @@ void DXUTCleanup3DEnvironment( _In_ bool bReleaseSettings )
30833100 // Report live objects
30843101 if ( pd3dDevice )
30853102 {
3103+ #ifdef USE_DIRECT3D11_1
30863104 auto pd3dDevice1 = DXUTGetD3D11Device1 ();
30873105 SAFE_RELEASE ( pd3dDevice1 );
30883106 GetDXUTState ().SetD3D11Device1 (nullptr );
3107+ #endif
30893108
30903109#ifdef USE_DIRECT3D11_2
30913110 auto pd3dDevice2 = DXUTGetD3D11Device2 ();
@@ -4201,9 +4220,11 @@ void DXUTUpdateD3D11DeviceStats( D3D_DRIVER_TYPE DeviceType, D3D_FEATURE_LEVEL f
42014220 case D3D_FEATURE_LEVEL_11_0:
42024221 wcscat_s ( pstrDeviceStats, 256 , L" (FL 11.0)" );
42034222 break ;
4223+ #ifdef USE_DIRECT3D11_1
42044224 case D3D_FEATURE_LEVEL_11_1:
42054225 wcscat_s ( pstrDeviceStats, 256 , L" (FL 11.1)" );
42064226 break ;
4227+ #endif
42074228#ifdef USE_DIRECT3D11_3
42084229 case D3D_FEATURE_LEVEL_12_0:
42094230 wcscat_s (pstrDeviceStats, 256 , L" (FL 12.0)" );
0 commit comments