Win32 API 日本語リファレンス
ホームGraphics.Direct3D11 › D3D11_TRACE_STEP

D3D11_TRACE_STEP

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

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

フィールド

フィールドサイズx64x86説明
IDDWORD4+0+0トレースステップを識別する番号(命令インデックス)。
InstructionActiveBOOL4+4+4このステップで命令が実行されたか。TRUEで実行。
NumRegistersWrittenBYTE1+8+8このステップで書き込まれたレジスタの数。
NumRegistersReadBYTE1+9+9このステップで読み込まれたレジスタの数。
MiscOperationsWORD2+10+10その他の操作を示すビットフラグ。
OpcodeTypeDWORD4+12+12実行された命令のオペコード種別。
CurrentGlobalCycleULONGLONG8+16+16このステップ実行時のグローバルサイクルカウント。

各言語での定義

#include <windows.h>

// D3D11_TRACE_STEP  (x64 24 / x86 24 バイト)
typedef struct D3D11_TRACE_STEP {
    DWORD ID;
    BOOL InstructionActive;
    BYTE NumRegistersWritten;
    BYTE NumRegistersRead;
    WORD MiscOperations;
    DWORD OpcodeType;
    ULONGLONG CurrentGlobalCycle;
} D3D11_TRACE_STEP;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_TRACE_STEP
{
    public uint ID;
    [MarshalAs(UnmanagedType.Bool)] public bool InstructionActive;
    public byte NumRegistersWritten;
    public byte NumRegistersRead;
    public ushort MiscOperations;
    public uint OpcodeType;
    public ulong CurrentGlobalCycle;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_TRACE_STEP
    Public ID As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public InstructionActive As Boolean
    Public NumRegistersWritten As Byte
    Public NumRegistersRead As Byte
    Public MiscOperations As UShort
    Public OpcodeType As UInteger
    Public CurrentGlobalCycle As ULong
End Structure
import ctypes
from ctypes import wintypes

class D3D11_TRACE_STEP(ctypes.Structure):
    _fields_ = [
        ("ID", wintypes.DWORD),
        ("InstructionActive", wintypes.BOOL),
        ("NumRegistersWritten", ctypes.c_ubyte),
        ("NumRegistersRead", ctypes.c_ubyte),
        ("MiscOperations", ctypes.c_ushort),
        ("OpcodeType", wintypes.DWORD),
        ("CurrentGlobalCycle", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct D3D11_TRACE_STEP {
    pub ID: u32,
    pub InstructionActive: i32,
    pub NumRegistersWritten: u8,
    pub NumRegistersRead: u8,
    pub MiscOperations: u16,
    pub OpcodeType: u32,
    pub CurrentGlobalCycle: u64,
}
import "golang.org/x/sys/windows"

type D3D11_TRACE_STEP struct {
	ID uint32
	InstructionActive int32
	NumRegistersWritten byte
	NumRegistersRead byte
	MiscOperations uint16
	OpcodeType uint32
	CurrentGlobalCycle uint64
}
type
  D3D11_TRACE_STEP = record
    ID: DWORD;
    InstructionActive: BOOL;
    NumRegistersWritten: Byte;
    NumRegistersRead: Byte;
    MiscOperations: Word;
    OpcodeType: DWORD;
    CurrentGlobalCycle: UInt64;
  end;
const D3D11_TRACE_STEP = extern struct {
    ID: u32,
    InstructionActive: i32,
    NumRegistersWritten: u8,
    NumRegistersRead: u8,
    MiscOperations: u16,
    OpcodeType: u32,
    CurrentGlobalCycle: u64,
};
type
  D3D11_TRACE_STEP {.bycopy.} = object
    ID: uint32
    InstructionActive: int32
    NumRegistersWritten: uint8
    NumRegistersRead: uint8
    MiscOperations: uint16
    OpcodeType: uint32
    CurrentGlobalCycle: uint64
struct D3D11_TRACE_STEP
{
    uint ID;
    int InstructionActive;
    ubyte NumRegistersWritten;
    ubyte NumRegistersRead;
    ushort MiscOperations;
    uint OpcodeType;
    ulong CurrentGlobalCycle;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_TRACE_STEP サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; ID : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; InstructionActive : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; NumRegistersWritten : BYTE (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; NumRegistersRead : BYTE (+9, 1byte)  poke st,9,値  /  値 = peek(st,9)
; MiscOperations : WORD (+10, 2byte)  wpoke st,10,値  /  値 = wpeek(st,10)
; OpcodeType : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; CurrentGlobalCycle : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_TRACE_STEP
    #field int ID
    #field bool InstructionActive
    #field byte NumRegistersWritten
    #field byte NumRegistersRead
    #field short MiscOperations
    #field int OpcodeType
    #field int64 CurrentGlobalCycle
#endstruct

stdim st, D3D11_TRACE_STEP        ; NSTRUCT 変数を確保
st->ID = 100
mes "ID=" + st->ID