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

D3D10_SHADER_DEBUG_VAR_INFO

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

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

フィールド

フィールドサイズx64x86説明
TokenIdDWORD4+0+0この変数に対応するトークンのID。
TypeD3D_SHADER_VARIABLE_TYPE4+4+4変数のデータ型を示す列挙値。
RegisterDWORD4+8+8変数が割り当てられたレジスタ番号。
ComponentDWORD4+12+12変数が割り当てられたレジスタ内コンポーネント。
ScopeVarDWORD4+16+16この変数を含むスコープ変数のインデックス。
ScopeVarOffsetDWORD4+20+20スコープ変数内でのオフセット。

各言語での定義

#include <windows.h>

// D3D10_SHADER_DEBUG_VAR_INFO  (x64 24 / x86 24 バイト)
typedef struct D3D10_SHADER_DEBUG_VAR_INFO {
    DWORD TokenId;
    D3D_SHADER_VARIABLE_TYPE Type;
    DWORD Register;
    DWORD Component;
    DWORD ScopeVar;
    DWORD ScopeVarOffset;
} D3D10_SHADER_DEBUG_VAR_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D10_SHADER_DEBUG_VAR_INFO
{
    public uint TokenId;
    public int Type;
    public uint Register;
    public uint Component;
    public uint ScopeVar;
    public uint ScopeVarOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D10_SHADER_DEBUG_VAR_INFO
    Public TokenId As UInteger
    Public Type As Integer
    Public Register As UInteger
    Public Component As UInteger
    Public ScopeVar As UInteger
    Public ScopeVarOffset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class D3D10_SHADER_DEBUG_VAR_INFO(ctypes.Structure):
    _fields_ = [
        ("TokenId", wintypes.DWORD),
        ("Type", ctypes.c_int),
        ("Register", wintypes.DWORD),
        ("Component", wintypes.DWORD),
        ("ScopeVar", wintypes.DWORD),
        ("ScopeVarOffset", wintypes.DWORD),
    ]
#[repr(C)]
pub struct D3D10_SHADER_DEBUG_VAR_INFO {
    pub TokenId: u32,
    pub Type: i32,
    pub Register: u32,
    pub Component: u32,
    pub ScopeVar: u32,
    pub ScopeVarOffset: u32,
}
import "golang.org/x/sys/windows"

type D3D10_SHADER_DEBUG_VAR_INFO struct {
	TokenId uint32
	Type int32
	Register uint32
	Component uint32
	ScopeVar uint32
	ScopeVarOffset uint32
}
type
  D3D10_SHADER_DEBUG_VAR_INFO = record
    TokenId: DWORD;
    Type: Integer;
    Register: DWORD;
    Component: DWORD;
    ScopeVar: DWORD;
    ScopeVarOffset: DWORD;
  end;
const D3D10_SHADER_DEBUG_VAR_INFO = extern struct {
    TokenId: u32,
    Type: i32,
    Register: u32,
    Component: u32,
    ScopeVar: u32,
    ScopeVarOffset: u32,
};
type
  D3D10_SHADER_DEBUG_VAR_INFO {.bycopy.} = object
    TokenId: uint32
    Type: int32
    Register: uint32
    Component: uint32
    ScopeVar: uint32
    ScopeVarOffset: uint32
struct D3D10_SHADER_DEBUG_VAR_INFO
{
    uint TokenId;
    int Type;
    uint Register;
    uint Component;
    uint ScopeVar;
    uint ScopeVarOffset;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D10_SHADER_DEBUG_VAR_INFO サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; TokenId : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Type : D3D_SHADER_VARIABLE_TYPE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Register : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Component : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ScopeVar : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ScopeVarOffset : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D10_SHADER_DEBUG_VAR_INFO
    #field int TokenId
    #field int Type
    #field int Register
    #field int Component
    #field int ScopeVar
    #field int ScopeVarOffset
#endstruct

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