// d3dukmdt.h
typedef struct _D3DDDI_SEGMENTPREFERENCE {
union {
struct {
UINT SegmentId0 : 5;
UINT Direction0 : 1;
UINT SegmentId1 : 5;
UINT Direction1 : 1;
UINT SegmentId2 : 5;
UINT Direction2 : 1;
UINT SegmentId3 : 5;
UINT Direction3 : 1;
UINT SegmentId4 : 5;
UINT Direction4 : 1;
UINT Reserved : 2;
};
UINT Value;
};
} D3DDDI_SEGMENTPREFERENCE;
View the official Windows Driver Kit DDI referenceNo description available.
The D3DDI_SEGMENTPREFERENCE structure describes the preferred segment for this allocation being created.
SegmentId0The identifier of the highest priority preferred segment, or zero if no preferred segment is required. Valid values are from 0 through 31. This member is equivalent to the first 5 bits of the Value member.
Direction0Set to zero to indicate that VidMm chooses which end of SegmentId0 to do the allocation from. This member is equivalent to the sixth bit of the Value member.
SegmentId1The identifier of the next highest priority preferred segment, or zero if no preferred segment is required. Valid values are from 0 through 31. This member is equivalent to bits 7 through 11 of the Value member.
Direction1Set to zero to indicate that VidMm chooses which end of SegmentId1 to do the allocation from. This member is equivalent to the 12th bit of the Value member.
SegmentId2The identifier of the next highest priority preferred segment, or zero if no preferred segment is required. Valid values are from 0 through 31. This member is equivalent to bits 13 through 17 of the Value member.
Direction2Set to zero to indicate that VidMm chooses which end of SegmentId2 to do the allocation from. This member is equivalent to the 18th bit of the Value member.
SegmentId3The identifier of the next highest priority preferred segment, or zero if no preferred segment is required. Valid values are from 0 through 31. This member is equivalent to bits 19 through 23 of the Value member.
Direction3Set to zero to indicate that VidMm chooses which end of SegmentId3 to do the allocation from. This member is equivalent to the 24th bit of the Value member.
SegmentId4The identifier of the next highest priority preferred segment, or zero if no preferred segment is required. Valid values are from 0 through 31. This member is equivalent to bits 25 through 29 of the Value member.
Direction4Set to zero to indicate that VidMm chooses which end of SegmentId4 to do the allocation from. This member is equivalent to the 30th bit of the Value member.
ReservedReserved (bits 31-32).
ValueAn alternative way to access the segment preference information.
The segment preference is used when allocating memory. When user mode (for example, the D3D runtime) calls D3DKMTCreateAllocation, the UMD provides private driver data describing the allocation. Dxgkrnl takes this private driver data and passes it to the KMD who then fills out a description of each allocation in a way understood by VidMm. The UMD data contains information such as the resource type (texture, swapchain, etc). The KMD translates this data to things like size, alignment, a set of memory segments that the allocation can be located, preferences for these segments (as indicated by this structure), and so forth.
D3DKMTUpdateAllocationProperty