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

D3D11_SIGNATURE_PARAMETER_DESC

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

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

フィールド

フィールドサイズx64x86説明
SemanticNameLPSTR8/4+0+0パラメータに付与されたセマンティクス名(例: POSITION)。
SemanticIndexDWORD4+8+4同名セマンティクスを区別するインデックス。
RegisterDWORD4+12+8パラメータが割り当てられた入出力レジスタ番号。
SystemValueTypeD3D_NAME4+16+12システム値の種類を示すD3D_NAME列挙値。
ComponentTypeD3D_REGISTER_COMPONENT_TYPE4+20+16レジスタ成分のデータ型を示すD3D_REGISTER_COMPONENT_TYPE列挙値。
MaskBYTE1+24+20パラメータが使用する成分(xyzw)を示すビットマスク。
ReadWriteMaskBYTE1+25+21実際に読み書きされる成分を示すビットマスク。
StreamDWORD4+28+24ジオメトリシェーダー出力で使用するストリームのインデックス。
MinPrecisionD3D_MIN_PRECISION4+32+28パラメータの最小精度を示すD3D_MIN_PRECISION列挙値。

各言語での定義

#include <windows.h>

// D3D11_SIGNATURE_PARAMETER_DESC  (x64 40 / x86 32 バイト)
typedef struct D3D11_SIGNATURE_PARAMETER_DESC {
    LPSTR SemanticName;
    DWORD SemanticIndex;
    DWORD Register;
    D3D_NAME SystemValueType;
    D3D_REGISTER_COMPONENT_TYPE ComponentType;
    BYTE Mask;
    BYTE ReadWriteMask;
    DWORD Stream;
    D3D_MIN_PRECISION MinPrecision;
} D3D11_SIGNATURE_PARAMETER_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_SIGNATURE_PARAMETER_DESC
{
    public IntPtr SemanticName;
    public uint SemanticIndex;
    public uint Register;
    public int SystemValueType;
    public int ComponentType;
    public byte Mask;
    public byte ReadWriteMask;
    public uint Stream;
    public int MinPrecision;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_SIGNATURE_PARAMETER_DESC
    Public SemanticName As IntPtr
    Public SemanticIndex As UInteger
    Public Register As UInteger
    Public SystemValueType As Integer
    Public ComponentType As Integer
    Public Mask As Byte
    Public ReadWriteMask As Byte
    Public Stream As UInteger
    Public MinPrecision As Integer
End Structure
import ctypes
from ctypes import wintypes

class D3D11_SIGNATURE_PARAMETER_DESC(ctypes.Structure):
    _fields_ = [
        ("SemanticName", ctypes.c_void_p),
        ("SemanticIndex", wintypes.DWORD),
        ("Register", wintypes.DWORD),
        ("SystemValueType", ctypes.c_int),
        ("ComponentType", ctypes.c_int),
        ("Mask", ctypes.c_ubyte),
        ("ReadWriteMask", ctypes.c_ubyte),
        ("Stream", wintypes.DWORD),
        ("MinPrecision", ctypes.c_int),
    ]
#[repr(C)]
pub struct D3D11_SIGNATURE_PARAMETER_DESC {
    pub SemanticName: *mut core::ffi::c_void,
    pub SemanticIndex: u32,
    pub Register: u32,
    pub SystemValueType: i32,
    pub ComponentType: i32,
    pub Mask: u8,
    pub ReadWriteMask: u8,
    pub Stream: u32,
    pub MinPrecision: i32,
}
import "golang.org/x/sys/windows"

type D3D11_SIGNATURE_PARAMETER_DESC struct {
	SemanticName uintptr
	SemanticIndex uint32
	Register uint32
	SystemValueType int32
	ComponentType int32
	Mask byte
	ReadWriteMask byte
	Stream uint32
	MinPrecision int32
}
type
  D3D11_SIGNATURE_PARAMETER_DESC = record
    SemanticName: Pointer;
    SemanticIndex: DWORD;
    Register: DWORD;
    SystemValueType: Integer;
    ComponentType: Integer;
    Mask: Byte;
    ReadWriteMask: Byte;
    Stream: DWORD;
    MinPrecision: Integer;
  end;
const D3D11_SIGNATURE_PARAMETER_DESC = extern struct {
    SemanticName: ?*anyopaque,
    SemanticIndex: u32,
    Register: u32,
    SystemValueType: i32,
    ComponentType: i32,
    Mask: u8,
    ReadWriteMask: u8,
    Stream: u32,
    MinPrecision: i32,
};
type
  D3D11_SIGNATURE_PARAMETER_DESC {.bycopy.} = object
    SemanticName: pointer
    SemanticIndex: uint32
    Register: uint32
    SystemValueType: int32
    ComponentType: int32
    Mask: uint8
    ReadWriteMask: uint8
    Stream: uint32
    MinPrecision: int32
struct D3D11_SIGNATURE_PARAMETER_DESC
{
    void* SemanticName;
    uint SemanticIndex;
    uint Register;
    int SystemValueType;
    int ComponentType;
    ubyte Mask;
    ubyte ReadWriteMask;
    uint Stream;
    int MinPrecision;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D11_SIGNATURE_PARAMETER_DESC サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; SemanticName : LPSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; SemanticIndex : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Register : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; SystemValueType : D3D_NAME (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ComponentType : D3D_REGISTER_COMPONENT_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Mask : BYTE (+20, 1byte)  poke st,20,値  /  値 = peek(st,20)
; ReadWriteMask : BYTE (+21, 1byte)  poke st,21,値  /  値 = peek(st,21)
; Stream : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; MinPrecision : D3D_MIN_PRECISION (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_SIGNATURE_PARAMETER_DESC サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 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 も可)
; Register : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; SystemValueType : D3D_NAME (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ComponentType : D3D_REGISTER_COMPONENT_TYPE (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Mask : BYTE (+24, 1byte)  poke st,24,値  /  値 = peek(st,24)
; ReadWriteMask : BYTE (+25, 1byte)  poke st,25,値  /  値 = peek(st,25)
; Stream : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; MinPrecision : D3D_MIN_PRECISION (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_SIGNATURE_PARAMETER_DESC
    #field intptr SemanticName
    #field int SemanticIndex
    #field int Register
    #field int SystemValueType
    #field int ComponentType
    #field byte Mask
    #field byte ReadWriteMask
    #field int Stream
    #field int MinPrecision
#endstruct

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