ホーム › Graphics.Direct3D12 › D3D12_STREAM_OUTPUT_DESC
D3D12_STREAM_OUTPUT_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| pSODeclaration | D3D12_SO_DECLARATION_ENTRY* | 8/4 | +0 | +0 | ストリーム出力宣言エントリ配列へのポインタ。出力する要素を定義する。 |
| NumEntries | DWORD | 4 | +8 | +4 | pSODeclaration配列の要素数。 |
| pBufferStrides | DWORD* | 8/4 | +16 | +8 | 各出力バッファのバイトストライド配列へのポインタ。 |
| NumStrides | DWORD | 4 | +24 | +12 | pBufferStrides配列の要素数。出力バッファ数を示す。 |
| RasterizedStream | DWORD | 4 | +28 | +16 | ラスタライズに送るストリーム番号。D3D12_SO_NO_RASTERIZED_STREAMで無効化する。 |
各言語での定義
#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 Structureimport 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: uint32struct 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