Win32 API 日本語リファレンス
ホームMedia.MediaFoundation › D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT

D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT

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

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

フィールド

フィールドサイズx64x86説明
pMotionVectorTexture2DID3D12Resource*8/4+0+0解決後の動きベクトルを書き込むテクスチャ(ID3D12Resource)へのポインタ。
MotionVectorCoordinateD3D12_RESOURCE_COORDINATE24+8+8出力テクスチャ内の書き込み位置を示すD3D12_RESOURCE_COORDINATE。

各言語での定義

#include <windows.h>

// D3D12_RESOURCE_COORDINATE  (x64 24 / x86 24 バイト)
typedef struct D3D12_RESOURCE_COORDINATE {
    ULONGLONG X;
    DWORD Y;
    DWORD Z;
    DWORD SubresourceIndex;
} D3D12_RESOURCE_COORDINATE;

// D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT  (x64 32 / x86 32 バイト)
typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT {
    ID3D12Resource* pMotionVectorTexture2D;
    D3D12_RESOURCE_COORDINATE MotionVectorCoordinate;
} D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RESOURCE_COORDINATE
{
    public ulong X;
    public uint Y;
    public uint Z;
    public uint SubresourceIndex;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT
{
    public IntPtr pMotionVectorTexture2D;
    public D3D12_RESOURCE_COORDINATE MotionVectorCoordinate;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RESOURCE_COORDINATE
    Public X As ULong
    Public Y As UInteger
    Public Z As UInteger
    Public SubresourceIndex As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT
    Public pMotionVectorTexture2D As IntPtr
    Public MotionVectorCoordinate As D3D12_RESOURCE_COORDINATE
End Structure
import ctypes
from ctypes import wintypes

class D3D12_RESOURCE_COORDINATE(ctypes.Structure):
    _fields_ = [
        ("X", ctypes.c_ulonglong),
        ("Y", wintypes.DWORD),
        ("Z", wintypes.DWORD),
        ("SubresourceIndex", wintypes.DWORD),
    ]

class D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT(ctypes.Structure):
    _fields_ = [
        ("pMotionVectorTexture2D", ctypes.c_void_p),
        ("MotionVectorCoordinate", D3D12_RESOURCE_COORDINATE),
    ]
#[repr(C)]
pub struct D3D12_RESOURCE_COORDINATE {
    pub X: u64,
    pub Y: u32,
    pub Z: u32,
    pub SubresourceIndex: u32,
}

#[repr(C)]
pub struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT {
    pub pMotionVectorTexture2D: *mut core::ffi::c_void,
    pub MotionVectorCoordinate: D3D12_RESOURCE_COORDINATE,
}
import "golang.org/x/sys/windows"

type D3D12_RESOURCE_COORDINATE struct {
	X uint64
	Y uint32
	Z uint32
	SubresourceIndex uint32
}

type D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT struct {
	pMotionVectorTexture2D uintptr
	MotionVectorCoordinate D3D12_RESOURCE_COORDINATE
}
type
  D3D12_RESOURCE_COORDINATE = record
    X: UInt64;
    Y: DWORD;
    Z: DWORD;
    SubresourceIndex: DWORD;
  end;

  D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT = record
    pMotionVectorTexture2D: Pointer;
    MotionVectorCoordinate: D3D12_RESOURCE_COORDINATE;
  end;
const D3D12_RESOURCE_COORDINATE = extern struct {
    X: u64,
    Y: u32,
    Z: u32,
    SubresourceIndex: u32,
};

const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT = extern struct {
    pMotionVectorTexture2D: ?*anyopaque,
    MotionVectorCoordinate: D3D12_RESOURCE_COORDINATE,
};
type
  D3D12_RESOURCE_COORDINATE {.bycopy.} = object
    X: uint64
    Y: uint32
    Z: uint32
    SubresourceIndex: uint32

  D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT {.bycopy.} = object
    pMotionVectorTexture2D: pointer
    MotionVectorCoordinate: D3D12_RESOURCE_COORDINATE
struct D3D12_RESOURCE_COORDINATE
{
    ulong X;
    uint Y;
    uint Z;
    uint SubresourceIndex;
}

struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT
{
    void* pMotionVectorTexture2D;
    D3D12_RESOURCE_COORDINATE MotionVectorCoordinate;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT サイズ: 32 バイト(x86)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; pMotionVectorTexture2D : ID3D12Resource* (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MotionVectorCoordinate : D3D12_RESOURCE_COORDINATE (+8, 24byte)  varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; pMotionVectorTexture2D : ID3D12Resource* (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; MotionVectorCoordinate : D3D12_RESOURCE_COORDINATE (+8, 24byte)  varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_RESOURCE_COORDINATE
    #field int64 X
    #field int Y
    #field int Z
    #field int SubresourceIndex
#endstruct

#defstruct global D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT
    #field intptr pMotionVectorTexture2D
    #field D3D12_RESOURCE_COORDINATE MotionVectorCoordinate
#endstruct

stdim st, D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT        ; NSTRUCT 変数を確保