ホーム › 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 | 対象とするストリーム出力のインデックス。 |
| SemanticName | LPSTR | 8/4 | +8 | +4 | 出力する要素のセマンティクス名。 |
| SemanticIndex | DWORD | 4 | +16 | +8 | 同名セマンティクスを区別するインデックス。 |
| StartComponent | BYTE | 1 | +20 | +12 | 書き込む最初の成分(0=x)。 |
| ComponentCount | BYTE | 1 | +21 | +13 | 書き込む成分の数(1〜4)。 |
| OutputSlot | BYTE | 1 | +22 | +14 | 出力先の頂点バッファスロット(0〜3)。 |
各言語での定義
#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