ホーム › Graphics.Direct3D.Fxc › D3DCreateFunctionLinkingGraph
D3DCreateFunctionLinkingGraph
関数関数リンキンググラフを生成する。
シグネチャ
// D3DCOMPILER_47.dll
#include <windows.h>
HRESULT D3DCreateFunctionLinkingGraph(
DWORD uFlags,
ID3D11FunctionLinkingGraph** ppFunctionLinkingGraph
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| uFlags | DWORD | in | 関数リンクグラフ生成用の予約フラグ。現在は0を指定する。 |
| ppFunctionLinkingGraph | ID3D11FunctionLinkingGraph** | out | 生成されたID3D11FunctionLinkingGraphを受け取る出力ポインター。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// D3DCOMPILER_47.dll
#include <windows.h>
HRESULT D3DCreateFunctionLinkingGraph(
DWORD uFlags,
ID3D11FunctionLinkingGraph** ppFunctionLinkingGraph
);[DllImport("D3DCOMPILER_47.dll", ExactSpelling = true)]
static extern int D3DCreateFunctionLinkingGraph(
uint uFlags, // DWORD
IntPtr ppFunctionLinkingGraph // ID3D11FunctionLinkingGraph** out
);<DllImport("D3DCOMPILER_47.dll", ExactSpelling:=True)>
Public Shared Function D3DCreateFunctionLinkingGraph(
uFlags As UInteger, ' DWORD
ppFunctionLinkingGraph As IntPtr ' ID3D11FunctionLinkingGraph** out
) As Integer
End Function' uFlags : DWORD
' ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out
Declare PtrSafe Function D3DCreateFunctionLinkingGraph Lib "d3dcompiler_47" ( _
ByVal uFlags As Long, _
ByVal ppFunctionLinkingGraph As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
D3DCreateFunctionLinkingGraph = ctypes.windll.d3dcompiler_47.D3DCreateFunctionLinkingGraph
D3DCreateFunctionLinkingGraph.restype = ctypes.c_int
D3DCreateFunctionLinkingGraph.argtypes = [
wintypes.DWORD, # uFlags : DWORD
ctypes.c_void_p, # ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('D3DCOMPILER_47.dll')
D3DCreateFunctionLinkingGraph = Fiddle::Function.new(
lib['D3DCreateFunctionLinkingGraph'],
[
-Fiddle::TYPE_INT, # uFlags : DWORD
Fiddle::TYPE_VOIDP, # ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out
],
Fiddle::TYPE_INT)#[link(name = "d3dcompiler_47")]
extern "system" {
fn D3DCreateFunctionLinkingGraph(
uFlags: u32, // DWORD
ppFunctionLinkingGraph: *mut *mut core::ffi::c_void // ID3D11FunctionLinkingGraph** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("D3DCOMPILER_47.dll")]
public static extern int D3DCreateFunctionLinkingGraph(uint uFlags, IntPtr ppFunctionLinkingGraph);
"@
$api = Add-Type -MemberDefinition $sig -Name 'D3DCOMPILER_47_D3DCreateFunctionLinkingGraph' -Namespace Win32 -PassThru
# $api::D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph)#uselib "D3DCOMPILER_47.dll"
#func global D3DCreateFunctionLinkingGraph "D3DCreateFunctionLinkingGraph" sptr, sptr
; D3DCreateFunctionLinkingGraph uFlags, ppFunctionLinkingGraph ; 戻り値は stat
; uFlags : DWORD -> "sptr"
; ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "D3DCOMPILER_47.dll"
#cfunc global D3DCreateFunctionLinkingGraph "D3DCreateFunctionLinkingGraph" int, sptr
; res = D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph)
; uFlags : DWORD -> "int"
; ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> "sptr"; HRESULT D3DCreateFunctionLinkingGraph(DWORD uFlags, ID3D11FunctionLinkingGraph** ppFunctionLinkingGraph)
#uselib "D3DCOMPILER_47.dll"
#cfunc global D3DCreateFunctionLinkingGraph "D3DCreateFunctionLinkingGraph" int, intptr
; res = D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph)
; uFlags : DWORD -> "int"
; ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
d3dcompiler_47 = windows.NewLazySystemDLL("D3DCOMPILER_47.dll")
procD3DCreateFunctionLinkingGraph = d3dcompiler_47.NewProc("D3DCreateFunctionLinkingGraph")
)
// uFlags (DWORD), ppFunctionLinkingGraph (ID3D11FunctionLinkingGraph** out)
r1, _, err := procD3DCreateFunctionLinkingGraph.Call(
uintptr(uFlags),
uintptr(ppFunctionLinkingGraph),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction D3DCreateFunctionLinkingGraph(
uFlags: DWORD; // DWORD
ppFunctionLinkingGraph: Pointer // ID3D11FunctionLinkingGraph** out
): Integer; stdcall;
external 'D3DCOMPILER_47.dll' name 'D3DCreateFunctionLinkingGraph';result := DllCall("D3DCOMPILER_47\D3DCreateFunctionLinkingGraph"
, "UInt", uFlags ; DWORD
, "Ptr", ppFunctionLinkingGraph ; ID3D11FunctionLinkingGraph** out
, "Int") ; return: HRESULT●D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph) = DLL("D3DCOMPILER_47.dll", "int D3DCreateFunctionLinkingGraph(dword, void*)")
# 呼び出し: D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph)
# uFlags : DWORD -> "dword"
# ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "d3dcompiler_47" fn D3DCreateFunctionLinkingGraph(
uFlags: u32, // DWORD
ppFunctionLinkingGraph: ?*anyopaque // ID3D11FunctionLinkingGraph** out
) callconv(std.os.windows.WINAPI) i32;proc D3DCreateFunctionLinkingGraph(
uFlags: uint32, # DWORD
ppFunctionLinkingGraph: pointer # ID3D11FunctionLinkingGraph** out
): int32 {.importc: "D3DCreateFunctionLinkingGraph", stdcall, dynlib: "D3DCOMPILER_47.dll".}pragma(lib, "d3dcompiler_47");
extern(Windows)
int D3DCreateFunctionLinkingGraph(
uint uFlags, // DWORD
void* ppFunctionLinkingGraph // ID3D11FunctionLinkingGraph** out
);ccall((:D3DCreateFunctionLinkingGraph, "D3DCOMPILER_47.dll"), stdcall, Int32,
(UInt32, Ptr{Cvoid}),
uFlags, ppFunctionLinkingGraph)
# uFlags : DWORD -> UInt32
# ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t D3DCreateFunctionLinkingGraph(
uint32_t uFlags,
void* ppFunctionLinkingGraph);
]]
local d3dcompiler_47 = ffi.load("d3dcompiler_47")
-- d3dcompiler_47.D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph)
-- uFlags : DWORD
-- ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('D3DCOMPILER_47.dll');
const D3DCreateFunctionLinkingGraph = lib.func('__stdcall', 'D3DCreateFunctionLinkingGraph', 'int32_t', ['uint32_t', 'void *']);
// D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph)
// uFlags : DWORD -> 'uint32_t'
// ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("D3DCOMPILER_47.dll", {
D3DCreateFunctionLinkingGraph: { parameters: ["u32", "pointer"], result: "i32" },
});
// lib.symbols.D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph)
// uFlags : DWORD -> "u32"
// ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t D3DCreateFunctionLinkingGraph(
uint32_t uFlags,
void* ppFunctionLinkingGraph);
C, "D3DCOMPILER_47.dll");
// $ffi->D3DCreateFunctionLinkingGraph(uFlags, ppFunctionLinkingGraph);
// uFlags : DWORD
// ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface D3dcompiler_47 extends StdCallLibrary {
D3dcompiler_47 INSTANCE = Native.load("d3dcompiler_47", D3dcompiler_47.class);
int D3DCreateFunctionLinkingGraph(
int uFlags, // DWORD
Pointer ppFunctionLinkingGraph // ID3D11FunctionLinkingGraph** out
);
}@[Link("d3dcompiler_47")]
lib LibD3DCOMPILER_47
fun D3DCreateFunctionLinkingGraph = D3DCreateFunctionLinkingGraph(
uFlags : UInt32, # DWORD
ppFunctionLinkingGraph : Void* # ID3D11FunctionLinkingGraph** out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef D3DCreateFunctionLinkingGraphNative = Int32 Function(Uint32, Pointer<Void>);
typedef D3DCreateFunctionLinkingGraphDart = int Function(int, Pointer<Void>);
final D3DCreateFunctionLinkingGraph = DynamicLibrary.open('D3DCOMPILER_47.dll')
.lookupFunction<D3DCreateFunctionLinkingGraphNative, D3DCreateFunctionLinkingGraphDart>('D3DCreateFunctionLinkingGraph');
// uFlags : DWORD -> Uint32
// ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function D3DCreateFunctionLinkingGraph(
uFlags: DWORD; // DWORD
ppFunctionLinkingGraph: Pointer // ID3D11FunctionLinkingGraph** out
): Integer; stdcall;
external 'D3DCOMPILER_47.dll' name 'D3DCreateFunctionLinkingGraph';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "D3DCreateFunctionLinkingGraph"
c_D3DCreateFunctionLinkingGraph :: Word32 -> Ptr () -> IO Int32
-- uFlags : DWORD -> Word32
-- ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let d3dcreatefunctionlinkinggraph =
foreign "D3DCreateFunctionLinkingGraph"
(uint32_t @-> (ptr void) @-> returning int32_t)
(* uFlags : DWORD -> uint32_t *)
(* ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library d3dcompiler_47 (t "D3DCOMPILER_47.dll"))
(cffi:use-foreign-library d3dcompiler_47)
(cffi:defcfun ("D3DCreateFunctionLinkingGraph" d3-dcreate-function-linking-graph :convention :stdcall) :int32
(u-flags :uint32) ; DWORD
(pp-function-linking-graph :pointer)) ; ID3D11FunctionLinkingGraph** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $D3DCreateFunctionLinkingGraph = Win32::API::More->new('D3DCOMPILER_47',
'int D3DCreateFunctionLinkingGraph(DWORD uFlags, LPVOID ppFunctionLinkingGraph)');
# my $ret = $D3DCreateFunctionLinkingGraph->Call($uFlags, $ppFunctionLinkingGraph);
# uFlags : DWORD -> DWORD
# ppFunctionLinkingGraph : ID3D11FunctionLinkingGraph** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。