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

D3D11_PIXEL_SHADER_TRACE_DESC

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

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

フィールド

フィールドサイズx64x86説明
InvocationULONGLONG8+0+0トレース対象とするピクセルシェーダー呼び出し。
XINT4+8+8トレース対象ピクセルのX座標。
YINT4+12+12トレース対象ピクセルのY座標。
SampleMaskULONGLONG8+16+16トレース対象とするサンプルを示すサンプルマスク。

各言語での定義

#include <windows.h>

// D3D11_PIXEL_SHADER_TRACE_DESC  (x64 24 / x86 24 バイト)
typedef struct D3D11_PIXEL_SHADER_TRACE_DESC {
    ULONGLONG Invocation;
    INT X;
    INT Y;
    ULONGLONG SampleMask;
} D3D11_PIXEL_SHADER_TRACE_DESC;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_PIXEL_SHADER_TRACE_DESC
{
    public ulong Invocation;
    public int X;
    public int Y;
    public ulong SampleMask;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_PIXEL_SHADER_TRACE_DESC
    Public Invocation As ULong
    Public X As Integer
    Public Y As Integer
    Public SampleMask As ULong
End Structure
import ctypes
from ctypes import wintypes

class D3D11_PIXEL_SHADER_TRACE_DESC(ctypes.Structure):
    _fields_ = [
        ("Invocation", ctypes.c_ulonglong),
        ("X", ctypes.c_int),
        ("Y", ctypes.c_int),
        ("SampleMask", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct D3D11_PIXEL_SHADER_TRACE_DESC {
    pub Invocation: u64,
    pub X: i32,
    pub Y: i32,
    pub SampleMask: u64,
}
import "golang.org/x/sys/windows"

type D3D11_PIXEL_SHADER_TRACE_DESC struct {
	Invocation uint64
	X int32
	Y int32
	SampleMask uint64
}
type
  D3D11_PIXEL_SHADER_TRACE_DESC = record
    Invocation: UInt64;
    X: Integer;
    Y: Integer;
    SampleMask: UInt64;
  end;
const D3D11_PIXEL_SHADER_TRACE_DESC = extern struct {
    Invocation: u64,
    X: i32,
    Y: i32,
    SampleMask: u64,
};
type
  D3D11_PIXEL_SHADER_TRACE_DESC {.bycopy.} = object
    Invocation: uint64
    X: int32
    Y: int32
    SampleMask: uint64
struct D3D11_PIXEL_SHADER_TRACE_DESC
{
    ulong Invocation;
    int X;
    int Y;
    ulong SampleMask;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_PIXEL_SHADER_TRACE_DESC サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Invocation : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; X : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Y : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; SampleMask : 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_PIXEL_SHADER_TRACE_DESC
    #field int64 Invocation
    #field int X
    #field int Y
    #field int64 SampleMask
#endstruct

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