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

DXGI_ADAPTER_DESC3

構造体
サイズx64: 320 バイト / x86: 304 バイト

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

フィールド

フィールドサイズx64x86説明
DescriptionWCHAR256+0+0アダプター名を表すNULL終端ワイド文字列。
VendorIdDWORD4+256+256アダプターのベンダーを識別するPCIベンダーID。
DeviceIdDWORD4+260+260アダプターのデバイスを識別するPCIデバイスID。
SubSysIdDWORD4+264+264サブシステムを識別するPCIサブシステムID。
RevisionDWORD4+268+268アダプターのリビジョン番号。
DedicatedVideoMemoryUINT_PTR8/4+272+272GPU専用ビデオメモリ量(バイト数)。
DedicatedSystemMemoryUINT_PTR8/4+280+276GPU専用に確保されたシステムメモリ量(バイト数)。
SharedSystemMemoryUINT_PTR8/4+288+280GPUと共有するシステムメモリ量(バイト数)。
AdapterLuidLUID8+296+284アダプターを一意に識別するローカルUID。
FlagsDXGI_ADAPTER_FLAG34+304+292アダプターの特性を示すDXGI_ADAPTER_FLAG3の組み合わせ。
GraphicsPreemptionGranularityDXGI_GRAPHICS_PREEMPTION_GRANULARITY4+308+296グラフィックス処理のプリエンプション粒度を示す列挙値。
ComputePreemptionGranularityDXGI_COMPUTE_PREEMPTION_GRANULARITY4+312+300コンピュート処理のプリエンプション粒度を示す列挙値。

各言語での定義

#include <windows.h>

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

// DXGI_ADAPTER_DESC3  (x64 320 / x86 304 バイト)
typedef struct DXGI_ADAPTER_DESC3 {
    WCHAR Description[128];
    DWORD VendorId;
    DWORD DeviceId;
    DWORD SubSysId;
    DWORD Revision;
    UINT_PTR DedicatedVideoMemory;
    UINT_PTR DedicatedSystemMemory;
    UINT_PTR SharedSystemMemory;
    LUID AdapterLuid;
    DXGI_ADAPTER_FLAG3 Flags;
    DXGI_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity;
    DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity;
} DXGI_ADAPTER_DESC3;
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_DESC3
{
    [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 int 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_DESC3
    <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 Integer
    Public GraphicsPreemptionGranularity As Integer
    Public ComputePreemptionGranularity As Integer
End Structure
import ctypes
from ctypes import wintypes

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

class DXGI_ADAPTER_DESC3(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", ctypes.c_int),
        ("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_DESC3 {
    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: i32,
    pub GraphicsPreemptionGranularity: i32,
    pub ComputePreemptionGranularity: i32,
}
import "golang.org/x/sys/windows"

type LUID struct {
	LowPart uint32
	HighPart int32
}

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

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

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

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

struct DXGI_ADAPTER_DESC3
{
    wchar[128] Description;
    uint VendorId;
    uint DeviceId;
    uint SubSysId;
    uint Revision;
    size_t DedicatedVideoMemory;
    size_t DedicatedSystemMemory;
    size_t SharedSystemMemory;
    LUID AdapterLuid;
    int 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_DESC3 サイズ: 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 : DXGI_ADAPTER_FLAG3 (+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_DESC3 サイズ: 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 : DXGI_ADAPTER_FLAG3 (+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_DESC3
    #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_DESC3        ; NSTRUCT 変数を確保
st->VendorId = 100
mes "VendorId=" + st->VendorId