Fungsi UMDEtwLogMapAllocation (umdprovider.h)

Menjelaskan bagaimana subsistem kernel grafis Microsoft DirectX (Dxgkrnl.sys) alokasi memori, atau sebagian alokasi, sedang digunakan.

Sintaks

void UMDEtwLogMapAllocation(
  ULONGLONG                  hD3DAllocation,
  ULONGLONG                  hDxgAllocation,
  ULONGLONG                  Offset,
  ULONGLONG                  Size,
  UMDETW_ALLOCATION_USAGE    Usage,
  UMDETW_ALLOCATION_SEMANTIC Semantic
);

Parameter

hD3DAllocation

Handel ke alokasi Direct3D.

Untuk driver mode pengguna Direct3D 10, handel akan menjadi nilai parameter hResource dari fungsi CreateResource (D3D10). Untuk driver mode pengguna Direct3D 9, handel akan menjadi nilai parameter pResource yang dikembalikan driver dalam fungsi CreateResource .

Driver dapat mengatur nilai ini ke NULL jika menggunakan alokasi secara internal.

hDxgAllocation

Handel ke alokasi subsistem kernel grafis DirectX (Dxgkrnl.sys) tempat alokasi Direct3D dipetakan.

Offset

Alamat awal, dalam byte, dari alokasi Direct3D dalam alokasi Dxgkrnl.

Size

Ukuran, dalam byte, dari alokasi Direct3D dalam alokasi Dxgkrnl.

Usage

Struktur UMDETW_ALLOCATION_USAGE yang menunjukkan alasan pemetaan ini.

Semantic

Jika alokasi digunakan secara internal oleh driver mode pengguna, ini adalah struktur UMDETW_ALLOCATION_SEMANTIC yang menunjukkan untuk apa alokasi digunakan.

Mengembalikan nilai

Tidak ada

Keterangan

Driver tampilan mode pengguna harus sepenuhnya mempertimbangan memori video yang dialokasikannya, sehingga harus memanggil fungsi ini untuk mencatat peristiwa setiap kali alokasi berubah.

Contoh kapan harus memanggil fungsi ini adalah:

  • Alokasi Direct3D dikemas ke dalam alokasi subsistem kernel grafis DirectX (Dxgkrnl.sys).
  • Alokasi Dxgkrnl dibuat sebagai permukaan goresan. Dalam hal ini, atur parameter hD3DAllocation ke NULL.
UMDEtwLogMapAllocation didefinisikan sebaris dalam Umdprovider.h sebagai:
FORCEINLINE void LogMapAllocation(BOOLEAN Enter,
                    ULONGLONG hD3DAllocation,
                    ULONGLONG hDxgAllocation,
                    ULONGLONG Offset,
                    ULONGLONG Size,
                    UMDETW_ALLOCATION_USAGE Usage,
                    UMDETW_ALLOCATION_SEMANTIC Semantic)
{
    if (Enabled)
    {   
        EVENT_DATA_DESCRIPTOR Descriptors[6];
        
        // Create a description of the event
        EventDataDescCreate(&Descriptors[0], &hD3DAllocation, 8);
        EventDataDescCreate(&Descriptors[1], &hDxgAllocation, 8);
        EventDataDescCreate(&Descriptors[2], &Offset, 8);
        EventDataDescCreate(&Descriptors[3], &Size, 8);
        EventDataDescCreate(&Descriptors[4], &Usage, 4);
        EventDataDescCreate(&Descriptors[5], &Semantic, 4);

        // Log the event
        EventWrite(
            RegHandle,
            Enter ? (InRundown ? &RundownAllocationEvent : &MapAllocationEvent) : &UnmapAllocationEvent,
            sizeof(Descriptors) / sizeof(Descriptors[0]),
            Descriptors
        );
    }
}

FORCEINLINE void UMDEtwLogMapAllocation(ULONGLONG hD3DAllocation,
                            ULONGLONG hDxgAllocation,
                            ULONGLONG Offset,
                            ULONGLONG Size,
                            UMDETW_ALLOCATION_USAGE Usage,
                            UMDETW_ALLOCATION_SEMANTIC Semantic)
{
    LogMapAllocation(TRUE,
                     hD3DAllocation,
                     hDxgAllocation,
                     Offset,
                     Size,
                     Usage,
                     Semantic);
}

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung Windows 8
Server minimum yang didukung Windows Server 2012
Target Platform Desktop
Header umdprovider.h (termasuk Umdprovider.h)

Lihat juga

CreateResource

CreateResource(D3D10)

UMDETW_ALLOCATION_SEMANTIC

UMDETW_ALLOCATION_USAGE