ホーム › Graphics.Dxgi › DXGI_ADAPTER_DESC
DXGI_ADAPTER_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Description | WCHAR | 256 | +0 | +0 | アダプター名を表すNULL終端ワイド文字列。 |
| VendorId | DWORD | 4 | +256 | +256 | アダプターのベンダーを識別するPCIベンダーID。 |
| DeviceId | DWORD | 4 | +260 | +260 | アダプターのデバイスを識別するPCIデバイスID。 |
| SubSysId | DWORD | 4 | +264 | +264 | サブシステムを識別するPCIサブシステムID。 |
| Revision | DWORD | 4 | +268 | +268 | アダプターのリビジョン番号。 |
| DedicatedVideoMemory | UINT_PTR | 8/4 | +272 | +272 | GPU専用ビデオメモリ量(バイト数)。 |
| DedicatedSystemMemory | UINT_PTR | 8/4 | +280 | +276 | GPU専用に確保されたシステムメモリ量(バイト数)。 |
| SharedSystemMemory | UINT_PTR | 8/4 | +288 | +280 | GPUと共有するシステムメモリ量(バイト数)。 |
| AdapterLuid | LUID | 8 | +296 | +284 | アダプターを一意に識別するローカルUID。 |
各言語での定義
#include <windows.h>
// LUID (x64 8 / x86 8 バイト)
typedef struct LUID {
DWORD LowPart;
INT HighPart;
} LUID;
// DXGI_ADAPTER_DESC (x64 304 / x86 292 バイト)
typedef struct DXGI_ADAPTER_DESC {
WCHAR Description[128];
DWORD VendorId;
DWORD DeviceId;
DWORD SubSysId;
DWORD Revision;
UINT_PTR DedicatedVideoMemory;
UINT_PTR DedicatedSystemMemory;
UINT_PTR SharedSystemMemory;
LUID AdapterLuid;
} DXGI_ADAPTER_DESC;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_DESC
{
[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;
}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_DESC
<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
End Structureimport ctypes
from ctypes import wintypes
class LUID(ctypes.Structure):
_fields_ = [
("LowPart", wintypes.DWORD),
("HighPart", ctypes.c_int),
]
class DXGI_ADAPTER_DESC(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),
]#[repr(C)]
pub struct LUID {
pub LowPart: u32,
pub HighPart: i32,
}
#[repr(C)]
pub struct DXGI_ADAPTER_DESC {
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,
}import "golang.org/x/sys/windows"
type LUID struct {
LowPart uint32
HighPart int32
}
type DXGI_ADAPTER_DESC struct {
Description [128]uint16
VendorId uint32
DeviceId uint32
SubSysId uint32
Revision uint32
DedicatedVideoMemory uintptr
DedicatedSystemMemory uintptr
SharedSystemMemory uintptr
AdapterLuid LUID
}type
LUID = record
LowPart: DWORD;
HighPart: Integer;
end;
DXGI_ADAPTER_DESC = record
Description: array[0..127] of WideChar;
VendorId: DWORD;
DeviceId: DWORD;
SubSysId: DWORD;
Revision: DWORD;
DedicatedVideoMemory: NativeUInt;
DedicatedSystemMemory: NativeUInt;
SharedSystemMemory: NativeUInt;
AdapterLuid: LUID;
end;const LUID = extern struct {
LowPart: u32,
HighPart: i32,
};
const DXGI_ADAPTER_DESC = extern struct {
Description: [128]u16,
VendorId: u32,
DeviceId: u32,
SubSysId: u32,
Revision: u32,
DedicatedVideoMemory: usize,
DedicatedSystemMemory: usize,
SharedSystemMemory: usize,
AdapterLuid: LUID,
};type
LUID {.bycopy.} = object
LowPart: uint32
HighPart: int32
DXGI_ADAPTER_DESC {.bycopy.} = object
Description: array[128, uint16]
VendorId: uint32
DeviceId: uint32
SubSysId: uint32
Revision: uint32
DedicatedVideoMemory: uint
DedicatedSystemMemory: uint
SharedSystemMemory: uint
AdapterLuid: LUIDstruct LUID
{
uint LowPart;
int HighPart;
}
struct DXGI_ADAPTER_DESC
{
wchar[128] Description;
uint VendorId;
uint DeviceId;
uint SubSysId;
uint Revision;
size_t DedicatedVideoMemory;
size_t DedicatedSystemMemory;
size_t SharedSystemMemory;
LUID AdapterLuid;
}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_DESC サイズ: 292 バイト(x86)
dim st, 73 ; 4byte整数×73(構造体サイズ 292 / 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:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_ADAPTER_DESC サイズ: 304 バイト(x64)
dim st, 76 ; 4byte整数×76(構造体サイズ 304 / 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:入れ子/配列)
; ※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_DESC
#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
#endstruct
stdim st, DXGI_ADAPTER_DESC ; NSTRUCT 変数を確保
st->VendorId = 100
mes "VendorId=" + st->VendorId