Win32 API 日本語リファレンス
ホームGraphics.Dxgi › DXGI_ADAPTER_DESC1

DXGI_ADAPTER_DESC1

構造体
サイズx64: 312 バイト / x86: 296 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
DescriptionWCHAR256+0+0アダプターの説明を含む文字列です。機能レベル 9 のグラフィックス ハードウェアでは、GetDesc1 は説明文字列として “Software Adapter” を返します。
VendorIdDWORD4+256+256アダプターのハードウェア ベンダーの PCI ID または ACPI ID です。この値が 0xFFFF 以下の場合は PCI ID であり、それ以外の場合は ACPI ID です。機能レベル 9 のグラフィックス ハードウェアでは、GetDesc1 はこの値として 0 を返します。
DeviceIdDWORD4+260+260アダプターのハードウェア デバイスの PCI ID または ACPI ID です。VendorId が PCI ID の場合はこれも PCI ID であり、それ以外の場合は ACPI ID です。機能レベル 9 のグラフィックス ハードウェアでは、GetDesc1 はこの値として 0 を返します。
SubSysIdDWORD4+264+264アダプターのハードウェア サブシステムの PCI ID または ACPI ID です。VendorId が PCI ID の場合はこれも PCI ID であり、それ以外の場合は ACPI ID です。機能レベル 9 のグラフィックス ハードウェアでは、GetDesc1 はこの値として 0 を返します。
RevisionDWORD4+268+268アダプターの PCI または ACPI のリビジョン番号です。VendorId が PCI ID の場合は PCI デバイスのリビジョン番号であり、それ以外の場合は ACPI デバイスのリビジョン番号です。機能レベル 9 のグラフィックス ハードウェアでは、GetDesc1 はこの値として 0 を返します。
DedicatedVideoMemoryUINT_PTR8/4+272+272CPU と共有されない専用ビデオ メモリのバイト数です。
DedicatedSystemMemoryUINT_PTR8/4+280+276CPU と共有されない専用システム メモリのバイト数です。このメモリは、起動時に利用可能なシステム メモリから割り当てられます。
SharedSystemMemoryUINT_PTR8/4+288+280共有システム メモリのバイト数です。これは、動作中にアダプターが消費する可能性のあるシステム メモリの最大値です。ドライバーがビデオ メモリを管理および使用する際に付随的に消費するメモリは、これとは別に加算されます。
AdapterLuidLUID8+296+284アダプターを識別する一意の値です。構造体の定義については LUID を参照してください。LUID は dxgi.h で定義されています。
FlagsDWORD4+304+292アダプターの種類を記述する DXGI_ADAPTER_FLAG 列挙型の値です。DXGI_ADAPTER_FLAG_REMOTE フラグは予約済みです。

公式ドキュメント

DXGI 1.1 を使用してアダプター (またはビデオ カード) を記述します。

解説(Remarks)

DXGI_ADAPTER_DESC1 構造体は、アダプターの DXGI 1.1 の記述を提供します。この構造体は IDXGIAdapter1::GetDesc1 メソッドを使用して初期化されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// LUID  (x64 8 / x86 8 バイト)
typedef struct LUID {
    DWORD LowPart;
    INT HighPart;
} LUID;

// DXGI_ADAPTER_DESC1  (x64 312 / x86 296 バイト)
typedef struct DXGI_ADAPTER_DESC1 {
    WCHAR Description[128];
    DWORD VendorId;
    DWORD DeviceId;
    DWORD SubSysId;
    DWORD Revision;
    UINT_PTR DedicatedVideoMemory;
    UINT_PTR DedicatedSystemMemory;
    UINT_PTR SharedSystemMemory;
    LUID AdapterLuid;
    DWORD Flags;
} DXGI_ADAPTER_DESC1;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LUID
{
    public uint LowPart;
    public int HighPart;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_ADAPTER_DESC1
{
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string Description;
    public uint VendorId;
    public uint DeviceId;
    public uint SubSysId;
    public uint Revision;
    public UIntPtr DedicatedVideoMemory;
    public UIntPtr DedicatedSystemMemory;
    public UIntPtr SharedSystemMemory;
    public LUID AdapterLuid;
    public uint Flags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LUID
    Public LowPart As UInteger
    Public HighPart As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_ADAPTER_DESC1
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public Description As String
    Public VendorId As UInteger
    Public DeviceId As UInteger
    Public SubSysId As UInteger
    Public Revision As UInteger
    Public DedicatedVideoMemory As UIntPtr
    Public DedicatedSystemMemory As UIntPtr
    Public SharedSystemMemory As UIntPtr
    Public AdapterLuid As LUID
    Public Flags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LUID(ctypes.Structure):
    _fields_ = [
        ("LowPart", wintypes.DWORD),
        ("HighPart", ctypes.c_int),
    ]

class DXGI_ADAPTER_DESC1(ctypes.Structure):
    _fields_ = [
        ("Description", ctypes.c_wchar * 128),
        ("VendorId", wintypes.DWORD),
        ("DeviceId", wintypes.DWORD),
        ("SubSysId", wintypes.DWORD),
        ("Revision", wintypes.DWORD),
        ("DedicatedVideoMemory", ctypes.c_size_t),
        ("DedicatedSystemMemory", ctypes.c_size_t),
        ("SharedSystemMemory", ctypes.c_size_t),
        ("AdapterLuid", LUID),
        ("Flags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct LUID {
    pub LowPart: u32,
    pub HighPart: i32,
}

#[repr(C)]
pub struct DXGI_ADAPTER_DESC1 {
    pub Description: [u16; 128],
    pub VendorId: u32,
    pub DeviceId: u32,
    pub SubSysId: u32,
    pub Revision: u32,
    pub DedicatedVideoMemory: usize,
    pub DedicatedSystemMemory: usize,
    pub SharedSystemMemory: usize,
    pub AdapterLuid: LUID,
    pub Flags: u32,
}
import "golang.org/x/sys/windows"

type LUID struct {
	LowPart uint32
	HighPart int32
}

type DXGI_ADAPTER_DESC1 struct {
	Description [128]uint16
	VendorId uint32
	DeviceId uint32
	SubSysId uint32
	Revision uint32
	DedicatedVideoMemory uintptr
	DedicatedSystemMemory uintptr
	SharedSystemMemory uintptr
	AdapterLuid LUID
	Flags uint32
}
type
  LUID = record
    LowPart: DWORD;
    HighPart: Integer;
  end;

  DXGI_ADAPTER_DESC1 = record
    Description: array[0..127] of WideChar;
    VendorId: DWORD;
    DeviceId: DWORD;
    SubSysId: DWORD;
    Revision: DWORD;
    DedicatedVideoMemory: NativeUInt;
    DedicatedSystemMemory: NativeUInt;
    SharedSystemMemory: NativeUInt;
    AdapterLuid: LUID;
    Flags: DWORD;
  end;
const LUID = extern struct {
    LowPart: u32,
    HighPart: i32,
};

const DXGI_ADAPTER_DESC1 = extern struct {
    Description: [128]u16,
    VendorId: u32,
    DeviceId: u32,
    SubSysId: u32,
    Revision: u32,
    DedicatedVideoMemory: usize,
    DedicatedSystemMemory: usize,
    SharedSystemMemory: usize,
    AdapterLuid: LUID,
    Flags: u32,
};
type
  LUID {.bycopy.} = object
    LowPart: uint32
    HighPart: int32

  DXGI_ADAPTER_DESC1 {.bycopy.} = object
    Description: array[128, uint16]
    VendorId: uint32
    DeviceId: uint32
    SubSysId: uint32
    Revision: uint32
    DedicatedVideoMemory: uint
    DedicatedSystemMemory: uint
    SharedSystemMemory: uint
    AdapterLuid: LUID
    Flags: uint32
struct LUID
{
    uint LowPart;
    int HighPart;
}

struct DXGI_ADAPTER_DESC1
{
    wchar[128] Description;
    uint VendorId;
    uint DeviceId;
    uint SubSysId;
    uint Revision;
    size_t DedicatedVideoMemory;
    size_t DedicatedSystemMemory;
    size_t SharedSystemMemory;
    LUID AdapterLuid;
    uint Flags;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXGI_ADAPTER_DESC1 サイズ: 296 バイト(x86)
dim st, 74    ; 4byte整数×74(構造体サイズ 296 / 4 切り上げ)
; Description : WCHAR (+0, 256byte)  varptr(st)+0 を基点に操作(256byte:入れ子/配列)
; VendorId : DWORD (+256, 4byte)  st.64 = 値  /  値 = st.64   (lpoke/lpeek も可)
; DeviceId : DWORD (+260, 4byte)  st.65 = 値  /  値 = st.65   (lpoke/lpeek も可)
; SubSysId : DWORD (+264, 4byte)  st.66 = 値  /  値 = st.66   (lpoke/lpeek も可)
; Revision : DWORD (+268, 4byte)  st.67 = 値  /  値 = st.67   (lpoke/lpeek も可)
; DedicatedVideoMemory : UINT_PTR (+272, 4byte)  st.68 = 値  /  値 = st.68   (lpoke/lpeek も可)
; DedicatedSystemMemory : UINT_PTR (+276, 4byte)  st.69 = 値  /  値 = st.69   (lpoke/lpeek も可)
; SharedSystemMemory : UINT_PTR (+280, 4byte)  st.70 = 値  /  値 = st.70   (lpoke/lpeek も可)
; AdapterLuid : LUID (+284, 8byte)  varptr(st)+284 を基点に操作(8byte:入れ子/配列)
; Flags : DWORD (+292, 4byte)  st.73 = 値  /  値 = st.73   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_ADAPTER_DESC1 サイズ: 312 バイト(x64)
dim st, 78    ; 4byte整数×78(構造体サイズ 312 / 4 切り上げ)
; Description : WCHAR (+0, 256byte)  varptr(st)+0 を基点に操作(256byte:入れ子/配列)
; VendorId : DWORD (+256, 4byte)  st.64 = 値  /  値 = st.64   (lpoke/lpeek も可)
; DeviceId : DWORD (+260, 4byte)  st.65 = 値  /  値 = st.65   (lpoke/lpeek も可)
; SubSysId : DWORD (+264, 4byte)  st.66 = 値  /  値 = st.66   (lpoke/lpeek も可)
; Revision : DWORD (+268, 4byte)  st.67 = 値  /  値 = st.67   (lpoke/lpeek も可)
; DedicatedVideoMemory : UINT_PTR (+272, 8byte)  qpoke st,272,値 / qpeek(st,272)  ※IronHSPのみ。3.7/3.8は lpoke st,272,下位 : lpoke st,276,上位
; DedicatedSystemMemory : UINT_PTR (+280, 8byte)  qpoke st,280,値 / qpeek(st,280)  ※IronHSPのみ。3.7/3.8は lpoke st,280,下位 : lpoke st,284,上位
; SharedSystemMemory : UINT_PTR (+288, 8byte)  qpoke st,288,値 / qpeek(st,288)  ※IronHSPのみ。3.7/3.8は lpoke st,288,下位 : lpoke st,292,上位
; AdapterLuid : LUID (+296, 8byte)  varptr(st)+296 を基点に操作(8byte:入れ子/配列)
; Flags : DWORD (+304, 4byte)  st.76 = 値  /  値 = st.76   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global LUID
    #field int LowPart
    #field int HighPart
#endstruct

#defstruct global DXGI_ADAPTER_DESC1
    #field wchar Description 128
    #field int VendorId
    #field int DeviceId
    #field int SubSysId
    #field int Revision
    #field intptr DedicatedVideoMemory
    #field intptr DedicatedSystemMemory
    #field intptr SharedSystemMemory
    #field LUID AdapterLuid
    #field int Flags
#endstruct

stdim st, DXGI_ADAPTER_DESC1        ; NSTRUCT 変数を確保
st->VendorId = 100
mes "VendorId=" + st->VendorId