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

D3D12_GRAPHICS_PIPELINE_STATE_DESC

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

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

フィールド

フィールドサイズx64x86説明
pRootSignatureID3D12RootSignature*8/4+0+0このPSOで使用するルートシグネチャへのポインタ。
VSD3D12_SHADER_BYTECODE16/8+8+4頂点シェーダーのバイトコード。
PSD3D12_SHADER_BYTECODE16/8+24+12ピクセルシェーダーのバイトコード。未使用時は空可。
DSD3D12_SHADER_BYTECODE16/8+40+20ドメインシェーダーのバイトコード。テッセレーション時に使う。
HSD3D12_SHADER_BYTECODE16/8+56+28ハルシェーダーのバイトコード。テッセレーション時に使う。
GSD3D12_SHADER_BYTECODE16/8+72+36ジオメトリシェーダーのバイトコード。未使用時は空可。
StreamOutputD3D12_STREAM_OUTPUT_DESC32/20+88+44ストリーム出力ステージの設定。
BlendStateD3D12_BLEND_DESC328+120+64ブレンドステートの設定。
SampleMaskDWORD4+448+392マルチサンプル時に各サンプルへ適用するマスク。通常は0xFFFFFFFF。
RasterizerStateD3D12_RASTERIZER_DESC44+452+396ラスタライザステートの設定。
DepthStencilStateD3D12_DEPTH_STENCIL_DESC52+496+440深度ステンシルステートの設定。
InputLayoutD3D12_INPUT_LAYOUT_DESC16/8+552+492入力レイアウト(頂点レイアウト)の設定。
IBStripCutValueD3D12_INDEX_BUFFER_STRIP_CUT_VALUE4+568+500インデックスバッファのストリップカット値。プリミティブリスタートの基準値を指定する。
PrimitiveTopologyTypeD3D12_PRIMITIVE_TOPOLOGY_TYPE4+572+504プリミティブトポロジの種別。点・線・三角形・パッチを指定する。
NumRenderTargetsDWORD4+576+508使用するレンダーターゲット数。最大8。
RTVFormatsDXGI_FORMAT32+580+512各レンダーターゲットのフォーマット配列。8要素のDXGI_FORMAT。
DSVFormatDXGI_FORMAT4+612+544深度ステンシルビューのフォーマット。
SampleDescDXGI_SAMPLE_DESC8+616+548マルチサンプリングのサンプル数と品質。
NodeMaskDWORD4+624+556PSOを配置するGPUノードのビットマスク。単一GPUでは0。
CachedPSOD3D12_CACHED_PIPELINE_STATE16/8+632+560キャッシュ済みPSOデータ。再生成高速化に用いる。
FlagsD3D12_PIPELINE_STATE_FLAGS4+648+568PSO生成時のフラグ。デバッグ用途などのオプションを指定する。

各言語での定義

#include <windows.h>

// D3D12_SHADER_BYTECODE  (x64 16 / x86 8 バイト)
typedef struct D3D12_SHADER_BYTECODE {
    void* pShaderBytecode;
    UINT_PTR BytecodeLength;
} D3D12_SHADER_BYTECODE;

// D3D12_STREAM_OUTPUT_DESC  (x64 32 / x86 20 バイト)
typedef struct D3D12_STREAM_OUTPUT_DESC {
    D3D12_SO_DECLARATION_ENTRY* pSODeclaration;
    DWORD NumEntries;
    DWORD* pBufferStrides;
    DWORD NumStrides;
    DWORD RasterizedStream;
} D3D12_STREAM_OUTPUT_DESC;

// D3D12_RENDER_TARGET_BLEND_DESC  (x64 40 / x86 40 バイト)
typedef struct D3D12_RENDER_TARGET_BLEND_DESC {
    BOOL BlendEnable;
    BOOL LogicOpEnable;
    D3D12_BLEND SrcBlend;
    D3D12_BLEND DestBlend;
    D3D12_BLEND_OP BlendOp;
    D3D12_BLEND SrcBlendAlpha;
    D3D12_BLEND DestBlendAlpha;
    D3D12_BLEND_OP BlendOpAlpha;
    D3D12_LOGIC_OP LogicOp;
    BYTE RenderTargetWriteMask;
} D3D12_RENDER_TARGET_BLEND_DESC;

// D3D12_BLEND_DESC  (x64 328 / x86 328 バイト)
typedef struct D3D12_BLEND_DESC {
    BOOL AlphaToCoverageEnable;
    BOOL IndependentBlendEnable;
    D3D12_RENDER_TARGET_BLEND_DESC RenderTarget[8];
} D3D12_BLEND_DESC;

// D3D12_RASTERIZER_DESC  (x64 44 / x86 44 バイト)
typedef struct D3D12_RASTERIZER_DESC {
    D3D12_FILL_MODE FillMode;
    D3D12_CULL_MODE CullMode;
    BOOL FrontCounterClockwise;
    INT DepthBias;
    FLOAT DepthBiasClamp;
    FLOAT SlopeScaledDepthBias;
    BOOL DepthClipEnable;
    BOOL MultisampleEnable;
    BOOL AntialiasedLineEnable;
    DWORD ForcedSampleCount;
    D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
} D3D12_RASTERIZER_DESC;

// D3D12_DEPTH_STENCILOP_DESC  (x64 16 / x86 16 バイト)
typedef struct D3D12_DEPTH_STENCILOP_DESC {
    D3D12_STENCIL_OP StencilFailOp;
    D3D12_STENCIL_OP StencilDepthFailOp;
    D3D12_STENCIL_OP StencilPassOp;
    D3D12_COMPARISON_FUNC StencilFunc;
} D3D12_DEPTH_STENCILOP_DESC;

// D3D12_DEPTH_STENCIL_DESC  (x64 52 / x86 52 バイト)
typedef struct D3D12_DEPTH_STENCIL_DESC {
    BOOL DepthEnable;
    D3D12_DEPTH_WRITE_MASK DepthWriteMask;
    D3D12_COMPARISON_FUNC DepthFunc;
    BOOL StencilEnable;
    BYTE StencilReadMask;
    BYTE StencilWriteMask;
    D3D12_DEPTH_STENCILOP_DESC FrontFace;
    D3D12_DEPTH_STENCILOP_DESC BackFace;
} D3D12_DEPTH_STENCIL_DESC;

// D3D12_INPUT_LAYOUT_DESC  (x64 16 / x86 8 バイト)
typedef struct D3D12_INPUT_LAYOUT_DESC {
    D3D12_INPUT_ELEMENT_DESC* pInputElementDescs;
    DWORD NumElements;
} D3D12_INPUT_LAYOUT_DESC;

// DXGI_SAMPLE_DESC  (x64 8 / x86 8 バイト)
typedef struct DXGI_SAMPLE_DESC {
    DWORD Count;
    DWORD Quality;
} DXGI_SAMPLE_DESC;

// D3D12_CACHED_PIPELINE_STATE  (x64 16 / x86 8 バイト)
typedef struct D3D12_CACHED_PIPELINE_STATE {
    void* pCachedBlob;
    UINT_PTR CachedBlobSizeInBytes;
} D3D12_CACHED_PIPELINE_STATE;

// D3D12_GRAPHICS_PIPELINE_STATE_DESC  (x64 656 / x86 572 バイト)
typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC {
    ID3D12RootSignature* pRootSignature;
    D3D12_SHADER_BYTECODE VS;
    D3D12_SHADER_BYTECODE PS;
    D3D12_SHADER_BYTECODE DS;
    D3D12_SHADER_BYTECODE HS;
    D3D12_SHADER_BYTECODE GS;
    D3D12_STREAM_OUTPUT_DESC StreamOutput;
    D3D12_BLEND_DESC BlendState;
    DWORD SampleMask;
    D3D12_RASTERIZER_DESC RasterizerState;
    D3D12_DEPTH_STENCIL_DESC DepthStencilState;
    D3D12_INPUT_LAYOUT_DESC InputLayout;
    D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue;
    D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType;
    DWORD NumRenderTargets;
    DXGI_FORMAT RTVFormats[8];
    DXGI_FORMAT DSVFormat;
    DXGI_SAMPLE_DESC SampleDesc;
    DWORD NodeMask;
    D3D12_CACHED_PIPELINE_STATE CachedPSO;
    D3D12_PIPELINE_STATE_FLAGS Flags;
} D3D12_GRAPHICS_PIPELINE_STATE_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_SHADER_BYTECODE
{
    public IntPtr pShaderBytecode;
    public UIntPtr BytecodeLength;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_STREAM_OUTPUT_DESC
{
    public IntPtr pSODeclaration;
    public uint NumEntries;
    public IntPtr pBufferStrides;
    public uint NumStrides;
    public uint RasterizedStream;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RENDER_TARGET_BLEND_DESC
{
    [MarshalAs(UnmanagedType.Bool)] public bool BlendEnable;
    [MarshalAs(UnmanagedType.Bool)] public bool LogicOpEnable;
    public int SrcBlend;
    public int DestBlend;
    public int BlendOp;
    public int SrcBlendAlpha;
    public int DestBlendAlpha;
    public int BlendOpAlpha;
    public int LogicOp;
    public byte RenderTargetWriteMask;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_BLEND_DESC
{
    [MarshalAs(UnmanagedType.Bool)] public bool AlphaToCoverageEnable;
    [MarshalAs(UnmanagedType.Bool)] public bool IndependentBlendEnable;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public D3D12_RENDER_TARGET_BLEND_DESC[] RenderTarget;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RASTERIZER_DESC
{
    public int FillMode;
    public int CullMode;
    [MarshalAs(UnmanagedType.Bool)] public bool FrontCounterClockwise;
    public int DepthBias;
    public float DepthBiasClamp;
    public float SlopeScaledDepthBias;
    [MarshalAs(UnmanagedType.Bool)] public bool DepthClipEnable;
    [MarshalAs(UnmanagedType.Bool)] public bool MultisampleEnable;
    [MarshalAs(UnmanagedType.Bool)] public bool AntialiasedLineEnable;
    public uint ForcedSampleCount;
    public int ConservativeRaster;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_DEPTH_STENCILOP_DESC
{
    public int StencilFailOp;
    public int StencilDepthFailOp;
    public int StencilPassOp;
    public int StencilFunc;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_DEPTH_STENCIL_DESC
{
    [MarshalAs(UnmanagedType.Bool)] public bool DepthEnable;
    public int DepthWriteMask;
    public int DepthFunc;
    [MarshalAs(UnmanagedType.Bool)] public bool StencilEnable;
    public byte StencilReadMask;
    public byte StencilWriteMask;
    public D3D12_DEPTH_STENCILOP_DESC FrontFace;
    public D3D12_DEPTH_STENCILOP_DESC BackFace;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_INPUT_LAYOUT_DESC
{
    public IntPtr pInputElementDescs;
    public uint NumElements;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_SAMPLE_DESC
{
    public uint Count;
    public uint Quality;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_CACHED_PIPELINE_STATE
{
    public IntPtr pCachedBlob;
    public UIntPtr CachedBlobSizeInBytes;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_GRAPHICS_PIPELINE_STATE_DESC
{
    public IntPtr pRootSignature;
    public D3D12_SHADER_BYTECODE VS;
    public D3D12_SHADER_BYTECODE PS;
    public D3D12_SHADER_BYTECODE DS;
    public D3D12_SHADER_BYTECODE HS;
    public D3D12_SHADER_BYTECODE GS;
    public D3D12_STREAM_OUTPUT_DESC StreamOutput;
    public D3D12_BLEND_DESC BlendState;
    public uint SampleMask;
    public D3D12_RASTERIZER_DESC RasterizerState;
    public D3D12_DEPTH_STENCIL_DESC DepthStencilState;
    public D3D12_INPUT_LAYOUT_DESC InputLayout;
    public int IBStripCutValue;
    public int PrimitiveTopologyType;
    public uint NumRenderTargets;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public int[] RTVFormats;
    public int DSVFormat;
    public DXGI_SAMPLE_DESC SampleDesc;
    public uint NodeMask;
    public D3D12_CACHED_PIPELINE_STATE CachedPSO;
    public int Flags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_SHADER_BYTECODE
    Public pShaderBytecode As IntPtr
    Public BytecodeLength As UIntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_STREAM_OUTPUT_DESC
    Public pSODeclaration As IntPtr
    Public NumEntries As UInteger
    Public pBufferStrides As IntPtr
    Public NumStrides As UInteger
    Public RasterizedStream As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RENDER_TARGET_BLEND_DESC
    <MarshalAs(UnmanagedType.Bool)> Public BlendEnable As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public LogicOpEnable As Boolean
    Public SrcBlend As Integer
    Public DestBlend As Integer
    Public BlendOp As Integer
    Public SrcBlendAlpha As Integer
    Public DestBlendAlpha As Integer
    Public BlendOpAlpha As Integer
    Public LogicOp As Integer
    Public RenderTargetWriteMask As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_BLEND_DESC
    <MarshalAs(UnmanagedType.Bool)> Public AlphaToCoverageEnable As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public IndependentBlendEnable As Boolean
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public RenderTarget() As D3D12_RENDER_TARGET_BLEND_DESC
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RASTERIZER_DESC
    Public FillMode As Integer
    Public CullMode As Integer
    <MarshalAs(UnmanagedType.Bool)> Public FrontCounterClockwise As Boolean
    Public DepthBias As Integer
    Public DepthBiasClamp As Single
    Public SlopeScaledDepthBias As Single
    <MarshalAs(UnmanagedType.Bool)> Public DepthClipEnable As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public MultisampleEnable As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public AntialiasedLineEnable As Boolean
    Public ForcedSampleCount As UInteger
    Public ConservativeRaster As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_DEPTH_STENCILOP_DESC
    Public StencilFailOp As Integer
    Public StencilDepthFailOp As Integer
    Public StencilPassOp As Integer
    Public StencilFunc As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_DEPTH_STENCIL_DESC
    <MarshalAs(UnmanagedType.Bool)> Public DepthEnable As Boolean
    Public DepthWriteMask As Integer
    Public DepthFunc As Integer
    <MarshalAs(UnmanagedType.Bool)> Public StencilEnable As Boolean
    Public StencilReadMask As Byte
    Public StencilWriteMask As Byte
    Public FrontFace As D3D12_DEPTH_STENCILOP_DESC
    Public BackFace As D3D12_DEPTH_STENCILOP_DESC
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_INPUT_LAYOUT_DESC
    Public pInputElementDescs As IntPtr
    Public NumElements As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_SAMPLE_DESC
    Public Count As UInteger
    Public Quality As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_CACHED_PIPELINE_STATE
    Public pCachedBlob As IntPtr
    Public CachedBlobSizeInBytes As UIntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_GRAPHICS_PIPELINE_STATE_DESC
    Public pRootSignature As IntPtr
    Public VS As D3D12_SHADER_BYTECODE
    Public PS As D3D12_SHADER_BYTECODE
    Public DS As D3D12_SHADER_BYTECODE
    Public HS As D3D12_SHADER_BYTECODE
    Public GS As D3D12_SHADER_BYTECODE
    Public StreamOutput As D3D12_STREAM_OUTPUT_DESC
    Public BlendState As D3D12_BLEND_DESC
    Public SampleMask As UInteger
    Public RasterizerState As D3D12_RASTERIZER_DESC
    Public DepthStencilState As D3D12_DEPTH_STENCIL_DESC
    Public InputLayout As D3D12_INPUT_LAYOUT_DESC
    Public IBStripCutValue As Integer
    Public PrimitiveTopologyType As Integer
    Public NumRenderTargets As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public RTVFormats() As Integer
    Public DSVFormat As Integer
    Public SampleDesc As DXGI_SAMPLE_DESC
    Public NodeMask As UInteger
    Public CachedPSO As D3D12_CACHED_PIPELINE_STATE
    Public Flags As Integer
End Structure
import ctypes
from ctypes import wintypes

class D3D12_SHADER_BYTECODE(ctypes.Structure):
    _fields_ = [
        ("pShaderBytecode", ctypes.c_void_p),
        ("BytecodeLength", ctypes.c_size_t),
    ]

class D3D12_STREAM_OUTPUT_DESC(ctypes.Structure):
    _fields_ = [
        ("pSODeclaration", ctypes.c_void_p),
        ("NumEntries", wintypes.DWORD),
        ("pBufferStrides", ctypes.c_void_p),
        ("NumStrides", wintypes.DWORD),
        ("RasterizedStream", wintypes.DWORD),
    ]

class D3D12_RENDER_TARGET_BLEND_DESC(ctypes.Structure):
    _fields_ = [
        ("BlendEnable", wintypes.BOOL),
        ("LogicOpEnable", wintypes.BOOL),
        ("SrcBlend", ctypes.c_int),
        ("DestBlend", ctypes.c_int),
        ("BlendOp", ctypes.c_int),
        ("SrcBlendAlpha", ctypes.c_int),
        ("DestBlendAlpha", ctypes.c_int),
        ("BlendOpAlpha", ctypes.c_int),
        ("LogicOp", ctypes.c_int),
        ("RenderTargetWriteMask", ctypes.c_ubyte),
    ]

class D3D12_BLEND_DESC(ctypes.Structure):
    _fields_ = [
        ("AlphaToCoverageEnable", wintypes.BOOL),
        ("IndependentBlendEnable", wintypes.BOOL),
        ("RenderTarget", D3D12_RENDER_TARGET_BLEND_DESC * 8),
    ]

class D3D12_RASTERIZER_DESC(ctypes.Structure):
    _fields_ = [
        ("FillMode", ctypes.c_int),
        ("CullMode", ctypes.c_int),
        ("FrontCounterClockwise", wintypes.BOOL),
        ("DepthBias", ctypes.c_int),
        ("DepthBiasClamp", ctypes.c_float),
        ("SlopeScaledDepthBias", ctypes.c_float),
        ("DepthClipEnable", wintypes.BOOL),
        ("MultisampleEnable", wintypes.BOOL),
        ("AntialiasedLineEnable", wintypes.BOOL),
        ("ForcedSampleCount", wintypes.DWORD),
        ("ConservativeRaster", ctypes.c_int),
    ]

class D3D12_DEPTH_STENCILOP_DESC(ctypes.Structure):
    _fields_ = [
        ("StencilFailOp", ctypes.c_int),
        ("StencilDepthFailOp", ctypes.c_int),
        ("StencilPassOp", ctypes.c_int),
        ("StencilFunc", ctypes.c_int),
    ]

class D3D12_DEPTH_STENCIL_DESC(ctypes.Structure):
    _fields_ = [
        ("DepthEnable", wintypes.BOOL),
        ("DepthWriteMask", ctypes.c_int),
        ("DepthFunc", ctypes.c_int),
        ("StencilEnable", wintypes.BOOL),
        ("StencilReadMask", ctypes.c_ubyte),
        ("StencilWriteMask", ctypes.c_ubyte),
        ("FrontFace", D3D12_DEPTH_STENCILOP_DESC),
        ("BackFace", D3D12_DEPTH_STENCILOP_DESC),
    ]

class D3D12_INPUT_LAYOUT_DESC(ctypes.Structure):
    _fields_ = [
        ("pInputElementDescs", ctypes.c_void_p),
        ("NumElements", wintypes.DWORD),
    ]

class DXGI_SAMPLE_DESC(ctypes.Structure):
    _fields_ = [
        ("Count", wintypes.DWORD),
        ("Quality", wintypes.DWORD),
    ]

class D3D12_CACHED_PIPELINE_STATE(ctypes.Structure):
    _fields_ = [
        ("pCachedBlob", ctypes.c_void_p),
        ("CachedBlobSizeInBytes", ctypes.c_size_t),
    ]

class D3D12_GRAPHICS_PIPELINE_STATE_DESC(ctypes.Structure):
    _fields_ = [
        ("pRootSignature", ctypes.c_void_p),
        ("VS", D3D12_SHADER_BYTECODE),
        ("PS", D3D12_SHADER_BYTECODE),
        ("DS", D3D12_SHADER_BYTECODE),
        ("HS", D3D12_SHADER_BYTECODE),
        ("GS", D3D12_SHADER_BYTECODE),
        ("StreamOutput", D3D12_STREAM_OUTPUT_DESC),
        ("BlendState", D3D12_BLEND_DESC),
        ("SampleMask", wintypes.DWORD),
        ("RasterizerState", D3D12_RASTERIZER_DESC),
        ("DepthStencilState", D3D12_DEPTH_STENCIL_DESC),
        ("InputLayout", D3D12_INPUT_LAYOUT_DESC),
        ("IBStripCutValue", ctypes.c_int),
        ("PrimitiveTopologyType", ctypes.c_int),
        ("NumRenderTargets", wintypes.DWORD),
        ("RTVFormats", ctypes.c_int * 8),
        ("DSVFormat", ctypes.c_int),
        ("SampleDesc", DXGI_SAMPLE_DESC),
        ("NodeMask", wintypes.DWORD),
        ("CachedPSO", D3D12_CACHED_PIPELINE_STATE),
        ("Flags", ctypes.c_int),
    ]
#[repr(C)]
pub struct D3D12_SHADER_BYTECODE {
    pub pShaderBytecode: *mut core::ffi::c_void,
    pub BytecodeLength: usize,
}

#[repr(C)]
pub struct D3D12_STREAM_OUTPUT_DESC {
    pub pSODeclaration: *mut core::ffi::c_void,
    pub NumEntries: u32,
    pub pBufferStrides: *mut core::ffi::c_void,
    pub NumStrides: u32,
    pub RasterizedStream: u32,
}

#[repr(C)]
pub struct D3D12_RENDER_TARGET_BLEND_DESC {
    pub BlendEnable: i32,
    pub LogicOpEnable: i32,
    pub SrcBlend: i32,
    pub DestBlend: i32,
    pub BlendOp: i32,
    pub SrcBlendAlpha: i32,
    pub DestBlendAlpha: i32,
    pub BlendOpAlpha: i32,
    pub LogicOp: i32,
    pub RenderTargetWriteMask: u8,
}

#[repr(C)]
pub struct D3D12_BLEND_DESC {
    pub AlphaToCoverageEnable: i32,
    pub IndependentBlendEnable: i32,
    pub RenderTarget: [D3D12_RENDER_TARGET_BLEND_DESC; 8],
}

#[repr(C)]
pub struct D3D12_RASTERIZER_DESC {
    pub FillMode: i32,
    pub CullMode: i32,
    pub FrontCounterClockwise: i32,
    pub DepthBias: i32,
    pub DepthBiasClamp: f32,
    pub SlopeScaledDepthBias: f32,
    pub DepthClipEnable: i32,
    pub MultisampleEnable: i32,
    pub AntialiasedLineEnable: i32,
    pub ForcedSampleCount: u32,
    pub ConservativeRaster: i32,
}

#[repr(C)]
pub struct D3D12_DEPTH_STENCILOP_DESC {
    pub StencilFailOp: i32,
    pub StencilDepthFailOp: i32,
    pub StencilPassOp: i32,
    pub StencilFunc: i32,
}

#[repr(C)]
pub struct D3D12_DEPTH_STENCIL_DESC {
    pub DepthEnable: i32,
    pub DepthWriteMask: i32,
    pub DepthFunc: i32,
    pub StencilEnable: i32,
    pub StencilReadMask: u8,
    pub StencilWriteMask: u8,
    pub FrontFace: D3D12_DEPTH_STENCILOP_DESC,
    pub BackFace: D3D12_DEPTH_STENCILOP_DESC,
}

#[repr(C)]
pub struct D3D12_INPUT_LAYOUT_DESC {
    pub pInputElementDescs: *mut core::ffi::c_void,
    pub NumElements: u32,
}

#[repr(C)]
pub struct DXGI_SAMPLE_DESC {
    pub Count: u32,
    pub Quality: u32,
}

#[repr(C)]
pub struct D3D12_CACHED_PIPELINE_STATE {
    pub pCachedBlob: *mut core::ffi::c_void,
    pub CachedBlobSizeInBytes: usize,
}

#[repr(C)]
pub struct D3D12_GRAPHICS_PIPELINE_STATE_DESC {
    pub pRootSignature: *mut core::ffi::c_void,
    pub VS: D3D12_SHADER_BYTECODE,
    pub PS: D3D12_SHADER_BYTECODE,
    pub DS: D3D12_SHADER_BYTECODE,
    pub HS: D3D12_SHADER_BYTECODE,
    pub GS: D3D12_SHADER_BYTECODE,
    pub StreamOutput: D3D12_STREAM_OUTPUT_DESC,
    pub BlendState: D3D12_BLEND_DESC,
    pub SampleMask: u32,
    pub RasterizerState: D3D12_RASTERIZER_DESC,
    pub DepthStencilState: D3D12_DEPTH_STENCIL_DESC,
    pub InputLayout: D3D12_INPUT_LAYOUT_DESC,
    pub IBStripCutValue: i32,
    pub PrimitiveTopologyType: i32,
    pub NumRenderTargets: u32,
    pub RTVFormats: [i32; 8],
    pub DSVFormat: i32,
    pub SampleDesc: DXGI_SAMPLE_DESC,
    pub NodeMask: u32,
    pub CachedPSO: D3D12_CACHED_PIPELINE_STATE,
    pub Flags: i32,
}
import "golang.org/x/sys/windows"

type D3D12_SHADER_BYTECODE struct {
	pShaderBytecode uintptr
	BytecodeLength uintptr
}

type D3D12_STREAM_OUTPUT_DESC struct {
	pSODeclaration uintptr
	NumEntries uint32
	pBufferStrides uintptr
	NumStrides uint32
	RasterizedStream uint32
}

type D3D12_RENDER_TARGET_BLEND_DESC struct {
	BlendEnable int32
	LogicOpEnable int32
	SrcBlend int32
	DestBlend int32
	BlendOp int32
	SrcBlendAlpha int32
	DestBlendAlpha int32
	BlendOpAlpha int32
	LogicOp int32
	RenderTargetWriteMask byte
}

type D3D12_BLEND_DESC struct {
	AlphaToCoverageEnable int32
	IndependentBlendEnable int32
	RenderTarget [8]D3D12_RENDER_TARGET_BLEND_DESC
}

type D3D12_RASTERIZER_DESC struct {
	FillMode int32
	CullMode int32
	FrontCounterClockwise int32
	DepthBias int32
	DepthBiasClamp float32
	SlopeScaledDepthBias float32
	DepthClipEnable int32
	MultisampleEnable int32
	AntialiasedLineEnable int32
	ForcedSampleCount uint32
	ConservativeRaster int32
}

type D3D12_DEPTH_STENCILOP_DESC struct {
	StencilFailOp int32
	StencilDepthFailOp int32
	StencilPassOp int32
	StencilFunc int32
}

type D3D12_DEPTH_STENCIL_DESC struct {
	DepthEnable int32
	DepthWriteMask int32
	DepthFunc int32
	StencilEnable int32
	StencilReadMask byte
	StencilWriteMask byte
	FrontFace D3D12_DEPTH_STENCILOP_DESC
	BackFace D3D12_DEPTH_STENCILOP_DESC
}

type D3D12_INPUT_LAYOUT_DESC struct {
	pInputElementDescs uintptr
	NumElements uint32
}

type DXGI_SAMPLE_DESC struct {
	Count uint32
	Quality uint32
}

type D3D12_CACHED_PIPELINE_STATE struct {
	pCachedBlob uintptr
	CachedBlobSizeInBytes uintptr
}

type D3D12_GRAPHICS_PIPELINE_STATE_DESC struct {
	pRootSignature uintptr
	VS D3D12_SHADER_BYTECODE
	PS D3D12_SHADER_BYTECODE
	DS D3D12_SHADER_BYTECODE
	HS D3D12_SHADER_BYTECODE
	GS D3D12_SHADER_BYTECODE
	StreamOutput D3D12_STREAM_OUTPUT_DESC
	BlendState D3D12_BLEND_DESC
	SampleMask uint32
	RasterizerState D3D12_RASTERIZER_DESC
	DepthStencilState D3D12_DEPTH_STENCIL_DESC
	InputLayout D3D12_INPUT_LAYOUT_DESC
	IBStripCutValue int32
	PrimitiveTopologyType int32
	NumRenderTargets uint32
	RTVFormats [8]int32
	DSVFormat int32
	SampleDesc DXGI_SAMPLE_DESC
	NodeMask uint32
	CachedPSO D3D12_CACHED_PIPELINE_STATE
	Flags int32
}
type
  D3D12_SHADER_BYTECODE = record
    pShaderBytecode: Pointer;
    BytecodeLength: NativeUInt;
  end;

  D3D12_STREAM_OUTPUT_DESC = record
    pSODeclaration: Pointer;
    NumEntries: DWORD;
    pBufferStrides: Pointer;
    NumStrides: DWORD;
    RasterizedStream: DWORD;
  end;

  D3D12_RENDER_TARGET_BLEND_DESC = record
    BlendEnable: BOOL;
    LogicOpEnable: BOOL;
    SrcBlend: Integer;
    DestBlend: Integer;
    BlendOp: Integer;
    SrcBlendAlpha: Integer;
    DestBlendAlpha: Integer;
    BlendOpAlpha: Integer;
    LogicOp: Integer;
    RenderTargetWriteMask: Byte;
  end;

  D3D12_BLEND_DESC = record
    AlphaToCoverageEnable: BOOL;
    IndependentBlendEnable: BOOL;
    RenderTarget: array[0..7] of D3D12_RENDER_TARGET_BLEND_DESC;
  end;

  D3D12_RASTERIZER_DESC = record
    FillMode: Integer;
    CullMode: Integer;
    FrontCounterClockwise: BOOL;
    DepthBias: Integer;
    DepthBiasClamp: Single;
    SlopeScaledDepthBias: Single;
    DepthClipEnable: BOOL;
    MultisampleEnable: BOOL;
    AntialiasedLineEnable: BOOL;
    ForcedSampleCount: DWORD;
    ConservativeRaster: Integer;
  end;

  D3D12_DEPTH_STENCILOP_DESC = record
    StencilFailOp: Integer;
    StencilDepthFailOp: Integer;
    StencilPassOp: Integer;
    StencilFunc: Integer;
  end;

  D3D12_DEPTH_STENCIL_DESC = record
    DepthEnable: BOOL;
    DepthWriteMask: Integer;
    DepthFunc: Integer;
    StencilEnable: BOOL;
    StencilReadMask: Byte;
    StencilWriteMask: Byte;
    FrontFace: D3D12_DEPTH_STENCILOP_DESC;
    BackFace: D3D12_DEPTH_STENCILOP_DESC;
  end;

  D3D12_INPUT_LAYOUT_DESC = record
    pInputElementDescs: Pointer;
    NumElements: DWORD;
  end;

  DXGI_SAMPLE_DESC = record
    Count: DWORD;
    Quality: DWORD;
  end;

  D3D12_CACHED_PIPELINE_STATE = record
    pCachedBlob: Pointer;
    CachedBlobSizeInBytes: NativeUInt;
  end;

  D3D12_GRAPHICS_PIPELINE_STATE_DESC = record
    pRootSignature: Pointer;
    VS: D3D12_SHADER_BYTECODE;
    PS: D3D12_SHADER_BYTECODE;
    DS: D3D12_SHADER_BYTECODE;
    HS: D3D12_SHADER_BYTECODE;
    GS: D3D12_SHADER_BYTECODE;
    StreamOutput: D3D12_STREAM_OUTPUT_DESC;
    BlendState: D3D12_BLEND_DESC;
    SampleMask: DWORD;
    RasterizerState: D3D12_RASTERIZER_DESC;
    DepthStencilState: D3D12_DEPTH_STENCIL_DESC;
    InputLayout: D3D12_INPUT_LAYOUT_DESC;
    IBStripCutValue: Integer;
    PrimitiveTopologyType: Integer;
    NumRenderTargets: DWORD;
    RTVFormats: array[0..7] of Integer;
    DSVFormat: Integer;
    SampleDesc: DXGI_SAMPLE_DESC;
    NodeMask: DWORD;
    CachedPSO: D3D12_CACHED_PIPELINE_STATE;
    Flags: Integer;
  end;
const D3D12_SHADER_BYTECODE = extern struct {
    pShaderBytecode: ?*anyopaque,
    BytecodeLength: usize,
};

const D3D12_STREAM_OUTPUT_DESC = extern struct {
    pSODeclaration: ?*anyopaque,
    NumEntries: u32,
    pBufferStrides: ?*anyopaque,
    NumStrides: u32,
    RasterizedStream: u32,
};

const D3D12_RENDER_TARGET_BLEND_DESC = extern struct {
    BlendEnable: i32,
    LogicOpEnable: i32,
    SrcBlend: i32,
    DestBlend: i32,
    BlendOp: i32,
    SrcBlendAlpha: i32,
    DestBlendAlpha: i32,
    BlendOpAlpha: i32,
    LogicOp: i32,
    RenderTargetWriteMask: u8,
};

const D3D12_BLEND_DESC = extern struct {
    AlphaToCoverageEnable: i32,
    IndependentBlendEnable: i32,
    RenderTarget: [8]D3D12_RENDER_TARGET_BLEND_DESC,
};

const D3D12_RASTERIZER_DESC = extern struct {
    FillMode: i32,
    CullMode: i32,
    FrontCounterClockwise: i32,
    DepthBias: i32,
    DepthBiasClamp: f32,
    SlopeScaledDepthBias: f32,
    DepthClipEnable: i32,
    MultisampleEnable: i32,
    AntialiasedLineEnable: i32,
    ForcedSampleCount: u32,
    ConservativeRaster: i32,
};

const D3D12_DEPTH_STENCILOP_DESC = extern struct {
    StencilFailOp: i32,
    StencilDepthFailOp: i32,
    StencilPassOp: i32,
    StencilFunc: i32,
};

const D3D12_DEPTH_STENCIL_DESC = extern struct {
    DepthEnable: i32,
    DepthWriteMask: i32,
    DepthFunc: i32,
    StencilEnable: i32,
    StencilReadMask: u8,
    StencilWriteMask: u8,
    FrontFace: D3D12_DEPTH_STENCILOP_DESC,
    BackFace: D3D12_DEPTH_STENCILOP_DESC,
};

const D3D12_INPUT_LAYOUT_DESC = extern struct {
    pInputElementDescs: ?*anyopaque,
    NumElements: u32,
};

const DXGI_SAMPLE_DESC = extern struct {
    Count: u32,
    Quality: u32,
};

const D3D12_CACHED_PIPELINE_STATE = extern struct {
    pCachedBlob: ?*anyopaque,
    CachedBlobSizeInBytes: usize,
};

const D3D12_GRAPHICS_PIPELINE_STATE_DESC = extern struct {
    pRootSignature: ?*anyopaque,
    VS: D3D12_SHADER_BYTECODE,
    PS: D3D12_SHADER_BYTECODE,
    DS: D3D12_SHADER_BYTECODE,
    HS: D3D12_SHADER_BYTECODE,
    GS: D3D12_SHADER_BYTECODE,
    StreamOutput: D3D12_STREAM_OUTPUT_DESC,
    BlendState: D3D12_BLEND_DESC,
    SampleMask: u32,
    RasterizerState: D3D12_RASTERIZER_DESC,
    DepthStencilState: D3D12_DEPTH_STENCIL_DESC,
    InputLayout: D3D12_INPUT_LAYOUT_DESC,
    IBStripCutValue: i32,
    PrimitiveTopologyType: i32,
    NumRenderTargets: u32,
    RTVFormats: [8]i32,
    DSVFormat: i32,
    SampleDesc: DXGI_SAMPLE_DESC,
    NodeMask: u32,
    CachedPSO: D3D12_CACHED_PIPELINE_STATE,
    Flags: i32,
};
type
  D3D12_SHADER_BYTECODE {.bycopy.} = object
    pShaderBytecode: pointer
    BytecodeLength: uint

  D3D12_STREAM_OUTPUT_DESC {.bycopy.} = object
    pSODeclaration: pointer
    NumEntries: uint32
    pBufferStrides: pointer
    NumStrides: uint32
    RasterizedStream: uint32

  D3D12_RENDER_TARGET_BLEND_DESC {.bycopy.} = object
    BlendEnable: int32
    LogicOpEnable: int32
    SrcBlend: int32
    DestBlend: int32
    BlendOp: int32
    SrcBlendAlpha: int32
    DestBlendAlpha: int32
    BlendOpAlpha: int32
    LogicOp: int32
    RenderTargetWriteMask: uint8

  D3D12_BLEND_DESC {.bycopy.} = object
    AlphaToCoverageEnable: int32
    IndependentBlendEnable: int32
    RenderTarget: array[8, D3D12_RENDER_TARGET_BLEND_DESC]

  D3D12_RASTERIZER_DESC {.bycopy.} = object
    FillMode: int32
    CullMode: int32
    FrontCounterClockwise: int32
    DepthBias: int32
    DepthBiasClamp: float32
    SlopeScaledDepthBias: float32
    DepthClipEnable: int32
    MultisampleEnable: int32
    AntialiasedLineEnable: int32
    ForcedSampleCount: uint32
    ConservativeRaster: int32

  D3D12_DEPTH_STENCILOP_DESC {.bycopy.} = object
    StencilFailOp: int32
    StencilDepthFailOp: int32
    StencilPassOp: int32
    StencilFunc: int32

  D3D12_DEPTH_STENCIL_DESC {.bycopy.} = object
    DepthEnable: int32
    DepthWriteMask: int32
    DepthFunc: int32
    StencilEnable: int32
    StencilReadMask: uint8
    StencilWriteMask: uint8
    FrontFace: D3D12_DEPTH_STENCILOP_DESC
    BackFace: D3D12_DEPTH_STENCILOP_DESC

  D3D12_INPUT_LAYOUT_DESC {.bycopy.} = object
    pInputElementDescs: pointer
    NumElements: uint32

  DXGI_SAMPLE_DESC {.bycopy.} = object
    Count: uint32
    Quality: uint32

  D3D12_CACHED_PIPELINE_STATE {.bycopy.} = object
    pCachedBlob: pointer
    CachedBlobSizeInBytes: uint

  D3D12_GRAPHICS_PIPELINE_STATE_DESC {.bycopy.} = object
    pRootSignature: pointer
    VS: D3D12_SHADER_BYTECODE
    PS: D3D12_SHADER_BYTECODE
    DS: D3D12_SHADER_BYTECODE
    HS: D3D12_SHADER_BYTECODE
    GS: D3D12_SHADER_BYTECODE
    StreamOutput: D3D12_STREAM_OUTPUT_DESC
    BlendState: D3D12_BLEND_DESC
    SampleMask: uint32
    RasterizerState: D3D12_RASTERIZER_DESC
    DepthStencilState: D3D12_DEPTH_STENCIL_DESC
    InputLayout: D3D12_INPUT_LAYOUT_DESC
    IBStripCutValue: int32
    PrimitiveTopologyType: int32
    NumRenderTargets: uint32
    RTVFormats: array[8, int32]
    DSVFormat: int32
    SampleDesc: DXGI_SAMPLE_DESC
    NodeMask: uint32
    CachedPSO: D3D12_CACHED_PIPELINE_STATE
    Flags: int32
struct D3D12_SHADER_BYTECODE
{
    void* pShaderBytecode;
    size_t BytecodeLength;
}

struct D3D12_STREAM_OUTPUT_DESC
{
    void* pSODeclaration;
    uint NumEntries;
    void* pBufferStrides;
    uint NumStrides;
    uint RasterizedStream;
}

struct D3D12_RENDER_TARGET_BLEND_DESC
{
    int BlendEnable;
    int LogicOpEnable;
    int SrcBlend;
    int DestBlend;
    int BlendOp;
    int SrcBlendAlpha;
    int DestBlendAlpha;
    int BlendOpAlpha;
    int LogicOp;
    ubyte RenderTargetWriteMask;
}

struct D3D12_BLEND_DESC
{
    int AlphaToCoverageEnable;
    int IndependentBlendEnable;
    D3D12_RENDER_TARGET_BLEND_DESC[8] RenderTarget;
}

struct D3D12_RASTERIZER_DESC
{
    int FillMode;
    int CullMode;
    int FrontCounterClockwise;
    int DepthBias;
    float DepthBiasClamp;
    float SlopeScaledDepthBias;
    int DepthClipEnable;
    int MultisampleEnable;
    int AntialiasedLineEnable;
    uint ForcedSampleCount;
    int ConservativeRaster;
}

struct D3D12_DEPTH_STENCILOP_DESC
{
    int StencilFailOp;
    int StencilDepthFailOp;
    int StencilPassOp;
    int StencilFunc;
}

struct D3D12_DEPTH_STENCIL_DESC
{
    int DepthEnable;
    int DepthWriteMask;
    int DepthFunc;
    int StencilEnable;
    ubyte StencilReadMask;
    ubyte StencilWriteMask;
    D3D12_DEPTH_STENCILOP_DESC FrontFace;
    D3D12_DEPTH_STENCILOP_DESC BackFace;
}

struct D3D12_INPUT_LAYOUT_DESC
{
    void* pInputElementDescs;
    uint NumElements;
}

struct DXGI_SAMPLE_DESC
{
    uint Count;
    uint Quality;
}

struct D3D12_CACHED_PIPELINE_STATE
{
    void* pCachedBlob;
    size_t CachedBlobSizeInBytes;
}

struct D3D12_GRAPHICS_PIPELINE_STATE_DESC
{
    void* pRootSignature;
    D3D12_SHADER_BYTECODE VS;
    D3D12_SHADER_BYTECODE PS;
    D3D12_SHADER_BYTECODE DS;
    D3D12_SHADER_BYTECODE HS;
    D3D12_SHADER_BYTECODE GS;
    D3D12_STREAM_OUTPUT_DESC StreamOutput;
    D3D12_BLEND_DESC BlendState;
    uint SampleMask;
    D3D12_RASTERIZER_DESC RasterizerState;
    D3D12_DEPTH_STENCIL_DESC DepthStencilState;
    D3D12_INPUT_LAYOUT_DESC InputLayout;
    int IBStripCutValue;
    int PrimitiveTopologyType;
    uint NumRenderTargets;
    int[8] RTVFormats;
    int DSVFormat;
    DXGI_SAMPLE_DESC SampleDesc;
    uint NodeMask;
    D3D12_CACHED_PIPELINE_STATE CachedPSO;
    int Flags;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_GRAPHICS_PIPELINE_STATE_DESC サイズ: 572 バイト(x86)
dim st, 143    ; 4byte整数×143(構造体サイズ 572 / 4 切り上げ)
; pRootSignature : ID3D12RootSignature* (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; VS : D3D12_SHADER_BYTECODE (+4, 8byte)  varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; PS : D3D12_SHADER_BYTECODE (+12, 8byte)  varptr(st)+12 を基点に操作(8byte:入れ子/配列)
; DS : D3D12_SHADER_BYTECODE (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; HS : D3D12_SHADER_BYTECODE (+28, 8byte)  varptr(st)+28 を基点に操作(8byte:入れ子/配列)
; GS : D3D12_SHADER_BYTECODE (+36, 8byte)  varptr(st)+36 を基点に操作(8byte:入れ子/配列)
; StreamOutput : D3D12_STREAM_OUTPUT_DESC (+44, 20byte)  varptr(st)+44 を基点に操作(20byte:入れ子/配列)
; BlendState : D3D12_BLEND_DESC (+64, 328byte)  varptr(st)+64 を基点に操作(328byte:入れ子/配列)
; SampleMask : DWORD (+392, 4byte)  st.98 = 値  /  値 = st.98   (lpoke/lpeek も可)
; RasterizerState : D3D12_RASTERIZER_DESC (+396, 44byte)  varptr(st)+396 を基点に操作(44byte:入れ子/配列)
; DepthStencilState : D3D12_DEPTH_STENCIL_DESC (+440, 52byte)  varptr(st)+440 を基点に操作(52byte:入れ子/配列)
; InputLayout : D3D12_INPUT_LAYOUT_DESC (+492, 8byte)  varptr(st)+492 を基点に操作(8byte:入れ子/配列)
; IBStripCutValue : D3D12_INDEX_BUFFER_STRIP_CUT_VALUE (+500, 4byte)  st.125 = 値  /  値 = st.125   (lpoke/lpeek も可)
; PrimitiveTopologyType : D3D12_PRIMITIVE_TOPOLOGY_TYPE (+504, 4byte)  st.126 = 値  /  値 = st.126   (lpoke/lpeek も可)
; NumRenderTargets : DWORD (+508, 4byte)  st.127 = 値  /  値 = st.127   (lpoke/lpeek も可)
; RTVFormats : DXGI_FORMAT (+512, 32byte)  varptr(st)+512 を基点に操作(32byte:入れ子/配列)
; DSVFormat : DXGI_FORMAT (+544, 4byte)  st.136 = 値  /  値 = st.136   (lpoke/lpeek も可)
; SampleDesc : DXGI_SAMPLE_DESC (+548, 8byte)  varptr(st)+548 を基点に操作(8byte:入れ子/配列)
; NodeMask : DWORD (+556, 4byte)  st.139 = 値  /  値 = st.139   (lpoke/lpeek も可)
; CachedPSO : D3D12_CACHED_PIPELINE_STATE (+560, 8byte)  varptr(st)+560 を基点に操作(8byte:入れ子/配列)
; Flags : D3D12_PIPELINE_STATE_FLAGS (+568, 4byte)  st.142 = 値  /  値 = st.142   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_GRAPHICS_PIPELINE_STATE_DESC サイズ: 656 バイト(x64)
dim st, 164    ; 4byte整数×164(構造体サイズ 656 / 4 切り上げ)
; pRootSignature : ID3D12RootSignature* (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; VS : D3D12_SHADER_BYTECODE (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; PS : D3D12_SHADER_BYTECODE (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; DS : D3D12_SHADER_BYTECODE (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; HS : D3D12_SHADER_BYTECODE (+56, 16byte)  varptr(st)+56 を基点に操作(16byte:入れ子/配列)
; GS : D3D12_SHADER_BYTECODE (+72, 16byte)  varptr(st)+72 を基点に操作(16byte:入れ子/配列)
; StreamOutput : D3D12_STREAM_OUTPUT_DESC (+88, 32byte)  varptr(st)+88 を基点に操作(32byte:入れ子/配列)
; BlendState : D3D12_BLEND_DESC (+120, 328byte)  varptr(st)+120 を基点に操作(328byte:入れ子/配列)
; SampleMask : DWORD (+448, 4byte)  st.112 = 値  /  値 = st.112   (lpoke/lpeek も可)
; RasterizerState : D3D12_RASTERIZER_DESC (+452, 44byte)  varptr(st)+452 を基点に操作(44byte:入れ子/配列)
; DepthStencilState : D3D12_DEPTH_STENCIL_DESC (+496, 52byte)  varptr(st)+496 を基点に操作(52byte:入れ子/配列)
; InputLayout : D3D12_INPUT_LAYOUT_DESC (+552, 16byte)  varptr(st)+552 を基点に操作(16byte:入れ子/配列)
; IBStripCutValue : D3D12_INDEX_BUFFER_STRIP_CUT_VALUE (+568, 4byte)  st.142 = 値  /  値 = st.142   (lpoke/lpeek も可)
; PrimitiveTopologyType : D3D12_PRIMITIVE_TOPOLOGY_TYPE (+572, 4byte)  st.143 = 値  /  値 = st.143   (lpoke/lpeek も可)
; NumRenderTargets : DWORD (+576, 4byte)  st.144 = 値  /  値 = st.144   (lpoke/lpeek も可)
; RTVFormats : DXGI_FORMAT (+580, 32byte)  varptr(st)+580 を基点に操作(32byte:入れ子/配列)
; DSVFormat : DXGI_FORMAT (+612, 4byte)  st.153 = 値  /  値 = st.153   (lpoke/lpeek も可)
; SampleDesc : DXGI_SAMPLE_DESC (+616, 8byte)  varptr(st)+616 を基点に操作(8byte:入れ子/配列)
; NodeMask : DWORD (+624, 4byte)  st.156 = 値  /  値 = st.156   (lpoke/lpeek も可)
; CachedPSO : D3D12_CACHED_PIPELINE_STATE (+632, 16byte)  varptr(st)+632 を基点に操作(16byte:入れ子/配列)
; Flags : D3D12_PIPELINE_STATE_FLAGS (+648, 4byte)  st.162 = 値  /  値 = st.162   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_SHADER_BYTECODE
    #field intptr pShaderBytecode
    #field intptr BytecodeLength
#endstruct

#defstruct global D3D12_STREAM_OUTPUT_DESC
    #field intptr pSODeclaration
    #field int NumEntries
    #field intptr pBufferStrides
    #field int NumStrides
    #field int RasterizedStream
#endstruct

#defstruct global D3D12_RENDER_TARGET_BLEND_DESC
    #field bool BlendEnable
    #field bool LogicOpEnable
    #field int SrcBlend
    #field int DestBlend
    #field int BlendOp
    #field int SrcBlendAlpha
    #field int DestBlendAlpha
    #field int BlendOpAlpha
    #field int LogicOp
    #field byte RenderTargetWriteMask
#endstruct

#defstruct global D3D12_BLEND_DESC
    #field bool AlphaToCoverageEnable
    #field bool IndependentBlendEnable
    #field D3D12_RENDER_TARGET_BLEND_DESC RenderTarget 8
#endstruct

#defstruct global D3D12_RASTERIZER_DESC
    #field int FillMode
    #field int CullMode
    #field bool FrontCounterClockwise
    #field int DepthBias
    #field float DepthBiasClamp
    #field float SlopeScaledDepthBias
    #field bool DepthClipEnable
    #field bool MultisampleEnable
    #field bool AntialiasedLineEnable
    #field int ForcedSampleCount
    #field int ConservativeRaster
#endstruct

#defstruct global D3D12_DEPTH_STENCILOP_DESC
    #field int StencilFailOp
    #field int StencilDepthFailOp
    #field int StencilPassOp
    #field int StencilFunc
#endstruct

#defstruct global D3D12_DEPTH_STENCIL_DESC
    #field bool DepthEnable
    #field int DepthWriteMask
    #field int DepthFunc
    #field bool StencilEnable
    #field byte StencilReadMask
    #field byte StencilWriteMask
    #field D3D12_DEPTH_STENCILOP_DESC FrontFace
    #field D3D12_DEPTH_STENCILOP_DESC BackFace
#endstruct

#defstruct global D3D12_INPUT_LAYOUT_DESC
    #field intptr pInputElementDescs
    #field int NumElements
#endstruct

#defstruct global DXGI_SAMPLE_DESC
    #field int Count
    #field int Quality
#endstruct

#defstruct global D3D12_CACHED_PIPELINE_STATE
    #field intptr pCachedBlob
    #field intptr CachedBlobSizeInBytes
#endstruct

#defstruct global D3D12_GRAPHICS_PIPELINE_STATE_DESC
    #field intptr pRootSignature
    #field D3D12_SHADER_BYTECODE VS
    #field D3D12_SHADER_BYTECODE PS
    #field D3D12_SHADER_BYTECODE DS
    #field D3D12_SHADER_BYTECODE HS
    #field D3D12_SHADER_BYTECODE GS
    #field D3D12_STREAM_OUTPUT_DESC StreamOutput
    #field D3D12_BLEND_DESC BlendState
    #field int SampleMask
    #field D3D12_RASTERIZER_DESC RasterizerState
    #field D3D12_DEPTH_STENCIL_DESC DepthStencilState
    #field D3D12_INPUT_LAYOUT_DESC InputLayout
    #field int IBStripCutValue
    #field int PrimitiveTopologyType
    #field int NumRenderTargets
    #field int RTVFormats 8
    #field int DSVFormat
    #field DXGI_SAMPLE_DESC SampleDesc
    #field int NodeMask
    #field D3D12_CACHED_PIPELINE_STATE CachedPSO
    #field int Flags
#endstruct

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