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

D3D10_SHADER_INPUT_BIND_DESC

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

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

フィールド

フィールドサイズx64x86説明
NameLPSTR8/4+0+0バインドされたリソースの名前を示す文字列。
TypeD3D_SHADER_INPUT_TYPE4+8+4バインドされたリソースの種類を示す列挙値。
BindPointDWORD4+12+8リソースが割り当てられた開始バインドスロット番号。
BindCountDWORD4+16+12リソースが占有するスロット数(配列の場合)。
uFlagsDWORD4+20+16リソースバインドのプロパティを示すフラグ。
ReturnTypeD3D_RESOURCE_RETURN_TYPE4+24+20リソースからの戻り値データ型を示す列挙値。
DimensionD3D_SRV_DIMENSION4+28+24リソースの次元(ビューディメンション)を示す列挙値。
NumSamplesDWORD4+32+28マルチサンプルリソースのサンプル数。

各言語での定義

#include <windows.h>

// D3D10_SHADER_INPUT_BIND_DESC  (x64 40 / x86 32 バイト)
typedef struct D3D10_SHADER_INPUT_BIND_DESC {
    LPSTR Name;
    D3D_SHADER_INPUT_TYPE Type;
    DWORD BindPoint;
    DWORD BindCount;
    DWORD uFlags;
    D3D_RESOURCE_RETURN_TYPE ReturnType;
    D3D_SRV_DIMENSION Dimension;
    DWORD NumSamples;
} D3D10_SHADER_INPUT_BIND_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D10_SHADER_INPUT_BIND_DESC
{
    public IntPtr Name;
    public int Type;
    public uint BindPoint;
    public uint BindCount;
    public uint uFlags;
    public int ReturnType;
    public int Dimension;
    public uint NumSamples;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D10_SHADER_INPUT_BIND_DESC
    Public Name As IntPtr
    Public Type As Integer
    Public BindPoint As UInteger
    Public BindCount As UInteger
    Public uFlags As UInteger
    Public ReturnType As Integer
    Public Dimension As Integer
    Public NumSamples As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D10_SHADER_INPUT_BIND_DESC(ctypes.Structure):
    _fields_ = [
        ("Name", ctypes.c_void_p),
        ("Type", ctypes.c_int),
        ("BindPoint", wintypes.DWORD),
        ("BindCount", wintypes.DWORD),
        ("uFlags", wintypes.DWORD),
        ("ReturnType", ctypes.c_int),
        ("Dimension", ctypes.c_int),
        ("NumSamples", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D10_SHADER_INPUT_BIND_DESC {
    pub Name: *mut core::ffi::c_void,
    pub Type: i32,
    pub BindPoint: u32,
    pub BindCount: u32,
    pub uFlags: u32,
    pub ReturnType: i32,
    pub Dimension: i32,
    pub NumSamples: u32,
}
import "golang.org/x/sys/windows"

type D3D10_SHADER_INPUT_BIND_DESC struct {
	Name uintptr
	Type int32
	BindPoint uint32
	BindCount uint32
	uFlags uint32
	ReturnType int32
	Dimension int32
	NumSamples uint32
}
type
  D3D10_SHADER_INPUT_BIND_DESC = record
    Name: Pointer;
    Type: Integer;
    BindPoint: DWORD;
    BindCount: DWORD;
    uFlags: DWORD;
    ReturnType: Integer;
    Dimension: Integer;
    NumSamples: DWORD;
  end;
const D3D10_SHADER_INPUT_BIND_DESC = extern struct {
    Name: ?*anyopaque,
    Type: i32,
    BindPoint: u32,
    BindCount: u32,
    uFlags: u32,
    ReturnType: i32,
    Dimension: i32,
    NumSamples: u32,
};
type
  D3D10_SHADER_INPUT_BIND_DESC {.bycopy.} = object
    Name: pointer
    Type: int32
    BindPoint: uint32
    BindCount: uint32
    uFlags: uint32
    ReturnType: int32
    Dimension: int32
    NumSamples: uint32
struct D3D10_SHADER_INPUT_BIND_DESC
{
    void* Name;
    int Type;
    uint BindPoint;
    uint BindCount;
    uint uFlags;
    int ReturnType;
    int Dimension;
    uint NumSamples;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D10_SHADER_INPUT_BIND_DESC サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Name : LPSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Type : D3D_SHADER_INPUT_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; BindPoint : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; BindCount : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; uFlags : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ReturnType : D3D_RESOURCE_RETURN_TYPE (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Dimension : D3D_SRV_DIMENSION (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; NumSamples : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D10_SHADER_INPUT_BIND_DESC サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Name : LPSTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Type : D3D_SHADER_INPUT_TYPE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; BindPoint : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; BindCount : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; uFlags : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ReturnType : D3D_RESOURCE_RETURN_TYPE (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Dimension : D3D_SRV_DIMENSION (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; NumSamples : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D10_SHADER_INPUT_BIND_DESC
    #field intptr Name
    #field int Type
    #field int BindPoint
    #field int BindCount
    #field int uFlags
    #field int ReturnType
    #field int Dimension
    #field int NumSamples
#endstruct

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