ホーム › Graphics.Direct3D.Fxc › D3DGetTraceInstructionOffsets
D3DGetTraceInstructionOffsets
関数シェーダー命令のトレースオフセットを取得する。
シグネチャ
// D3DCOMPILER_47.dll
#include <windows.h>
HRESULT D3DGetTraceInstructionOffsets(
const void* pSrcData,
UINT_PTR SrcDataSize,
DWORD Flags,
UINT_PTR StartInstIndex,
UINT_PTR NumInsts,
UINT_PTR* pOffsets, // optional
UINT_PTR* pTotalInsts // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pSrcData | void* | in |
| SrcDataSize | UINT_PTR | in |
| Flags | DWORD | in |
| StartInstIndex | UINT_PTR | in |
| NumInsts | UINT_PTR | in |
| pOffsets | UINT_PTR* | outoptional |
| pTotalInsts | UINT_PTR* | outoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// D3DCOMPILER_47.dll
#include <windows.h>
HRESULT D3DGetTraceInstructionOffsets(
const void* pSrcData,
UINT_PTR SrcDataSize,
DWORD Flags,
UINT_PTR StartInstIndex,
UINT_PTR NumInsts,
UINT_PTR* pOffsets, // optional
UINT_PTR* pTotalInsts // optional
);[DllImport("D3DCOMPILER_47.dll", ExactSpelling = true)]
static extern int D3DGetTraceInstructionOffsets(
IntPtr pSrcData, // void*
UIntPtr SrcDataSize, // UINT_PTR
uint Flags, // DWORD
UIntPtr StartInstIndex, // UINT_PTR
UIntPtr NumInsts, // UINT_PTR
IntPtr pOffsets, // UINT_PTR* optional, out
IntPtr pTotalInsts // UINT_PTR* optional, out
);<DllImport("D3DCOMPILER_47.dll", ExactSpelling:=True)>
Public Shared Function D3DGetTraceInstructionOffsets(
pSrcData As IntPtr, ' void*
SrcDataSize As UIntPtr, ' UINT_PTR
Flags As UInteger, ' DWORD
StartInstIndex As UIntPtr, ' UINT_PTR
NumInsts As UIntPtr, ' UINT_PTR
pOffsets As IntPtr, ' UINT_PTR* optional, out
pTotalInsts As IntPtr ' UINT_PTR* optional, out
) As Integer
End Function' pSrcData : void*
' SrcDataSize : UINT_PTR
' Flags : DWORD
' StartInstIndex : UINT_PTR
' NumInsts : UINT_PTR
' pOffsets : UINT_PTR* optional, out
' pTotalInsts : UINT_PTR* optional, out
Declare PtrSafe Function D3DGetTraceInstructionOffsets Lib "d3dcompiler_47" ( _
ByVal pSrcData As LongPtr, _
ByVal SrcDataSize As LongPtr, _
ByVal Flags As Long, _
ByVal StartInstIndex As LongPtr, _
ByVal NumInsts As LongPtr, _
ByVal pOffsets As LongPtr, _
ByVal pTotalInsts As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
D3DGetTraceInstructionOffsets = ctypes.windll.d3dcompiler_47.D3DGetTraceInstructionOffsets
D3DGetTraceInstructionOffsets.restype = ctypes.c_int
D3DGetTraceInstructionOffsets.argtypes = [
ctypes.POINTER(None), # pSrcData : void*
ctypes.c_size_t, # SrcDataSize : UINT_PTR
wintypes.DWORD, # Flags : DWORD
ctypes.c_size_t, # StartInstIndex : UINT_PTR
ctypes.c_size_t, # NumInsts : UINT_PTR
ctypes.POINTER(ctypes.c_size_t), # pOffsets : UINT_PTR* optional, out
ctypes.POINTER(ctypes.c_size_t), # pTotalInsts : UINT_PTR* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('D3DCOMPILER_47.dll')
D3DGetTraceInstructionOffsets = Fiddle::Function.new(
lib['D3DGetTraceInstructionOffsets'],
[
Fiddle::TYPE_VOIDP, # pSrcData : void*
Fiddle::TYPE_UINTPTR_T, # SrcDataSize : UINT_PTR
-Fiddle::TYPE_INT, # Flags : DWORD
Fiddle::TYPE_UINTPTR_T, # StartInstIndex : UINT_PTR
Fiddle::TYPE_UINTPTR_T, # NumInsts : UINT_PTR
Fiddle::TYPE_VOIDP, # pOffsets : UINT_PTR* optional, out
Fiddle::TYPE_VOIDP, # pTotalInsts : UINT_PTR* optional, out
],
Fiddle::TYPE_INT)#[link(name = "d3dcompiler_47")]
extern "system" {
fn D3DGetTraceInstructionOffsets(
pSrcData: *const (), // void*
SrcDataSize: usize, // UINT_PTR
Flags: u32, // DWORD
StartInstIndex: usize, // UINT_PTR
NumInsts: usize, // UINT_PTR
pOffsets: *mut usize, // UINT_PTR* optional, out
pTotalInsts: *mut usize // UINT_PTR* optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("D3DCOMPILER_47.dll")]
public static extern int D3DGetTraceInstructionOffsets(IntPtr pSrcData, UIntPtr SrcDataSize, uint Flags, UIntPtr StartInstIndex, UIntPtr NumInsts, IntPtr pOffsets, IntPtr pTotalInsts);
"@
$api = Add-Type -MemberDefinition $sig -Name 'D3DCOMPILER_47_D3DGetTraceInstructionOffsets' -Namespace Win32 -PassThru
# $api::D3DGetTraceInstructionOffsets(pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, pOffsets, pTotalInsts)#uselib "D3DCOMPILER_47.dll"
#func global D3DGetTraceInstructionOffsets "D3DGetTraceInstructionOffsets" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; D3DGetTraceInstructionOffsets pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, varptr(pOffsets), varptr(pTotalInsts) ; 戻り値は stat
; pSrcData : void* -> "sptr"
; SrcDataSize : UINT_PTR -> "sptr"
; Flags : DWORD -> "sptr"
; StartInstIndex : UINT_PTR -> "sptr"
; NumInsts : UINT_PTR -> "sptr"
; pOffsets : UINT_PTR* optional, out -> "sptr"
; pTotalInsts : UINT_PTR* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "D3DCOMPILER_47.dll" #cfunc global D3DGetTraceInstructionOffsets "D3DGetTraceInstructionOffsets" sptr, sptr, int, sptr, sptr, var, var ; res = D3DGetTraceInstructionOffsets(pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, pOffsets, pTotalInsts) ; pSrcData : void* -> "sptr" ; SrcDataSize : UINT_PTR -> "sptr" ; Flags : DWORD -> "int" ; StartInstIndex : UINT_PTR -> "sptr" ; NumInsts : UINT_PTR -> "sptr" ; pOffsets : UINT_PTR* optional, out -> "var" ; pTotalInsts : UINT_PTR* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "D3DCOMPILER_47.dll" #cfunc global D3DGetTraceInstructionOffsets "D3DGetTraceInstructionOffsets" sptr, sptr, int, sptr, sptr, sptr, sptr ; res = D3DGetTraceInstructionOffsets(pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, varptr(pOffsets), varptr(pTotalInsts)) ; pSrcData : void* -> "sptr" ; SrcDataSize : UINT_PTR -> "sptr" ; Flags : DWORD -> "int" ; StartInstIndex : UINT_PTR -> "sptr" ; NumInsts : UINT_PTR -> "sptr" ; pOffsets : UINT_PTR* optional, out -> "sptr" ; pTotalInsts : UINT_PTR* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT D3DGetTraceInstructionOffsets(void* pSrcData, UINT_PTR SrcDataSize, DWORD Flags, UINT_PTR StartInstIndex, UINT_PTR NumInsts, UINT_PTR* pOffsets, UINT_PTR* pTotalInsts) #uselib "D3DCOMPILER_47.dll" #cfunc global D3DGetTraceInstructionOffsets "D3DGetTraceInstructionOffsets" intptr, intptr, int, intptr, intptr, var, var ; res = D3DGetTraceInstructionOffsets(pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, pOffsets, pTotalInsts) ; pSrcData : void* -> "intptr" ; SrcDataSize : UINT_PTR -> "intptr" ; Flags : DWORD -> "int" ; StartInstIndex : UINT_PTR -> "intptr" ; NumInsts : UINT_PTR -> "intptr" ; pOffsets : UINT_PTR* optional, out -> "var" ; pTotalInsts : UINT_PTR* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT D3DGetTraceInstructionOffsets(void* pSrcData, UINT_PTR SrcDataSize, DWORD Flags, UINT_PTR StartInstIndex, UINT_PTR NumInsts, UINT_PTR* pOffsets, UINT_PTR* pTotalInsts) #uselib "D3DCOMPILER_47.dll" #cfunc global D3DGetTraceInstructionOffsets "D3DGetTraceInstructionOffsets" intptr, intptr, int, intptr, intptr, intptr, intptr ; res = D3DGetTraceInstructionOffsets(pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, varptr(pOffsets), varptr(pTotalInsts)) ; pSrcData : void* -> "intptr" ; SrcDataSize : UINT_PTR -> "intptr" ; Flags : DWORD -> "int" ; StartInstIndex : UINT_PTR -> "intptr" ; NumInsts : UINT_PTR -> "intptr" ; pOffsets : UINT_PTR* optional, out -> "intptr" ; pTotalInsts : UINT_PTR* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
d3dcompiler_47 = windows.NewLazySystemDLL("D3DCOMPILER_47.dll")
procD3DGetTraceInstructionOffsets = d3dcompiler_47.NewProc("D3DGetTraceInstructionOffsets")
)
// pSrcData (void*), SrcDataSize (UINT_PTR), Flags (DWORD), StartInstIndex (UINT_PTR), NumInsts (UINT_PTR), pOffsets (UINT_PTR* optional, out), pTotalInsts (UINT_PTR* optional, out)
r1, _, err := procD3DGetTraceInstructionOffsets.Call(
uintptr(pSrcData),
uintptr(SrcDataSize),
uintptr(Flags),
uintptr(StartInstIndex),
uintptr(NumInsts),
uintptr(pOffsets),
uintptr(pTotalInsts),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction D3DGetTraceInstructionOffsets(
pSrcData: Pointer; // void*
SrcDataSize: NativeUInt; // UINT_PTR
Flags: DWORD; // DWORD
StartInstIndex: NativeUInt; // UINT_PTR
NumInsts: NativeUInt; // UINT_PTR
pOffsets: Pointer; // UINT_PTR* optional, out
pTotalInsts: Pointer // UINT_PTR* optional, out
): Integer; stdcall;
external 'D3DCOMPILER_47.dll' name 'D3DGetTraceInstructionOffsets';result := DllCall("D3DCOMPILER_47\D3DGetTraceInstructionOffsets"
, "Ptr", pSrcData ; void*
, "UPtr", SrcDataSize ; UINT_PTR
, "UInt", Flags ; DWORD
, "UPtr", StartInstIndex ; UINT_PTR
, "UPtr", NumInsts ; UINT_PTR
, "Ptr", pOffsets ; UINT_PTR* optional, out
, "Ptr", pTotalInsts ; UINT_PTR* optional, out
, "Int") ; return: HRESULT●D3DGetTraceInstructionOffsets(pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, pOffsets, pTotalInsts) = DLL("D3DCOMPILER_47.dll", "int D3DGetTraceInstructionOffsets(void*, int, dword, int, int, void*, void*)")
# 呼び出し: D3DGetTraceInstructionOffsets(pSrcData, SrcDataSize, Flags, StartInstIndex, NumInsts, pOffsets, pTotalInsts)
# pSrcData : void* -> "void*"
# SrcDataSize : UINT_PTR -> "int"
# Flags : DWORD -> "dword"
# StartInstIndex : UINT_PTR -> "int"
# NumInsts : UINT_PTR -> "int"
# pOffsets : UINT_PTR* optional, out -> "void*"
# pTotalInsts : UINT_PTR* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。