You are on page 1of 54

DirectX 11 Technology Update

Chuck Walbourn
Senior Software Design Engineer
Microsoft
a!efest "##$
raphics Track
%ntroduction to the Direct&D 11 raphics 'ipeline
Direct&D 11 Tessellation
(igh )e*el Shader )anguage +()S), Update-%ntroducing
.ersion /0#
Multithreaded 1endering for a!es
Direct&D 11 Co!pute Shader-More enerality for
2d*anced Techni3ues
'artners Track
2d*anced Topics in 'U Tessellation +2MD,
Water4Tight5 Te6tured5 Displaced Subdi*ision Surface
Tessellation Using Direct&D 11 +7.%D%2,
DirectX 11 8*er*iew
Direct&D 11 is based on Direct&D 1#01
Si!ilar 2'% design 9 rendering pipeline
Enables new DirectX 11 hardware
features
Supports e6isting DirectX 1# and 1#01
hardware
Enables so!e new features as well
Supports a subset of DirectX : SM "0#;
hardware
Supported on Windows <5 Windows
.ista5 Windows Ser*er "##$5 and
Windows Ser*er "##$ 1"
Input Assembler
Vertex Shader
Pixel Shader
Hull Shader
Rasterizer
Output Merger
Tessellator
Domain
Shader
Geometry Shader Stream Output
Dyna!ic
Shader
)inkage
Class )inkage on
DirectX 11 (W
interface
construct works
on older profiles
(ardware
Tessellation

DirectX 11 (W
only
()S) Shader
Model /

/0# on
DirectX 11 (W
So!e new
constructs
e!ulated on
older profiles
Multithreaded
1endering 9
1esource
Creation
1unti!e
e!ulation or
Dri*er opti!i=ed
DirectCo!pute

CS /0# on
DirectX 11 (W
CS >06 on so!e
DX1#06 h?w
@CA(?@C<
Te6ture
Bor!ats
DirectX 11 (W
only
Beatures 9 Beature )e*els
Beature le*els are well4defined sets of
functionality
7ot a sea of Copt4inD caps bits
Each feature le*el is a superset of the pre*ious one
Concept was introduced with Direct&D 1#01
ID3D10Device1::GetFeatureLevel()
D3D10_FEATURE_LEVEL_10_1
D3D10_FEATURE_LEVEL_10_0
DirectX 11 Beature )e*els
Feature Level Capabilities
D3D_FEATURE_LEVEL_10_0
+e0g0 7.%D%2 eBorce $###?:###
SeriesE TX "A#?"$#,
Direct&D 1# hardwareF Shader Model >0#5 geo!etry shader5 strea! out5
alpha4to4co*erage5 MS22 te6tures5 "4sided stencil5 general render
target *iews5 te6ture arrays5 @C>?@C/5 optional DirectCo!pute +CS
>0#,5 all :G& features0
D3D_FEATURE_LEVEL_10_1
+e0g0 2T% 1adeon (D
"###?&###?>### SeriesE 7.%D%2
eBorce "1#?T""#,
Direct&D 1#01 hardwareF Shader Model >015 cube!ap arrays5 e6tended
MS225 optional DirectCo!pute +CS >01,5 all 1#G# features0
D3D_FEATURE_LEVEL_11_0
+e0g0 2T% 1adeon (D /### Series,
Direct&D 11 hardwareF Shader Model /0#5 hull 9 do!ain shaders5
!andatory DirectCo!pute +CS /0#,5 @CA(?@C<5 all 1#G1 features0
1#le*el: Beature )e*els
Feature Level Capabilities
D3D_FEATURE_LEVEL_9_1
+e0g0 %ntel :A/ E6press Chipset5
7.idia eBorce BX /"##,
Direct&D : hardwareF !ust support Shader Model "0# +*sG"G#?psG"G#,5
"H te6tures5 *olu!e te6tures5 e*ent 3ueries5 @C14& +aka DXTn,5 and a
few other specific capabilities0
D3D_FEATURE_LEVEL_9_2
+e0g0 2T% 1adeon :/##,
Direct&D : hardwareF !ust support Shader Model "0# +*sG"G#?psG"G#,5
occlusion 3ueries5 float for!ats +no blending,5 e6tended caps5 all :G1
features0
D3D_FEATURE_LEVEL_9_3
+e0g0 7.idia eBorce AA##5 2T%
1adeon X1&##,
Direct&D : hardwareF !ust support Shader Model "0# +*sG"G#?psG"Gb,
with instancing5 >H te6tures5 !ultiple render targets +> M1Ts,5 floating4
point blending5 all :G" features0
Dri*er 8ptional Beatures
De*ices can e6pose so!e new DXGI_FORMATs
ID3D11Device::Cec!F"r#at$u%%"rt
@12 +&'G'R'(', for!ats
re3uired for :G15 :G"5 :G& and 11G#
optional for 1#G# ? 1#G1
1#F1#F1#F" X" biased (igh Color !ode
+R10G10&10_XR_&IA$_X)_A)_U*ORM)
re3uired for 11G#
optional for 1#G# ? 1#G1
not a*ailable for :G15 :G"5 or :G&
MaIority of for!at support is defined by feature le*el
Detailed in the DX% 'rogra!!erJs uide in the Windows raphics docu!entation
Dri*er 8ptional Beatures
DirectX 11 dri*ers can support four optional features
ID3D11Device::Cec!Feature$u%%"rt
DirectCo!pute
D3D_FEATURE_LEVEL_10_0 ? 10_1 support for CS >06 is optional
CS /0# is re3uired for D3D_FEATURE_LEVEL_11_0
Double4precision shader support is optional
Multithreading Dri*er support is optional
Concurrent obIect creation
Co!!and lists
DirectX raphics %nfrastructure +DX%, 101

.ersion 10# introduced in Windows .ista

Enu!erates adapters5 display !odes5 and outputs +e0g0 !onitors,

7ew DXGI_FORMATs and i!pro*ed support for re!ote desktops


Windows Display Dri*er Model +WDDM, 101

WDDM 10# introduced in Windows .ista

Unified dri*er !odel for all Direct&D 2'%s


Windows 2d*anced 1asteri=ation 'latfor! +W21', 1#

Software rasteri=ation de*ice supporting 1#01 de*ice functionality

7o Kdri*er optional featureJ support

Much faster than the DirectX SDHJs 1eference de*ice


1elated Technologies
Updated D6Caps.iewer
Utility
Demo
%D&D1#De*ice %D&D1#De*iceChild
%D&D1#.erte6Shader
%D&D1#eo!etryShader
%D&D1#'i6elShader
%D&D1#%nput)ayout
%D&D1#DepthStencilState
%D&D1#@lendState
%D&D1#1asteri=erState
%D&D1#Sa!plerState
%D&D1#2synchronous
%D&D1#Luery
%D&D1#'redicate
%D&D1#Counter
%D&D1#1esource
%D&D1#@uffer
%D&D1#Te6ture1D
%D&D1#Te6ture"D
%D&D1#Te6ture&D
%D&D1#.iew
%D&D1#Shader1esource.iew
%D&D1#1enderTarget.iew
%D&D1#DepthStencil.iew
Direct&D 1#0# 2'%
%D&D1#De*ice1 %D&D1#De*iceChild
%D&D1#.erte6Shader
%D&D1#eo!etryShader
%D&D1#'i6elShader
%D&D1#%nput)ayout
%D&D1#DepthStencilState
%D&D1#@lendState1
%D&D1#1asteri=erState
%D&D1#Sa!plerState
%D&D1#2synchronous
%D&D1#Luery
%D&D1#'redicate
%D&D1#Counter
%D&D1#1esource
%D&D1#@uffer
%D&D1#Te6ture1D
%D&D1#Te6ture"D
%D&D1#Te6ture&D
%D&D1#.iew
%D&D1#Shader1esource.iew1
%D&D1#1enderTarget.iew
%D&D1#DepthStencil.iew
Direct&D 1#01 2'%
%D&D11De*ice %D&D11De*iceChild
%D&D11.erte6Shader
%D&D11eo!etryShader
%D&D11'i6elShader
%D&D11%nput)ayout
%D&D11DepthStencilState
%D&D11@lendState
%D&D111asteri=erState
%D&D11Sa!plerState
%D&D112synchronous
%D&D11Luery
%D&D11'redicate
%D&D11Counter
%D&D111esource
%D&D11@uffer
%D&D11Te6ture1D
%D&D11Te6ture"D
%D&D11Te6ture&D
%D&D11.iew
%D&D11Shader1esource.iew
%D&D111enderTarget.iew
%D&D11DepthStencil.iew
Direct&D 11 2'% +partial,
%D&D11De*ice
%D&D11De*iceChild %D&D112synchronous %D&D111esource %D&D11.iew
%D&D11Luery
%D&D11'redicate
%D&D11Counter
%D&D11.erte6Shader
%D&D11eo!etryShader
%D&D11'i6elShader
%D&D11Co!puteShader
%D&D11(ullShader
%D&D11%nput)ayout
%D&D11DepthStencilState
%D&D11@lendState
%D&D111asteri=erState
%D&D11Sa!plerState
%D&D11Class%nstance
%D&D11Class)inkage
%D&D11Co!!and)ist
%D&D11@uffer
%D&D11Te6ture1D
%D&D11Te6ture"D
%D&D11Te6ture&D
%D&D11Shader1esource.iew
%D&D111enderTarget.iew
%D&D11DepthStencil.iew
%D&D11Unordered2ccess.iew
%D&D11Do!ainShader
%D&D11De*iceConte6t
Direct&D 11 2'% Change
Main difference is ID3D10Device was split in two
8bIect creation in ID3D11Device interface
8ther !ethods split off into ID3D11DeviceC",te-t
interface
1endering and state configuration
Ma%()/U,#a%() fro! resource obIects
&e.i,()/ E,0()/ and GetData() fro! 3uery obIects
8ne i!!ediate conte6t for rendering directly to the de*ice
Mero or !ore deferred conte6ts for creating co!!and lists
'ro*ides basis of !ultithreading i!pro*e!ents
ID3D11Device is thread4safe
Without dri*er support for Concurrent Creates5 runti!e will
enforce thread4safety with a coarse lock
Without dri*er support for Concurrent Creates5 creating
obIects and rendering with the i!!ediate conte6t will not be
concurrent +using the sa!e coarse lock,
Methods on !ost other obIects +ID3D11DeviceCil04
deri*ed, are also thread4safe
Can opt4out by using D3D11_CREATE_DEVICE_$I*GLET1READED
Multi4threading 1ules
ID3D11DeviceC",te-t is not thread4safe
Typical usage is one de*ice conte6t per thread5 one of the!
using i!!ediate and the rest using deferred conte6ts
7ote that DX% !ethods should not be used concurrently while
rendering with the i!!ediate de*ice conte6t
Bor e6a!ple5 2re3e,t() uses the i!!ediate de*ice conte6t
%t is thread4safe to use the !ethods inherited fro!
ID3D11DeviceCil0
A00Re4()/ Relea3e()/ 5uer6I,ter4ace()
GetDevice()/ Get2rivateData()/ $et2rivateData()/
$et2rivateDataI,ter4ace()
Multi4threading 1ules
ID3D11DeviceC",te-t deferred !ode li!itations
Ma%() !ust be used with D3D11_MA2_7RITE_DI$CARD
and?or D3D11_MA2_7RITE_*O_OVER7RITE
GetData() for 3ueries is not allowed
Lueries can be used in conIunction with predication
%f e6ecuting a deferred co!!and list with a 3uery acti*e
and the co!!and list itself uses the sa!e 3uery5
then the co!!and list sub!ission is ignored as in*alid
Multi4threading 1ules
Concurrent creation is a no brainer
Many engines already ha*e resource loading threads
1unti!e e!ulation is Cgood enoughD for a win
)ess o*erhead than the default Direct&D 1# M?T beha*ior
ConcurrentCreates dri*er support !akes it better
When creating obIects with M?T dri*er support5 pro*iding
initial data for static obIects should be !ore efficient
i0e Use the %I,itialData para!eter on the Create rather than staging
resources5 U%0ate$u8Re3"urce()5 or Ma%() when possible
Multi4threading 1eco!!endations
Concurrent sub!ission depends on the scenario
Useful for Triple4core5 Luad4core5 or !ore
Bor Dual4core5 it is less likely to be worthwhile
@est use scenario is one rendering thread per core
%deally use the Windows .ista?Windows < thread pool 2'%
%f you roll your own solution5 see the DirectX SDH CoreDetection sa!ple
for the robust way to deter!ine nu!ber of cores
Si!ilar but not identical to Xbo6 &A# Co!!and @uffers
Dri*er Co!!and)ists support is currently rare
Multi4threading 1eco!!endations
'orting to Direct&D 11 fro! 1#06
Start with a si!ple te6t translation
ID3D10( 4N ID3D11(
D3D10_( 4N D3D11_(
%f starting with Direct&D 1#0#5 will need to fi6 up a few
!inor structure differences
+11 !atches the 1#01 *ersion,
D3D10_&LE*D_DE$C1
D3D10_$1ADER_RE$OURCE_VIE7_DE$C1
'orting to Direct&D 11 fro! 1#06
Change rendering 9 state calls fro! de*ice to i!!ediate
conte6t

2fter getting port done5 will want to re*isit this


Change resource Ma%() and 3uery &e.i,()5 E,0()5 9
GetData() to use i!!ediate conte6t
Create($a0er takes an additional class linkage
para!eter +can use *ULL,
($et$a0er and (Get$a0er take an additional class
instance para!eter +can use *ULL,
So!e defines changed5 so be sure you arenJt using !agic
nu!bers +D3D10_RE$OURCE_MI$C_FLAG,
2 !inor feature was co!pletely dropped
ID3D10Device::GetTe-tFilter$i9e
ID3D10Device::$etTe-tFilter$i9e
D3D10_FILTER_TEXT_1&IT
.endor4neutral perfor!ance counters re!o*ed
Were rarely i!ple!ented or consistent
i0e0 D3D11_COU*TER_DEVICE_DE2E*DE*T_0 is the only
counter enu!eration
'orting to Direct&D 11 fro! 1#06
'orting to Direct&D 11 fro! :
Essentially the sa!e as porting fro! Direct&D : to
Direct&D 1#06
1e!o*e all fi6ed4function pipeline usage
Use state !anage!ent based on i!!utable state obIects
8bey strict shader linkage and input layout rules
Use shader resource *iews associated with te6ture resources
Map data to DXGI_FORMATs +no 1A4bit for!ats5 no ">4bit color
for!at5 strict 1@ color order,
1ework global constant data into se*eral constant buffers for
efficient update
'orting to Direct&D 11 fro! :
Start with the e6isting guidance for !o*ing fro! Direct&D
: to Direct&D 1#
S%12'( "##< Course O/
Introduction to Direct3D 10
httpF??!sdn0!icrosoft0co!?direct6?presentations
Gamefest 2007 talk
Windows to Reality: Getting the ost out of Direct3D 10 Gra!hics in
"our Games#
httpF??www0!icrosoftga!efest0co!?presentations?"##<0ht!
()S) Co!piler
DirectX 11 re3uires >0# or later profile shaders
D&DCo!pile D)) contains latest ()S) co!piler
Used by D&DX:5 D&DX1#5 D&DX115 and FXC:EXE
Can use directly +i0e0 without using D&DX,
7ote it is in its own DirectSetup C2@ file in the 1ED%ST folder
Supports all shader !odels e6cept 'i6el Shader 106 profiles
Vertex Pixel Geometry Compute Hull Domain
*sG>G# psG>G# gsG>G# csG>G#
*sG>G1 psG>G1 gsG>G1 csG>G1
*sG/G# psG/G# gsG/G# csG/G# hsG/G# dsG/G#
*sG>G#Gle*elG:G1 psG>G#Gle*elG:G1
*sG>G#Gle*elG:G& psG>G#Gle*elG:G&
Shader profiles in DirectX 11 can be applied to higher
feature le*els5 but not lower
1#le*el: shader profiles are co!piled twice internally
v3_;_0_level_<_( PN v3_)_0 ; v3_;_0
%3_;_0_level_<_1 PN %3_)_0 ; %3_;_0
%3_;_0_level_<_3 PN %3_)_8 ; %3_;_0
Shader 'rofiles and Beature )e*els
Shader Profile vs. Device Feature Level !" "! "!" #!$ #!% #!
/G# Qes 4 4 4 4 4
>G1 Qes Qes 4 4 4 4
>G# Qes Qes Qes 4 4 4
>G#Gle*elG:G& Qes Qes Qes Qes 4 4
>G#Gle*elG:G1 Qes Qes Qes Qes Qes Qes
Use the latest co!piler
Esp0 a*oid the Kin bo6J D&D1#Co!pile 2'%s
enerally use the lowest profile possible for .S?'S when
supporting 1#le*el:
Bor DirectCo!pute
prefer CS /0# o*er CS >06
'refer CS >01 o*er CS >0#
$om!ile your shaders offline for your retail game
()S) 1eco!!endations
Effects +BX, )ibrary
Effects for Direct&D 11 +BX11, is shared source in DX SDH
BX: was in D&DX:
BX1# was in bo6 with the 8S
'orting fro! BX1# 4N BX11 is fairly tri*ial
Essentially the sa!e 2'% without effects pools
'orting fro! BX: 4N BX11 re3uires significant code change
HLSL Profile
Effects : f6G"G#
Effects 1# f6G>G# and f6G>G1
Effects 11 f6G/G#
D&DX11
%ncludes te6ture loaders +@M'5 R'5 '75 DDS5 T%BB5 %B,
and asynchronous loaders introduced with D&DX1#
Does not include D&DX Math5 Mesh5 Sprite5 or Bont
See X72Math as alternati*e for D&DX Math
and DXUT11 for alternati*e to font5 etc0
D&DX11 uses a C'U codec for @CA(?@C< te6ture co!pression5
which can be ti!e4consu!ing0
Bor a fast DirectCo!pute >06 solution5 see the
&C=1&C>E,c"0erDec"0er11 sa!ple0
D&DCSX
8ptional e6tended D&DX D)) for Co!pute Shader
1esides in its own DirectSetup ? 1ED%ST C2@
DirectCo!pute +CS /0#, utility functions
ID3DX11$ca,
Unseg!ented Scan or Multiscan
Seg!ented Scan
ID3DX11FFT
1D5 "D5 &D support
1eal or Co!ple6
Borward or %n*erse Transfor! with optional scale
X72Math
aka 6bo6!ath "0#
%nline C;; SSE?SSE" opti!i=ed !ath library
.MX1"$ opti!i=ed on Xbo6
S&/# functions
Bocused on single4precision floating4point operations
)i!ited integer operations
Con*ersion to?fro! packed graphics for!ats
%!ple!ented using .isual Studio intrinsics
Supports 6$A and 6A> nati*e
Co!!on &D pri!iti*es
.ectors5 !atrices5 planes5 3uaternions5 etc0
DirectX 11 Deploy!ent
DirectX 11 1unti!e is included with Windows < and
Windows Ser*er "##$ 1"
DirectX 11 1unti!e can be deployed down4le*el to
Windows .ista ? Ser*er "##$
D&DX115 D&DCSX5 D&DCo!pile5 etc0 installed by
DirectSetup ? DX SDH 1ED%ST
Rust like D&DX:5 D&DX1#5 X2UD%8"5 etc0
The DirectX SDH does not install the DirectX 11 1unti!e
The DX SDH does install the debug layers and reference de*ice

7ew 2'% supporting 1#5 1#015 115 1#le*el:5 and W21'1#


Direct&D 11
DirectX 11 1unti!e

D&D glue library updated for new for!ats and WDDM 101 dri*er features
DX% 101

1#01 le*el software renderer


W21'1#

Direct&D : Shader Model "0# h?w support +:G15 :G"5 :G& feature le*els,
1#le*el:

Updated e6isting 2'% to support W21'1#5 1#le*el:


Direct&D 1#01

D%4like "D drawing 2'% for working on Direct&D surfaces


Direct"D

(igh43uality5 feature4rich font rendering 2'% +works with Direct"D,


DirectWrite
H@ :<1A>>
%latform &!date for Windows 'ista
httpF??go0!icrosoft0co!?fwlink?T)ink%dP1A#1$:
Deployed through Windows Update
1e3uires Windows .ista ? Ser*er "##$ S'" to be installed
See the D3D11I,3tall1el%er sa!ple in the DirectX SDH
for detection5 applying the H@5 and !essaging for 1TM ? S'1
Detailed in Direct3D 11 De!loyment for Game De(elo!ers
technical article
Bor corporate network en*iron!ents using Windows
Ser*er Update Ser*ers +WSUS,5 H@ :<1A>> is not a*ailable
Use this update instead
Windows Gra!hics) Imaging) and *%+ ,i-rary
httpF??support0!icrosoft0co!?kb?:<1/1"?
)ocal %T ad!in will need to appro*e the update through
the !anaged WSUS ser*ers
1e3uires Windows .ista ? Ser*er "##$ S'" to be installed
H@ :<1/1"
Update your e6isting Direct&D 1#06 code path to use
Direct&D 11
This re3uires so!e installer?deploy!ent work
Qour DX11 code path will re3uire Windows .ista S'"; or
Windows <
Bor Windows .ista ? Windows < titles
1#le*el: feature le*els can pro*ide !ore hardware support5
so you donJt need a Direct&D: code path
Bor titles that need Windows X' support5
you will need a legacy Direct&D: code path
1eco!!endations
%f you still only ha*e a legacy Direct&D : code path
7owJs the ti!e to in*est in DirectX 11
Take ad*antage of the e6isting resources
)essons learned !o*ing fro! D&D: 4N D&D1# all apply to
!o*ing fro! D&D: 4N D&D11
Direct&D 11 pro*ides
the latest hardware features
new features for e6isting 1#06 hardware
and supports the !aIority of *ideo cards with WDDM dri*ers
1eco!!endations
)atest DirectX SDH
httpF??!sdn0!icrosoft0co!?direct6
a!efest "##$ raphics and 'artners Tracks
httpF??www0!icrosoftga!efest0co!?presentations?"##$0ht!
a!efest "#1# raphics Track
CThink DirectX11 TessellationU V what are your optionsTD
CDirectX 11 DirectCo!pute V 2 Teraflop for E*eryoneD
C@lock Co!pression S!orgasbordD
and additional talks fro! 2MD 9 7.%D%2
1esources
2''E7D%X
?i,clu0e @03010:A
IDXGI$Ba%Cai, (._%$Ba%Cai, C *ULLD
ID3D10Device (._%Device C *ULLD
E
DXGI_$7A2_C1AI*_DE$C 30D
FF $et t" 0e3ire0 value3
E
1RE$ULT re3 C D3D10CreateDeviceA,0$Ba%Cai,( *ULL/ D3D10_DRIVER_TG2E_1ARD7ARE/
*ULL/ 0/ D3D10_$DH_VER$IO*/ I30/
I._%$Ba%Cai,/ I._%Device )D
i4 ( FAILED(re3) ) FF Err"r 1a,0li,.
FF &i,0 re,0er tar.et 4r"# 3Ba% cai,
FF $et u% vieB%"rt
E
?i,clu0e @03010_1:A
IDXGI$Ba%Cai, (._%$Ba%Cai, C *ULLD
ID3D10Device1 (._%Device C *ULLD
E
DXGI_$7A2_C1AI*_DE$C 30D
FF $et t" 0e3ire0 value3
E
1RE$ULT re3 C D3D10CreateDeviceA,0$Ba%Cai,1( *ULL/ D3D10_DRIVER_TG2E_1ARD7ARE/
*ULL/ 0/ D3D10_FEATURE_LEVEL_10_1/ D3D10_1_$DH_VER$IO*/ I30/
I._%$Ba%Cai,/ I._%Device )D
i4 ( FAILED(re3) )
J
re3 C D3D10CreateDeviceA,0$Ba%Cai,1( *ULL/ D3D10_DRIVER_TG2E_1ARD7ARE/
*ULL/ 0/ D3D10_FEATURE_LEVEL_10_0/ D3D10_1_$DH_VER$IO*/ I30/
I._%$Ba%Cai,/ I._%Device )D
K
i4 ( FAILED(re3) ) FF Err"r 1a,0li,.
FF &i,0 re,0er tar.et 4r"# 3Ba% cai,
FF $et u% vieB%"rt
E
FF u3e ._%DeviceLMGetFeatureLevel() t" cec! 4"r 10_1D ca, "terBi3e a33u#e 10_0
?i,clu0e @03011:A
IDXGI$Ba%Cai, (._%$Ba%Cai, C *ULLD
ID3D11Device (._%Device C *ULLD
ID3D11DeviceC",te-t( ._%C",te-t C *ULLD
E
DXGI_$7A2_C1AI*_DE$C 30D
FF $et t" 0e3ire0 value3
E
D3D_FEATURE_LEVEL 4lvlNO C J
D3D_FEATURE_LEVEL_11_0/ D3D_FEATURE_LEVEL_10_1/ D3D_FEATURE_LEVEL 10_0 KD
D3D_FEATURE_LEVEL 4lD
1RE$ULT re3 C D3D11CreateDeviceA,0$Ba%Cai,( *ULL/ D3D_DRIVER_TG2E_1ARD7ARE/
*ULL/ 0/ 4lvl/ 3i9e"4(4lvl)F3i9e"4(D3D_FEATURE_LEVEL)/
D3D11_$DH_VER$IO*/ I30/
I._%$Ba%Cai,/ I._%Device/ I4l/ I._%C",te-t )D
i4 ( FAILED(re3) ) FF Err"r 1a,0li,.
FF &i,0 re,0er tar.et 4r"# 3Ba% cai,
FF $et u% vieB%"rt
E
FF u3e ._%DeviceLMGetFeatureLevel() ("r re#e#8er 4l a8"ve) t" cec! 4"r
FF 11_0 "r 10_1/ a33u#e 10_0 "terBi3e
?i,clu0e @03011:A
IDXGI$Ba%Cai, (._%$Ba%Cai, C *ULLD
ID3D11Device (._%Device C *ULLD
ID3D11DeviceC",te-t( ._%C",te-t C *ULLD
E
DXGI_$7A2_C1AI*_DE$C 30D
FF $et t" 0e3ire0 value3
E
D3D_FEATURE_LEVEL 4lvlNO C J
D3D_FEATURE_LEVEL_11_0/ D3D_FEATURE_LEVEL_10_1/ D3D_FEATURE_LEVEL 10_0/
D3D_FEATURE_LEVEL_<_3/ D3D_FEATURE_LEVEL_<_)/ D3D_FEATURE_LEVEL_<_1 KD
D3D_FEATURE_LEVEL 4lD
1RE$ULT re3 C D3D11CreateDeviceA,0$Ba%Cai,( *ULL/ D3D_DRIVER_TG2E_1ARD7ARE/
*ULL/ 0/ 4lvl/ 3i9e"4(4lvl)F3i9e"4(D3D_FEATURE_LEVEL)/
D3D11_$DH_VER$IO*/ I30/
I._%$Ba%Cai,/ I._%Device/ I4l/ I._%C",te-t )D
i4 ( FAILED(re3) ) FF Err"r 1a,0li,.
FF &i,0 re,0er tar.et 4r"# 3Ba% cai,
FF $et u% vieB%"rt
E
FF u3e ._%DeviceLMGetFeatureLevel() ("r re#e#8er 4l a8"ve) t" cec! 4eature level
?i,clu0e @03011:A
IDXGI$Ba%Cai, (._%$Ba%Cai, C *ULLD
ID3D11Device (._%Device C *ULLD
ID3D11DeviceC",te-t( ._%C",te-t C *ULLD
E
DXGI_$7A2_C1AI*_DE$C 30D
FF $et t" 0e3ire0 value3
E
1RE$ULT re3 C D3D11CreateDeviceA,0$Ba%Cai,( *ULL/ D3D_DRIVER_TG2E_1ARD7ARE/
*ULL/ 0/ *ULL/ 0/
D3D11_$DH_VER$IO*/ I30/
I._%$Ba%Cai,/ I._%Device/ *ULL/ I._%C",te-t )D
i4 ( FAILED(re3) ) FF Err"r 1a,0li,.
FF &i,0 re,0er tar.et 4r"# 3Ba% cai,
FF $et u% vieB%"rt
E
FF u3e ._%DeviceLMGetFeatureLevel() t" cec! 4eature level
DirectX 11 Debugging
DirectX SDH pro*ides debugging layer
Enabled through code
+D3D11_CREATE_DEVICE_DE&UG, or
the DirectX Control 'anel utility
Control panel controls the 1# and 11
debugging layer through the sa!e
settings
Unlike Direct&D :5 it is per application
not a global setting
'rints !essages to Windows debug
output
DirectX 11 Debugging
Make sure your application runs Kdebug layerJ clean
E1181 and C811U'T%87 reports are critical to fi6
Tools like %I* for Windows assu!e this le*el of correctness
Can also !ake use of the ID3D11De8u. and
D3D11I,4"5ueue interfaces
8btain *ia 5uer6I,ter4ace fro! Direct&D 11 De*ice
E6ists only if debug layer is attached
ID3D10De8u.::Vali0ate() split into
Vali0ateC",te-t() and
Vali0ateC",te-tF"rDi3%atc()
7ew !ethod for DX11 Debug )ayer
ID3D11De8u.::Re%"rtLiveDeviceO8Pect3()
Debug layer !essages in debug window use Kfriendly
na!esJ for resources5 defaults to Cunna!edD
Can set the na!e by using the $et2rivateData() 2'%
in co!bination with a Kwell4knownJ U%D fro!
030c"##",:
Debug 1esource 7a!ing
?i4,0e4 *DE&UG
FF O,l6 B"r!3 i4 0evice i3 create0 Bit te D3D10 "r D3D11 0e8u. la6er
c",3t car c_39*a#eNO C Qte-ture:P%.QD
%O8PectLM$et2rivateData( 7H2DID_D3DDe8u.O8Pect*a#e/
3i9e"4( c_39*a#e ) L 1/ c_39*a#e )D
?e,0i4
Windows < ? Ser*er "##$ 1" only
2 few DirectX4branded technology pieces are not
a*ailable down4le*el
Direct&D:E6 *ideo (D and o*erlay e6tensions
Direct&D:E6 D3D$7A2EFFECT_FLI2EX and i!pro*ed fra!e
statistics
DirectMusic KcoreJ 2'% for 6A> nati*e +ti!e sta!ped M%D%5
software synthesi=er,
Windows Media Boundation i!pro*e!ents are not also
included
www0!icrosoftga!efest0co!
W "##:4"#1# Microsoft Corporation0 2ll rights reser*ed0
This presentation is for infor!ational purposes only0 Microsoft !akes no warranties5 e6press or i!plied5 in this su!!ary0

You might also like