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

D3D12_STREAM_OUTPUT_DESC

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

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

フィールド

フィールドサイズx64x86説明
pSODeclarationD3D12_SO_DECLARATION_ENTRY*8/4+0+0D3D12_SO_DECLARATION_ENTRY 構造体の配列です。NumEntries > 0 の場合、NULL にすることはできません。
NumEntriesDWORD4+8+4pSODeclaration メンバーが指すストリーム出力宣言配列のエントリ数です。
pBufferStridesDWORD*8/4+16+8バッファーのストライドの配列です。各ストライドは、そのバッファーの 1 要素のサイズです。
NumStridesDWORD4+24+12pBufferStrides メンバーが指すストライド (またはバッファー) の数です。
RasterizedStreamDWORD4+28+16ラスタライザー ステージに送られるストリームのインデックス番号です。

公式ドキュメント

ストリーミング出力バッファーを記述します。

解説(Remarks)

D3D12_GRAPHICS_PIPELINE_STATE_DESC オブジェクトには、D3D12_STREAM_OUTPUT_DESC 構造体が含まれます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// 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;
using System;
using System.Runtime.InteropServices;

[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;
}
Imports System.Runtime.InteropServices

<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
import ctypes
from ctypes import wintypes

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),
    ]
#[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,
}
import "golang.org/x/sys/windows"

type D3D12_STREAM_OUTPUT_DESC struct {
	pSODeclaration uintptr
	NumEntries uint32
	pBufferStrides uintptr
	NumStrides uint32
	RasterizedStream uint32
}
type
  D3D12_STREAM_OUTPUT_DESC = record
    pSODeclaration: Pointer;
    NumEntries: DWORD;
    pBufferStrides: Pointer;
    NumStrides: DWORD;
    RasterizedStream: DWORD;
  end;
const D3D12_STREAM_OUTPUT_DESC = extern struct {
    pSODeclaration: ?*anyopaque,
    NumEntries: u32,
    pBufferStrides: ?*anyopaque,
    NumStrides: u32,
    RasterizedStream: u32,
};
type
  D3D12_STREAM_OUTPUT_DESC {.bycopy.} = object
    pSODeclaration: pointer
    NumEntries: uint32
    pBufferStrides: pointer
    NumStrides: uint32
    RasterizedStream: uint32
struct D3D12_STREAM_OUTPUT_DESC
{
    void* pSODeclaration;
    uint NumEntries;
    void* pBufferStrides;
    uint NumStrides;
    uint RasterizedStream;
}

HSP用 定義

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

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

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