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

D3D10_SIGNATURE_PARAMETER_DESC

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

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

フィールド

フィールドサイズx64x86説明
SemanticNameLPSTR8/4+0+0パラメータのセマンティック名を示す文字列。
SemanticIndexDWORD4+8+4同名セマンティックを区別するゼロ起点のインデックス。
RegisterDWORD4+12+8パラメータが格納されるレジスタ番号。
SystemValueTypeD3D_NAME4+16+12システム値の種類(SV_Position等)を示す列挙値。
ComponentTypeD3D_REGISTER_COMPONENT_TYPE4+20+16レジスタコンポーネントのデータ型(float/int等)を示す列挙値。
MaskBYTE1+24+20パラメータが使用するコンポーネントを示すマスク(下位4ビット)。
ReadWriteMaskBYTE1+25+21実際に読み書きされたコンポーネントを示すマスク。

各言語での定義

#include <windows.h>

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

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

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D10_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
End Structure
import ctypes
from ctypes import wintypes

class D3D10_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),
    ]
#[repr(C)]
pub struct D3D10_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,
}
import "golang.org/x/sys/windows"

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

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D10_SIGNATURE_PARAMETER_DESC サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 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)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D10_SIGNATURE_PARAMETER_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 も可)
; 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)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D10_SIGNATURE_PARAMETER_DESC
    #field intptr SemanticName
    #field int SemanticIndex
    #field int Register
    #field int SystemValueType
    #field int ComponentType
    #field byte Mask
    #field byte ReadWriteMask
#endstruct

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