1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
7 use shared
::basetsd
::{UINT16, UINT64, UINT8}
;
8 use shared
::dxgiformat
::DXGI_FORMAT
;
9 use shared
::minwindef
::{BOOL, INT, UINT}
;
10 use um
::d3d11
::{ID3D11Buffer, ID3D11DeviceChild, ID3D11Resource}
;
12 ID3D11Device1
, ID3D11Device1Vtbl
, ID3D11DeviceContext1
, ID3D11DeviceContext1Vtbl
,
14 use um
::winnt
::{HRESULT, LPCWSTR}
;
15 DEFINE_GUID
!{IID_ID3D11DeviceContext2
,
16 0x420d5b32, 0xb90c, 0x4da4, 0xbe, 0xf0, 0x35, 0x9f, 0x6a, 0x24, 0xa8, 0x3a}
17 DEFINE_GUID
!{IID_ID3D11Device2
,
18 0x9d06dffa, 0xd1e5, 0x4d07, 0x83, 0xa8, 0x1b, 0xb1, 0x23, 0xf2, 0xf8, 0x41}
19 STRUCT
!{struct D3D11_TILED_RESOURCE_COORDINATE
{
25 STRUCT
!{struct D3D11_TILE_REGION_SIZE
{
32 ENUM
!{enum D3D11_TILE_MAPPING_FLAG
{
33 D3D11_TILE_MAPPING_NO_OVERWRITE
= 0x00000001,
35 ENUM
!{enum D3D11_TILE_RANGE_FLAG
{
36 D3D11_TILE_RANGE_NULL
= 0x00000001,
37 D3D11_TILE_RANGE_SKIP
= 0x00000002,
38 D3D11_TILE_RANGE_REUSE_SINGLE_TILE
= 0x00000004,
40 STRUCT
!{struct D3D11_SUBRESOURCE_TILING
{
42 HeightInTiles
: UINT16
,
44 StartTileIndexInOverallResource
: UINT
,
46 STRUCT
!{struct D3D11_TILE_SHAPE
{
51 STRUCT
!{struct D3D11_PACKED_MIP_DESC
{
52 NumStandardMips
: UINT8
,
54 NumTilesForPackedMips
: UINT
,
55 StartTileIndexInOverallResource
: UINT
,
57 ENUM
!{enum D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAG
{
58 D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_TILED_RESOURCE
= 0x00000001,
60 ENUM
!{enum D3D11_TILE_COPY_FLAG
{
61 D3D11_TILE_COPY_NO_OVERWRITE
= 0x00000001,
62 D3D11_TILE_COPY_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE
= 0x00000002,
63 D3D11_TILE_COPY_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER
= 0x00000004,
65 RIDL
!{#[uuid(0x420d5b32, 0xb90c, 0x4da4, 0xbe, 0xf0, 0x35, 0x9f, 0x6a, 0x24, 0xa8, 0x3a)]
66 interface
ID3D11DeviceContext2(ID3D11DeviceContext2Vtbl
):
67 ID3D11DeviceContext1(ID3D11DeviceContext1Vtbl
) {
68 fn UpdateTileMappings(
69 pTiledResource
: *mut ID3D11Resource
,
70 NumTiledResourceRegions
: UINT
,
71 pTiledResourceRegionStartCoordinates
: *const D3D11_TILED_RESOURCE_COORDINATE
,
72 pTiledResourceRegionSizes
: *const D3D11_TILE_REGION_SIZE
,
73 pTilePool
: *mut ID3D11Buffer
,
75 pRangeFlags
: *const UINT
,
76 pTilePoolStartOffsets
: *const UINT
,
77 pRangeTileCounts
: *const UINT
,
81 pDestTiledResource
: *mut ID3D11Resource
,
82 pDestRegionStartCoordinate
: *const D3D11_TILED_RESOURCE_COORDINATE
,
83 pSourceTiledResource
: *mut ID3D11Resource
,
84 pSourceRegionStartCoordinate
: *const D3D11_TILED_RESOURCE_COORDINATE
,
85 pTileRegionSize
: *const D3D11_TILE_REGION_SIZE
,
89 pTiledResource
: *mut ID3D11Resource
,
90 pTileRegionStartCoordinate
: *const D3D11_TILED_RESOURCE_COORDINATE
,
91 pTileRegionSize
: *const D3D11_TILE_REGION_SIZE
,
92 pBuffer
: *mut ID3D11Buffer
,
93 BufferStartOffsetInBytes
: UINT64
,
97 pDestTiledResource
: *mut ID3D11Resource
,
98 pDestTileRegionStartCoordinate
: *const D3D11_TILED_RESOURCE_COORDINATE
,
99 pDestTileRegionSize
: *const D3D11_TILE_REGION_SIZE
,
100 pSourceTileData
: *const c_void
,
104 pTilePool
: *mut ID3D11Buffer
,
105 NewSizeInBytes
: UINT64
,
107 fn TiledResourceBarrier(
108 pTiledResourceOrViewAccessBeforeBarrier
: *mut ID3D11DeviceChild
,
109 pTiledResourceOrViewAccessAfterBarrier
: *mut ID3D11DeviceChild
,
111 fn IsAnnotationEnabled() -> BOOL
,
122 RIDL
!{#[uuid(0x9d06dffa, 0xd1e5, 0x4d07, 0x83, 0xa8, 0x1b, 0xb1, 0x23, 0xf2, 0xf8, 0x41)]
123 interface
ID3D11Device2(ID3D11Device2Vtbl
): ID3D11Device1(ID3D11Device1Vtbl
) {
124 fn GetImmediateContext2(
125 ppImmediateContext
: *mut *mut ID3D11DeviceContext2
,
127 fn CreateDeferredContext2(
129 ppDeferredContext
: *mut *mut ID3D11DeviceContext2
,
131 fn GetResourceTiling(
132 pTiledResource
: *mut ID3D11Resource
,
133 pNumTilesForEntireResource
: *mut UINT
,
134 pPackedMipDesc
: *mut D3D11_PACKED_MIP_DESC
,
135 pStandardTileShapeForNonPackedMips
: *mut D3D11_TILE_SHAPE
,
136 pNumSubresourceTilings
: *mut UINT
,
137 FirstSubresourceTilingToGet
: UINT
,
138 pSubresourceTilingsForNonPackedMips
: *mut D3D11_SUBRESOURCE_TILING
,
140 fn CheckMultisampleQualityLevels1(
144 pNumQualityLevels
: *mut UINT
,