ホーム › Graphics.Direct3D11 › D3D11_SHADER_INPUT_BIND_DESC
D3D11_SHADER_INPUT_BIND_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Name | LPSTR | 8/4 | +0 | +0 | シェーダーリソースの名前です。 |
| Type | D3D_SHADER_INPUT_TYPE | 4 | +8 | +4 | リソース内のデータの種類を示す D3D_SHADER_INPUT_TYPE 型の値です。 |
| BindPoint | DWORD | 4 | +12 | +8 | 開始バインドポイントです。 |
| BindCount | DWORD | 4 | +16 | +12 | 配列に対する連続したバインドポイントの数です。 |
| uFlags | DWORD | 4 | +20 | +16 | シェーダーの入力パラメーターのオプションを表す D3D_SHADER_INPUT_FLAGS 型の値の組み合わせです。 |
| ReturnType | D3D_RESOURCE_RETURN_TYPE | 4 | +24 | +20 | 入力がテクスチャの場合、戻り値の型を示す D3D_RESOURCE_RETURN_TYPE 型の値です。 |
| Dimension | D3D_SRV_DIMENSION | 4 | +28 | +24 | バインドされたリソースの次元を示す D3D_SRV_DIMENSION 型の値です。 |
| NumSamples | DWORD | 4 | +32 | +28 | マルチサンプリングされたテクスチャのサンプル数です。テクスチャがマルチサンプリングされていない場合、値は -1 (0xFFFFFFFF) に設定されます。 |
公式ドキュメント
シェーダーリソースがシェーダー入力にどのようにバインドされるかを記述します。
解説(Remarks)
シェーダー入力シグネチャの記述を取得するには、ID3D11ShaderReflection::GetResourceBindingDesc または ID3D11ShaderReflection::GetResourceBindingDescByName を呼び出します。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// D3D11_SHADER_INPUT_BIND_DESC (x64 40 / x86 32 バイト)
typedef struct D3D11_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;
} D3D11_SHADER_INPUT_BIND_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_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 D3D11_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 Structureimport ctypes
from ctypes import wintypes
class D3D11_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 D3D11_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 D3D11_SHADER_INPUT_BIND_DESC struct {
Name uintptr
Type int32
BindPoint uint32
BindCount uint32
uFlags uint32
ReturnType int32
Dimension int32
NumSamples uint32
}type
D3D11_SHADER_INPUT_BIND_DESC = record
Name: Pointer;
Type: Integer;
BindPoint: DWORD;
BindCount: DWORD;
uFlags: DWORD;
ReturnType: Integer;
Dimension: Integer;
NumSamples: DWORD;
end;const D3D11_SHADER_INPUT_BIND_DESC = extern struct {
Name: ?*anyopaque,
Type: i32,
BindPoint: u32,
BindCount: u32,
uFlags: u32,
ReturnType: i32,
Dimension: i32,
NumSamples: u32,
};type
D3D11_SHADER_INPUT_BIND_DESC {.bycopy.} = object
Name: pointer
Type: int32
BindPoint: uint32
BindCount: uint32
uFlags: uint32
ReturnType: int32
Dimension: int32
NumSamples: uint32struct D3D11_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 レイアウト)
; D3D11_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 レイアウト)
; D3D11_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 D3D11_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, D3D11_SHADER_INPUT_BIND_DESC ; NSTRUCT 変数を確保
st->Type = 100
mes "Type=" + st->Type