ホーム › Graphics.Direct3D10 › D3D10GetInputAndOutputSignatureBlob
D3D10GetInputAndOutputSignatureBlob
関数シェーダーバイトコードから入出力シグネチャブロブを取得する。
シグネチャ
// d3d10.dll
#include <windows.h>
HRESULT D3D10GetInputAndOutputSignatureBlob(
const void* pShaderBytecode,
UINT_PTR BytecodeLength,
ID3DBlob** ppSignatureBlob
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pShaderBytecode | void* | in |
| BytecodeLength | UINT_PTR | in |
| ppSignatureBlob | ID3DBlob** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// d3d10.dll
#include <windows.h>
HRESULT D3D10GetInputAndOutputSignatureBlob(
const void* pShaderBytecode,
UINT_PTR BytecodeLength,
ID3DBlob** ppSignatureBlob
);[DllImport("d3d10.dll", ExactSpelling = true)]
static extern int D3D10GetInputAndOutputSignatureBlob(
IntPtr pShaderBytecode, // void*
UIntPtr BytecodeLength, // UINT_PTR
IntPtr ppSignatureBlob // ID3DBlob** out
);<DllImport("d3d10.dll", ExactSpelling:=True)>
Public Shared Function D3D10GetInputAndOutputSignatureBlob(
pShaderBytecode As IntPtr, ' void*
BytecodeLength As UIntPtr, ' UINT_PTR
ppSignatureBlob As IntPtr ' ID3DBlob** out
) As Integer
End Function' pShaderBytecode : void*
' BytecodeLength : UINT_PTR
' ppSignatureBlob : ID3DBlob** out
Declare PtrSafe Function D3D10GetInputAndOutputSignatureBlob Lib "d3d10" ( _
ByVal pShaderBytecode As LongPtr, _
ByVal BytecodeLength As LongPtr, _
ByVal ppSignatureBlob As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
D3D10GetInputAndOutputSignatureBlob = ctypes.windll.d3d10.D3D10GetInputAndOutputSignatureBlob
D3D10GetInputAndOutputSignatureBlob.restype = ctypes.c_int
D3D10GetInputAndOutputSignatureBlob.argtypes = [
ctypes.POINTER(None), # pShaderBytecode : void*
ctypes.c_size_t, # BytecodeLength : UINT_PTR
ctypes.c_void_p, # ppSignatureBlob : ID3DBlob** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('d3d10.dll')
D3D10GetInputAndOutputSignatureBlob = Fiddle::Function.new(
lib['D3D10GetInputAndOutputSignatureBlob'],
[
Fiddle::TYPE_VOIDP, # pShaderBytecode : void*
Fiddle::TYPE_UINTPTR_T, # BytecodeLength : UINT_PTR
Fiddle::TYPE_VOIDP, # ppSignatureBlob : ID3DBlob** out
],
Fiddle::TYPE_INT)#[link(name = "d3d10")]
extern "system" {
fn D3D10GetInputAndOutputSignatureBlob(
pShaderBytecode: *const (), // void*
BytecodeLength: usize, // UINT_PTR
ppSignatureBlob: *mut *mut core::ffi::c_void // ID3DBlob** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("d3d10.dll")]
public static extern int D3D10GetInputAndOutputSignatureBlob(IntPtr pShaderBytecode, UIntPtr BytecodeLength, IntPtr ppSignatureBlob);
"@
$api = Add-Type -MemberDefinition $sig -Name 'd3d10_D3D10GetInputAndOutputSignatureBlob' -Namespace Win32 -PassThru
# $api::D3D10GetInputAndOutputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob)#uselib "d3d10.dll"
#func global D3D10GetInputAndOutputSignatureBlob "D3D10GetInputAndOutputSignatureBlob" sptr, sptr, sptr
; D3D10GetInputAndOutputSignatureBlob pShaderBytecode, BytecodeLength, ppSignatureBlob ; 戻り値は stat
; pShaderBytecode : void* -> "sptr"
; BytecodeLength : UINT_PTR -> "sptr"
; ppSignatureBlob : ID3DBlob** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "d3d10.dll"
#cfunc global D3D10GetInputAndOutputSignatureBlob "D3D10GetInputAndOutputSignatureBlob" sptr, sptr, sptr
; res = D3D10GetInputAndOutputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob)
; pShaderBytecode : void* -> "sptr"
; BytecodeLength : UINT_PTR -> "sptr"
; ppSignatureBlob : ID3DBlob** out -> "sptr"; HRESULT D3D10GetInputAndOutputSignatureBlob(void* pShaderBytecode, UINT_PTR BytecodeLength, ID3DBlob** ppSignatureBlob)
#uselib "d3d10.dll"
#cfunc global D3D10GetInputAndOutputSignatureBlob "D3D10GetInputAndOutputSignatureBlob" intptr, intptr, intptr
; res = D3D10GetInputAndOutputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob)
; pShaderBytecode : void* -> "intptr"
; BytecodeLength : UINT_PTR -> "intptr"
; ppSignatureBlob : ID3DBlob** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
d3d10 = windows.NewLazySystemDLL("d3d10.dll")
procD3D10GetInputAndOutputSignatureBlob = d3d10.NewProc("D3D10GetInputAndOutputSignatureBlob")
)
// pShaderBytecode (void*), BytecodeLength (UINT_PTR), ppSignatureBlob (ID3DBlob** out)
r1, _, err := procD3D10GetInputAndOutputSignatureBlob.Call(
uintptr(pShaderBytecode),
uintptr(BytecodeLength),
uintptr(ppSignatureBlob),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction D3D10GetInputAndOutputSignatureBlob(
pShaderBytecode: Pointer; // void*
BytecodeLength: NativeUInt; // UINT_PTR
ppSignatureBlob: Pointer // ID3DBlob** out
): Integer; stdcall;
external 'd3d10.dll' name 'D3D10GetInputAndOutputSignatureBlob';result := DllCall("d3d10\D3D10GetInputAndOutputSignatureBlob"
, "Ptr", pShaderBytecode ; void*
, "UPtr", BytecodeLength ; UINT_PTR
, "Ptr", ppSignatureBlob ; ID3DBlob** out
, "Int") ; return: HRESULT●D3D10GetInputAndOutputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob) = DLL("d3d10.dll", "int D3D10GetInputAndOutputSignatureBlob(void*, int, void*)")
# 呼び出し: D3D10GetInputAndOutputSignatureBlob(pShaderBytecode, BytecodeLength, ppSignatureBlob)
# pShaderBytecode : void* -> "void*"
# BytecodeLength : UINT_PTR -> "int"
# ppSignatureBlob : ID3DBlob** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。