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

D3D12_WORK_GRAPH_DESC

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

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

フィールド

フィールドサイズx64x86説明
ProgramNameLPWSTR8/4+0+0ワークグラフプログラムの名前(ワイド文字列)。
FlagsD3D12_WORK_GRAPH_FLAGS4+8+4ワークグラフの構成を制御するフラグ。
NumEntrypointsDWORD4+12+8明示エントリーポイント配列の要素数。
pEntrypointsD3D12_NODE_ID*8/4+16+12エントリーポイントとなるノードID配列へのポインター。NULL可。
NumExplicitlyDefinedNodesDWORD4+24+16明示的に定義したノード配列の要素数。
pExplicitlyDefinedNodesD3D12_NODE*8/4+32+20明示的に定義したノード配列へのポインター。NULL可。

各言語での定義

#include <windows.h>

// D3D12_WORK_GRAPH_DESC  (x64 40 / x86 24 バイト)
typedef struct D3D12_WORK_GRAPH_DESC {
    LPWSTR ProgramName;
    D3D12_WORK_GRAPH_FLAGS Flags;
    DWORD NumEntrypoints;
    D3D12_NODE_ID* pEntrypoints;
    DWORD NumExplicitlyDefinedNodes;
    D3D12_NODE* pExplicitlyDefinedNodes;
} D3D12_WORK_GRAPH_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_WORK_GRAPH_DESC
{
    public IntPtr ProgramName;
    public int Flags;
    public uint NumEntrypoints;
    public IntPtr pEntrypoints;
    public uint NumExplicitlyDefinedNodes;
    public IntPtr pExplicitlyDefinedNodes;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_WORK_GRAPH_DESC
    Public ProgramName As IntPtr
    Public Flags As Integer
    Public NumEntrypoints As UInteger
    Public pEntrypoints As IntPtr
    Public NumExplicitlyDefinedNodes As UInteger
    Public pExplicitlyDefinedNodes As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class D3D12_WORK_GRAPH_DESC(ctypes.Structure):
    _fields_ = [
        ("ProgramName", ctypes.c_void_p),
        ("Flags", ctypes.c_int),
        ("NumEntrypoints", wintypes.DWORD),
        ("pEntrypoints", ctypes.c_void_p),
        ("NumExplicitlyDefinedNodes", wintypes.DWORD),
        ("pExplicitlyDefinedNodes", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct D3D12_WORK_GRAPH_DESC {
    pub ProgramName: *mut core::ffi::c_void,
    pub Flags: i32,
    pub NumEntrypoints: u32,
    pub pEntrypoints: *mut core::ffi::c_void,
    pub NumExplicitlyDefinedNodes: u32,
    pub pExplicitlyDefinedNodes: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type D3D12_WORK_GRAPH_DESC struct {
	ProgramName uintptr
	Flags int32
	NumEntrypoints uint32
	pEntrypoints uintptr
	NumExplicitlyDefinedNodes uint32
	pExplicitlyDefinedNodes uintptr
}
type
  D3D12_WORK_GRAPH_DESC = record
    ProgramName: Pointer;
    Flags: Integer;
    NumEntrypoints: DWORD;
    pEntrypoints: Pointer;
    NumExplicitlyDefinedNodes: DWORD;
    pExplicitlyDefinedNodes: Pointer;
  end;
const D3D12_WORK_GRAPH_DESC = extern struct {
    ProgramName: ?*anyopaque,
    Flags: i32,
    NumEntrypoints: u32,
    pEntrypoints: ?*anyopaque,
    NumExplicitlyDefinedNodes: u32,
    pExplicitlyDefinedNodes: ?*anyopaque,
};
type
  D3D12_WORK_GRAPH_DESC {.bycopy.} = object
    ProgramName: pointer
    Flags: int32
    NumEntrypoints: uint32
    pEntrypoints: pointer
    NumExplicitlyDefinedNodes: uint32
    pExplicitlyDefinedNodes: pointer
struct D3D12_WORK_GRAPH_DESC
{
    void* ProgramName;
    int Flags;
    uint NumEntrypoints;
    void* pEntrypoints;
    uint NumExplicitlyDefinedNodes;
    void* pExplicitlyDefinedNodes;
}

HSP用 定義

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

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

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