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

D3D12_NODE_CPU_INPUT

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

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

フィールド

フィールドサイズx64x86説明
EntrypointIndexDWORD4+0+0入力先エントリーポイントノードのインデックス。
NumRecordsDWORD4+4+4投入するレコードの数。
pRecordsvoid*8/4+8+8レコードデータ配列へのCPUポインター。
RecordStrideInBytesULONGLONG8+16+16レコード1個あたりのバイト数(ストライド)。

各言語での定義

#include <windows.h>

// D3D12_NODE_CPU_INPUT  (x64 24 / x86 24 バイト)
typedef struct D3D12_NODE_CPU_INPUT {
    DWORD EntrypointIndex;
    DWORD NumRecords;
    void* pRecords;
    ULONGLONG RecordStrideInBytes;
} D3D12_NODE_CPU_INPUT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_NODE_CPU_INPUT
{
    public uint EntrypointIndex;
    public uint NumRecords;
    public IntPtr pRecords;
    public ulong RecordStrideInBytes;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_NODE_CPU_INPUT
    Public EntrypointIndex As UInteger
    Public NumRecords As UInteger
    Public pRecords As IntPtr
    Public RecordStrideInBytes As ULong
End Structure
import ctypes
from ctypes import wintypes

class D3D12_NODE_CPU_INPUT(ctypes.Structure):
    _fields_ = [
        ("EntrypointIndex", wintypes.DWORD),
        ("NumRecords", wintypes.DWORD),
        ("pRecords", ctypes.c_void_p),
        ("RecordStrideInBytes", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct D3D12_NODE_CPU_INPUT {
    pub EntrypointIndex: u32,
    pub NumRecords: u32,
    pub pRecords: *mut core::ffi::c_void,
    pub RecordStrideInBytes: u64,
}
import "golang.org/x/sys/windows"

type D3D12_NODE_CPU_INPUT struct {
	EntrypointIndex uint32
	NumRecords uint32
	pRecords uintptr
	RecordStrideInBytes uint64
}
type
  D3D12_NODE_CPU_INPUT = record
    EntrypointIndex: DWORD;
    NumRecords: DWORD;
    pRecords: Pointer;
    RecordStrideInBytes: UInt64;
  end;
const D3D12_NODE_CPU_INPUT = extern struct {
    EntrypointIndex: u32,
    NumRecords: u32,
    pRecords: ?*anyopaque,
    RecordStrideInBytes: u64,
};
type
  D3D12_NODE_CPU_INPUT {.bycopy.} = object
    EntrypointIndex: uint32
    NumRecords: uint32
    pRecords: pointer
    RecordStrideInBytes: uint64
struct D3D12_NODE_CPU_INPUT
{
    uint EntrypointIndex;
    uint NumRecords;
    void* pRecords;
    ulong RecordStrideInBytes;
}

HSP用 定義

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

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

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