ホーム › Graphics.Direct3D10 › D3D10_INPUT_ELEMENT_DESC
D3D10_INPUT_ELEMENT_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| SemanticName | LPSTR | 8/4 | +0 | +0 | シェーダー入力シグネチャ内でこの要素に関連付けられる HLSL セマンティクスです。 |
| SemanticIndex | DWORD | 4 | +8 | +4 | 要素のセマンティック インデックスです。セマンティック インデックスは、整数のインデックス番号によってセマンティクスを修飾します。セマンティック インデックスが必要になるのは、同じセマンティクスを持つ要素が複数存在する場合だけです。たとえば、4x4 行列は 4 つの成分を持ち、それぞれのセマンティック名は matrix ですが、4 つの成分はそれぞれ異なるセマンティック インデックス (0、1、2、3) を持ちます。 |
| Format | DXGI_FORMAT | 4 | +12 | +8 | 要素データのデータ型です。DXGI_FORMAT を参照してください。 |
| InputSlot | DWORD | 4 | +16 | +12 | 入力アセンブラーを識別する整数値です (入力スロットを参照してください)。有効な値は 0 から 15 で、D3D10.h で定義されています。 |
| AlignedByteOffset | DWORD | 4 | +20 | +16 | 省略可能です。各要素間のオフセット (バイト単位) です。D3D10_APPEND_ALIGNED_ELEMENT を使用すると、必要なパッキングも含めて、現在の要素を直前の要素の直後に配置するよう簡単に定義できます。 |
| InputSlotClass | D3D10_INPUT_CLASSIFICATION | 4 | +24 | +20 | 単一の入力スロットに対する入力データ クラスを識別します (D3D10_INPUT_CLASSIFICATION を参照してください)。 |
| InstanceDataStepRate | DWORD | 4 | +28 | +24 | インスタンス データが格納された頂点バッファー内で 1 単位進める前に描画するインスタンスの数です。スロット クラスが D3D10_INPUT_PER_INSTANCE_DATA の場合は任意の符号なし整数値を指定できます (0 は進めないことを意味します)。スロット クラスが D3D10_INPUT_PER_VERTEX_DATA の場合は 0 でなければなりません。 |
公式ドキュメント
入力アセンブラー ステージ用の単一要素の説明です。
解説(Remarks)
入力レイアウト オブジェクトは構造体の配列を保持し、各構造体は入力スロットから読み取られる 1 つの要素を定義します。入力レイアウト オブジェクトは ID3D10Device::CreateInputLayout を呼び出して作成します。例については、入力レイアウト オブジェクトの作成を参照してください。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// D3D10_INPUT_ELEMENT_DESC (x64 32 / x86 28 バイト)
typedef struct D3D10_INPUT_ELEMENT_DESC {
LPSTR SemanticName;
DWORD SemanticIndex;
DXGI_FORMAT Format;
DWORD InputSlot;
DWORD AlignedByteOffset;
D3D10_INPUT_CLASSIFICATION InputSlotClass;
DWORD InstanceDataStepRate;
} D3D10_INPUT_ELEMENT_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D10_INPUT_ELEMENT_DESC
{
public IntPtr SemanticName;
public uint SemanticIndex;
public int Format;
public uint InputSlot;
public uint AlignedByteOffset;
public int InputSlotClass;
public uint InstanceDataStepRate;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D10_INPUT_ELEMENT_DESC
Public SemanticName As IntPtr
Public SemanticIndex As UInteger
Public Format As Integer
Public InputSlot As UInteger
Public AlignedByteOffset As UInteger
Public InputSlotClass As Integer
Public InstanceDataStepRate As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3D10_INPUT_ELEMENT_DESC(ctypes.Structure):
_fields_ = [
("SemanticName", ctypes.c_void_p),
("SemanticIndex", wintypes.DWORD),
("Format", ctypes.c_int),
("InputSlot", wintypes.DWORD),
("AlignedByteOffset", wintypes.DWORD),
("InputSlotClass", ctypes.c_int),
("InstanceDataStepRate", wintypes.DWORD),
]#[repr(C)]
pub struct D3D10_INPUT_ELEMENT_DESC {
pub SemanticName: *mut core::ffi::c_void,
pub SemanticIndex: u32,
pub Format: i32,
pub InputSlot: u32,
pub AlignedByteOffset: u32,
pub InputSlotClass: i32,
pub InstanceDataStepRate: u32,
}import "golang.org/x/sys/windows"
type D3D10_INPUT_ELEMENT_DESC struct {
SemanticName uintptr
SemanticIndex uint32
Format int32
InputSlot uint32
AlignedByteOffset uint32
InputSlotClass int32
InstanceDataStepRate uint32
}type
D3D10_INPUT_ELEMENT_DESC = record
SemanticName: Pointer;
SemanticIndex: DWORD;
Format: Integer;
InputSlot: DWORD;
AlignedByteOffset: DWORD;
InputSlotClass: Integer;
InstanceDataStepRate: DWORD;
end;const D3D10_INPUT_ELEMENT_DESC = extern struct {
SemanticName: ?*anyopaque,
SemanticIndex: u32,
Format: i32,
InputSlot: u32,
AlignedByteOffset: u32,
InputSlotClass: i32,
InstanceDataStepRate: u32,
};type
D3D10_INPUT_ELEMENT_DESC {.bycopy.} = object
SemanticName: pointer
SemanticIndex: uint32
Format: int32
InputSlot: uint32
AlignedByteOffset: uint32
InputSlotClass: int32
InstanceDataStepRate: uint32struct D3D10_INPUT_ELEMENT_DESC
{
void* SemanticName;
uint SemanticIndex;
int Format;
uint InputSlot;
uint AlignedByteOffset;
int InputSlotClass;
uint InstanceDataStepRate;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D10_INPUT_ELEMENT_DESC サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; SemanticName : LPSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; SemanticIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Format : DXGI_FORMAT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; InputSlot : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; AlignedByteOffset : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; InputSlotClass : D3D10_INPUT_CLASSIFICATION (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; InstanceDataStepRate : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D10_INPUT_ELEMENT_DESC サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; SemanticName : LPSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; SemanticIndex : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Format : DXGI_FORMAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; InputSlot : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; AlignedByteOffset : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; InputSlotClass : D3D10_INPUT_CLASSIFICATION (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; InstanceDataStepRate : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D10_INPUT_ELEMENT_DESC
#field intptr SemanticName
#field int SemanticIndex
#field int Format
#field int InputSlot
#field int AlignedByteOffset
#field int InputSlotClass
#field int InstanceDataStepRate
#endstruct
stdim st, D3D10_INPUT_ELEMENT_DESC ; NSTRUCT 変数を確保
st->SemanticIndex = 100
mes "SemanticIndex=" + st->SemanticIndex