ホーム › Graphics.Direct3D12 › D3D12_SO_DECLARATION_ENTRY
D3D12_SO_DECLARATION_ENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Stream | DWORD | 4 | +0 | +0 | 0 から始まるストリーム番号です。 |
| SemanticName | LPSTR | 8/4 | +8 | +4 | 出力要素の種類です。指定できる値には "POSITION"、"NORMAL"、"TEXCOORD0" などがあります。 SemanticName が NULL の場合、 ComponentCount は 4 より大きい値を指定でき、記述されるエントリはストリーム出力内でデータが書き込まれない空き領域になります。 |
| SemanticIndex | DWORD | 4 | +16 | +8 | 出力要素の 0 から始まるインデックスです。たとえば、各頂点に複数のテクスチャー座標を格納している場合に使用します。 |
| StartComponent | BYTE | 1 | +20 | +12 | エントリの書き出しを開始するコンポーネントです。有効な値は 0 から 3 です。たとえば、位置の y および z コンポーネントのみを出力したい場合、 StartComponent は 1、ComponentCount は 2 になります。 |
| ComponentCount | BYTE | 1 | +21 | +13 | エントリのうち書き出すコンポーネントの数です。有効な値は 1 から 4 です。たとえば、位置の y および z コンポーネントのみを出力したい場合、 StartComponent は 1、ComponentCount は 2 になります。なお、SemanticName が NULL の場合、 ComponentCount は 4 より大きい値を指定でき、記述されるエントリはストリーム出力内でデータが書き込まれない空き領域になります。 |
| OutputSlot | BYTE | 1 | +22 | +14 | パイプラインにバインドされている、関連付けられたストリーム出力バッファーです。 OutputSlot の有効な範囲は 0 から 3 です。 |
公式ドキュメント
出力スロット内の頂点バッファーにおける頂点要素を記述します。
解説(Remarks)
D3D12_SO_DECLARATION_ENTRY 構造体の配列は、D3D12_STREAM_OUTPUT_DESC 構造体の pSODeclaration メンバーに指定します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// D3D12_SO_DECLARATION_ENTRY (x64 24 / x86 16 バイト)
typedef struct D3D12_SO_DECLARATION_ENTRY {
DWORD Stream;
LPSTR SemanticName;
DWORD SemanticIndex;
BYTE StartComponent;
BYTE ComponentCount;
BYTE OutputSlot;
} D3D12_SO_DECLARATION_ENTRY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_SO_DECLARATION_ENTRY
{
public uint Stream;
public IntPtr SemanticName;
public uint SemanticIndex;
public byte StartComponent;
public byte ComponentCount;
public byte OutputSlot;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_SO_DECLARATION_ENTRY
Public Stream As UInteger
Public SemanticName As IntPtr
Public SemanticIndex As UInteger
Public StartComponent As Byte
Public ComponentCount As Byte
Public OutputSlot As Byte
End Structureimport ctypes
from ctypes import wintypes
class D3D12_SO_DECLARATION_ENTRY(ctypes.Structure):
_fields_ = [
("Stream", wintypes.DWORD),
("SemanticName", ctypes.c_void_p),
("SemanticIndex", wintypes.DWORD),
("StartComponent", ctypes.c_ubyte),
("ComponentCount", ctypes.c_ubyte),
("OutputSlot", ctypes.c_ubyte),
]#[repr(C)]
pub struct D3D12_SO_DECLARATION_ENTRY {
pub Stream: u32,
pub SemanticName: *mut core::ffi::c_void,
pub SemanticIndex: u32,
pub StartComponent: u8,
pub ComponentCount: u8,
pub OutputSlot: u8,
}import "golang.org/x/sys/windows"
type D3D12_SO_DECLARATION_ENTRY struct {
Stream uint32
SemanticName uintptr
SemanticIndex uint32
StartComponent byte
ComponentCount byte
OutputSlot byte
}type
D3D12_SO_DECLARATION_ENTRY = record
Stream: DWORD;
SemanticName: Pointer;
SemanticIndex: DWORD;
StartComponent: Byte;
ComponentCount: Byte;
OutputSlot: Byte;
end;const D3D12_SO_DECLARATION_ENTRY = extern struct {
Stream: u32,
SemanticName: ?*anyopaque,
SemanticIndex: u32,
StartComponent: u8,
ComponentCount: u8,
OutputSlot: u8,
};type
D3D12_SO_DECLARATION_ENTRY {.bycopy.} = object
Stream: uint32
SemanticName: pointer
SemanticIndex: uint32
StartComponent: uint8
ComponentCount: uint8
OutputSlot: uint8struct D3D12_SO_DECLARATION_ENTRY
{
uint Stream;
void* SemanticName;
uint SemanticIndex;
ubyte StartComponent;
ubyte ComponentCount;
ubyte OutputSlot;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_SO_DECLARATION_ENTRY サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Stream : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; SemanticName : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; SemanticIndex : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; StartComponent : BYTE (+12, 1byte) poke st,12,値 / 値 = peek(st,12)
; ComponentCount : BYTE (+13, 1byte) poke st,13,値 / 値 = peek(st,13)
; OutputSlot : BYTE (+14, 1byte) poke st,14,値 / 値 = peek(st,14)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_SO_DECLARATION_ENTRY サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Stream : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; SemanticName : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SemanticIndex : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; StartComponent : BYTE (+20, 1byte) poke st,20,値 / 値 = peek(st,20)
; ComponentCount : BYTE (+21, 1byte) poke st,21,値 / 値 = peek(st,21)
; OutputSlot : BYTE (+22, 1byte) poke st,22,値 / 値 = peek(st,22)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_SO_DECLARATION_ENTRY
#field int Stream
#field intptr SemanticName
#field int SemanticIndex
#field byte StartComponent
#field byte ComponentCount
#field byte OutputSlot
#endstruct
stdim st, D3D12_SO_DECLARATION_ENTRY ; NSTRUCT 変数を確保
st->Stream = 100
mes "Stream=" + st->Stream