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

D3D9ON12_ARGS

構造体
サイズx64: 40 バイト / x86: 24 バイト

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

フィールド

フィールドサイズx64x86説明
Enable9On12BOOL4+0+0Direct3D9を Direct3D12上で動作させるかを指定する真偽値。TRUEで9on12を有効化する。
pD3D12DeviceIUnknown*8/4+8+4使用するID3D12Deviceへのインターフェイスポインタ。IUnknownとして渡す。
ppD3D12QueuesIUnknown*16/8+16+89on12が利用するID3D12CommandQueue群を指すポインタ配列の先頭。
NumQueuesDWORD4+32+16ppD3D12Queuesが指すコマンドキューの個数を示す。
NodeMaskDWORD4+36+20対象GPUノードを示すビットマスク。単一GPUでは0を指定する。

各言語での定義

#include <windows.h>

// D3D9ON12_ARGS  (x64 40 / x86 24 バイト)
typedef struct D3D9ON12_ARGS {
    BOOL Enable9On12;
    IUnknown* pD3D12Device;
    IUnknown* ppD3D12Queues[2];
    DWORD NumQueues;
    DWORD NodeMask;
} D3D9ON12_ARGS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D9ON12_ARGS
{
    [MarshalAs(UnmanagedType.Bool)] public bool Enable9On12;
    public IntPtr pD3D12Device;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public IntPtr[] ppD3D12Queues;
    public uint NumQueues;
    public uint NodeMask;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D9ON12_ARGS
    <MarshalAs(UnmanagedType.Bool)> Public Enable9On12 As Boolean
    Public pD3D12Device As IntPtr
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public ppD3D12Queues() As IntPtr
    Public NumQueues As UInteger
    Public NodeMask As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D9ON12_ARGS(ctypes.Structure):
    _fields_ = [
        ("Enable9On12", wintypes.BOOL),
        ("pD3D12Device", ctypes.c_void_p),
        ("ppD3D12Queues", ctypes.c_void_p * 2),
        ("NumQueues", wintypes.DWORD),
        ("NodeMask", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D9ON12_ARGS {
    pub Enable9On12: i32,
    pub pD3D12Device: *mut core::ffi::c_void,
    pub ppD3D12Queues: [*mut core::ffi::c_void; 2],
    pub NumQueues: u32,
    pub NodeMask: u32,
}
import "golang.org/x/sys/windows"

type D3D9ON12_ARGS struct {
	Enable9On12 int32
	pD3D12Device uintptr
	ppD3D12Queues [2]uintptr
	NumQueues uint32
	NodeMask uint32
}
type
  D3D9ON12_ARGS = record
    Enable9On12: BOOL;
    pD3D12Device: Pointer;
    ppD3D12Queues: array[0..1] of Pointer;
    NumQueues: DWORD;
    NodeMask: DWORD;
  end;
const D3D9ON12_ARGS = extern struct {
    Enable9On12: i32,
    pD3D12Device: ?*anyopaque,
    ppD3D12Queues: [2]?*anyopaque,
    NumQueues: u32,
    NodeMask: u32,
};
type
  D3D9ON12_ARGS {.bycopy.} = object
    Enable9On12: int32
    pD3D12Device: pointer
    ppD3D12Queues: array[2, pointer]
    NumQueues: uint32
    NodeMask: uint32
struct D3D9ON12_ARGS
{
    int Enable9On12;
    void* pD3D12Device;
    void*[2] ppD3D12Queues;
    uint NumQueues;
    uint NodeMask;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D9ON12_ARGS サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Enable9On12 : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pD3D12Device : IUnknown* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ppD3D12Queues : IUnknown* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; NumQueues : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; NodeMask : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D9ON12_ARGS サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Enable9On12 : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pD3D12Device : IUnknown* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ppD3D12Queues : IUnknown* (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; NumQueues : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; NodeMask : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D9ON12_ARGS
    #field bool Enable9On12
    #field intptr pD3D12Device
    #field intptr ppD3D12Queues 2
    #field int NumQueues
    #field int NodeMask
#endstruct

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