ホーム › Graphics.Dxgi › DXGI_ADAPTER_DESC2
DXGI_ADAPTER_DESC2
構造体サイズ=各フィールドのバイト数(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。 |
| Flags | DWORD | 4 | +304 | +292 | アダプターの特性を示すDXGI_ADAPTER_FLAGの組み合わせ。 |
| GraphicsPreemptionGranularity | DXGI_GRAPHICS_PREEMPTION_GRANULARITY | 4 | +308 | +296 | グラフィックス処理のプリエンプション粒度を示す列挙値。 |
| ComputePreemptionGranularity | DXGI_COMPUTE_PREEMPTION_GRANULARITY | 4 | +312 | +300 | コンピュート処理のプリエンプション粒度を示す列挙値。 |
各言語での定義
#include <windows.h>
// LUID (x64 8 / x86 8 バイト)
typedef struct LUID {
DWORD LowPart;
INT HighPart;
} LUID;
// DXGI_ADAPTER_DESC2 (x64 320 / x86 304 バイト)
typedef struct DXGI_ADAPTER_DESC2 {
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_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity;
DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity;
} DXGI_ADAPTER_DESC2;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_DESC2
{
[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;
public int GraphicsPreemptionGranularity;
public int ComputePreemptionGranularity;
}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_DESC2
<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
Public GraphicsPreemptionGranularity As Integer
Public ComputePreemptionGranularity As Integer
End Structureimport ctypes
from ctypes import wintypes
class LUID(ctypes.Structure):
_fields_ = [
("LowPart", wintypes.DWORD),
("HighPart", ctypes.c_int),
]
class DXGI_ADAPTER_DESC2(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),
("GraphicsPreemptionGranularity", ctypes.c_int),
("ComputePreemptionGranularity", ctypes.c_int),
]#[repr(C)]
pub struct LUID {
pub LowPart: u32,
pub HighPart: i32,
}
#[repr(C)]
pub struct DXGI_ADAPTER_DESC2 {
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,
pub GraphicsPreemptionGranularity: i32,
pub ComputePreemptionGranularity: i32,
}import "golang.org/x/sys/windows"
type LUID struct {
LowPart uint32
HighPart int32
}
type DXGI_ADAPTER_DESC2 struct {
Description [128]uint16
VendorId uint32
DeviceId uint32
SubSysId uint32
Revision uint32
DedicatedVideoMemory uintptr
DedicatedSystemMemory uintptr
SharedSystemMemory uintptr
AdapterLuid LUID
Flags uint32
GraphicsPreemptionGranularity int32
ComputePreemptionGranularity int32
}type
LUID = record
LowPart: DWORD;
HighPart: Integer;
end;
DXGI_ADAPTER_DESC2 = 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;
GraphicsPreemptionGranularity: Integer;
ComputePreemptionGranularity: Integer;
end;const LUID = extern struct {
LowPart: u32,
HighPart: i32,
};
const DXGI_ADAPTER_DESC2 = extern struct {
Description: [128]u16,
VendorId: u32,
DeviceId: u32,
SubSysId: u32,
Revision: u32,
DedicatedVideoMemory: usize,
DedicatedSystemMemory: usize,
SharedSystemMemory: usize,
AdapterLuid: LUID,
Flags: u32,
GraphicsPreemptionGranularity: i32,
ComputePreemptionGranularity: i32,
};type
LUID {.bycopy.} = object
LowPart: uint32
HighPart: int32
DXGI_ADAPTER_DESC2 {.bycopy.} = object
Description: array[128, uint16]
VendorId: uint32
DeviceId: uint32
SubSysId: uint32
Revision: uint32
DedicatedVideoMemory: uint
DedicatedSystemMemory: uint
SharedSystemMemory: uint
AdapterLuid: LUID
Flags: uint32
GraphicsPreemptionGranularity: int32
ComputePreemptionGranularity: int32struct LUID
{
uint LowPart;
int HighPart;
}
struct DXGI_ADAPTER_DESC2
{
wchar[128] Description;
uint VendorId;
uint DeviceId;
uint SubSysId;
uint Revision;
size_t DedicatedVideoMemory;
size_t DedicatedSystemMemory;
size_t SharedSystemMemory;
LUID AdapterLuid;
uint Flags;
int GraphicsPreemptionGranularity;
int ComputePreemptionGranularity;
}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_DESC2 サイズ: 304 バイト(x86)
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, 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 も可)
; GraphicsPreemptionGranularity : DXGI_GRAPHICS_PREEMPTION_GRANULARITY (+296, 4byte) st.74 = 値 / 値 = st.74 (lpoke/lpeek も可)
; ComputePreemptionGranularity : DXGI_COMPUTE_PREEMPTION_GRANULARITY (+300, 4byte) st.75 = 値 / 値 = st.75 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_ADAPTER_DESC2 サイズ: 320 バイト(x64)
dim st, 80 ; 4byte整数×80(構造体サイズ 320 / 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 も可)
; GraphicsPreemptionGranularity : DXGI_GRAPHICS_PREEMPTION_GRANULARITY (+308, 4byte) st.77 = 値 / 値 = st.77 (lpoke/lpeek も可)
; ComputePreemptionGranularity : DXGI_COMPUTE_PREEMPTION_GRANULARITY (+312, 4byte) st.78 = 値 / 値 = st.78 (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_DESC2
#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
#field int GraphicsPreemptionGranularity
#field int ComputePreemptionGranularity
#endstruct
stdim st, DXGI_ADAPTER_DESC2 ; NSTRUCT 変数を確保
st->VendorId = 100
mes "VendorId=" + st->VendorId