ホーム › Graphics.Direct3D12 › D3D12_RENDER_PASS_DEPTH_STENCIL_DESC
D3D12_RENDER_PASS_DEPTH_STENCIL_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cpuDescriptor | D3D12_CPU_DESCRIPTOR_HANDLE | 8/4 | +0 | +0 | 深度ステンシルビューのCPUディスクリプタハンドル。 |
| DepthBeginningAccess | D3D12_RENDER_PASS_BEGINNING_ACCESS | 24 | +8 | +4 | 深度の開始時アクセス記述。 |
| StencilBeginningAccess | D3D12_RENDER_PASS_BEGINNING_ACCESS | 24 | +32 | +28 | ステンシルの開始時アクセス記述。 |
| DepthEndingAccess | D3D12_RENDER_PASS_ENDING_ACCESS | 56/32 | +56 | +52 | 深度の終了時アクセス記述。 |
| StencilEndingAccess | D3D12_RENDER_PASS_ENDING_ACCESS | 56/32 | +112 | +84 | ステンシルの終了時アクセス記述。 |
各言語での定義
#include <windows.h>
// D3D12_CPU_DESCRIPTOR_HANDLE (x64 8 / x86 4 バイト)
typedef struct D3D12_CPU_DESCRIPTOR_HANDLE {
UINT_PTR ptr;
} D3D12_CPU_DESCRIPTOR_HANDLE;
// D3D12_RENDER_PASS_BEGINNING_ACCESS (x64 24 / x86 24 バイト)
typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS {
D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type;
_Anonymous_e__Union Anonymous;
} D3D12_RENDER_PASS_BEGINNING_ACCESS;
// D3D12_RENDER_PASS_ENDING_ACCESS (x64 56 / x86 32 バイト)
typedef struct D3D12_RENDER_PASS_ENDING_ACCESS {
D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type;
_Anonymous_e__Union Anonymous;
} D3D12_RENDER_PASS_ENDING_ACCESS;
// D3D12_RENDER_PASS_DEPTH_STENCIL_DESC (x64 168 / x86 116 バイト)
typedef struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC {
D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor;
D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess;
D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess;
D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess;
D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess;
} D3D12_RENDER_PASS_DEPTH_STENCIL_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_CPU_DESCRIPTOR_HANDLE
{
public UIntPtr ptr;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RENDER_PASS_BEGINNING_ACCESS
{
public int Type;
public _Anonymous_e__Union Anonymous;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RENDER_PASS_ENDING_ACCESS
{
public int Type;
public _Anonymous_e__Union Anonymous;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC
{
public D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor;
public D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess;
public D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess;
public D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess;
public D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_CPU_DESCRIPTOR_HANDLE
Public ptr As UIntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RENDER_PASS_BEGINNING_ACCESS
Public Type As Integer
Public Anonymous As _Anonymous_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RENDER_PASS_ENDING_ACCESS
Public Type As Integer
Public Anonymous As _Anonymous_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RENDER_PASS_DEPTH_STENCIL_DESC
Public cpuDescriptor As D3D12_CPU_DESCRIPTOR_HANDLE
Public DepthBeginningAccess As D3D12_RENDER_PASS_BEGINNING_ACCESS
Public StencilBeginningAccess As D3D12_RENDER_PASS_BEGINNING_ACCESS
Public DepthEndingAccess As D3D12_RENDER_PASS_ENDING_ACCESS
Public StencilEndingAccess As D3D12_RENDER_PASS_ENDING_ACCESS
End Structureimport ctypes
from ctypes import wintypes
class D3D12_CPU_DESCRIPTOR_HANDLE(ctypes.Structure):
_fields_ = [
("ptr", ctypes.c_size_t),
]
class D3D12_RENDER_PASS_BEGINNING_ACCESS(ctypes.Structure):
_fields_ = [
("Type", ctypes.c_int),
("Anonymous", _Anonymous_e__Union),
]
class D3D12_RENDER_PASS_ENDING_ACCESS(ctypes.Structure):
_fields_ = [
("Type", ctypes.c_int),
("Anonymous", _Anonymous_e__Union),
]
class D3D12_RENDER_PASS_DEPTH_STENCIL_DESC(ctypes.Structure):
_fields_ = [
("cpuDescriptor", D3D12_CPU_DESCRIPTOR_HANDLE),
("DepthBeginningAccess", D3D12_RENDER_PASS_BEGINNING_ACCESS),
("StencilBeginningAccess", D3D12_RENDER_PASS_BEGINNING_ACCESS),
("DepthEndingAccess", D3D12_RENDER_PASS_ENDING_ACCESS),
("StencilEndingAccess", D3D12_RENDER_PASS_ENDING_ACCESS),
]#[repr(C)]
pub struct D3D12_CPU_DESCRIPTOR_HANDLE {
pub ptr: usize,
}
#[repr(C)]
pub struct D3D12_RENDER_PASS_BEGINNING_ACCESS {
pub Type: i32,
pub Anonymous: _Anonymous_e__Union,
}
#[repr(C)]
pub struct D3D12_RENDER_PASS_ENDING_ACCESS {
pub Type: i32,
pub Anonymous: _Anonymous_e__Union,
}
#[repr(C)]
pub struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC {
pub cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE,
pub DepthBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS,
pub StencilBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS,
pub DepthEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESS,
pub StencilEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESS,
}import "golang.org/x/sys/windows"
type D3D12_CPU_DESCRIPTOR_HANDLE struct {
ptr uintptr
}
type D3D12_RENDER_PASS_BEGINNING_ACCESS struct {
Type int32
Anonymous _Anonymous_e__Union
}
type D3D12_RENDER_PASS_ENDING_ACCESS struct {
Type int32
Anonymous _Anonymous_e__Union
}
type D3D12_RENDER_PASS_DEPTH_STENCIL_DESC struct {
cpuDescriptor D3D12_CPU_DESCRIPTOR_HANDLE
DepthBeginningAccess D3D12_RENDER_PASS_BEGINNING_ACCESS
StencilBeginningAccess D3D12_RENDER_PASS_BEGINNING_ACCESS
DepthEndingAccess D3D12_RENDER_PASS_ENDING_ACCESS
StencilEndingAccess D3D12_RENDER_PASS_ENDING_ACCESS
}type
D3D12_CPU_DESCRIPTOR_HANDLE = record
ptr: NativeUInt;
end;
D3D12_RENDER_PASS_BEGINNING_ACCESS = record
Type: Integer;
Anonymous: _Anonymous_e__Union;
end;
D3D12_RENDER_PASS_ENDING_ACCESS = record
Type: Integer;
Anonymous: _Anonymous_e__Union;
end;
D3D12_RENDER_PASS_DEPTH_STENCIL_DESC = record
cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE;
DepthBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS;
StencilBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS;
DepthEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESS;
StencilEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESS;
end;const D3D12_CPU_DESCRIPTOR_HANDLE = extern struct {
ptr: usize,
};
const D3D12_RENDER_PASS_BEGINNING_ACCESS = extern struct {
Type: i32,
Anonymous: _Anonymous_e__Union,
};
const D3D12_RENDER_PASS_ENDING_ACCESS = extern struct {
Type: i32,
Anonymous: _Anonymous_e__Union,
};
const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC = extern struct {
cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE,
DepthBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS,
StencilBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS,
DepthEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESS,
StencilEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESS,
};type
D3D12_CPU_DESCRIPTOR_HANDLE {.bycopy.} = object
ptr: uint
D3D12_RENDER_PASS_BEGINNING_ACCESS {.bycopy.} = object
Type: int32
Anonymous: _Anonymous_e__Union
D3D12_RENDER_PASS_ENDING_ACCESS {.bycopy.} = object
Type: int32
Anonymous: _Anonymous_e__Union
D3D12_RENDER_PASS_DEPTH_STENCIL_DESC {.bycopy.} = object
cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE
DepthBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS
StencilBeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS
DepthEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESS
StencilEndingAccess: D3D12_RENDER_PASS_ENDING_ACCESSstruct D3D12_CPU_DESCRIPTOR_HANDLE
{
size_t ptr;
}
struct D3D12_RENDER_PASS_BEGINNING_ACCESS
{
int Type;
_Anonymous_e__Union Anonymous;
}
struct D3D12_RENDER_PASS_ENDING_ACCESS
{
int Type;
_Anonymous_e__Union Anonymous;
}
struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC
{
D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor;
D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess;
D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess;
D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess;
D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; D3D12_RENDER_PASS_DEPTH_STENCIL_DESC サイズ: 116 バイト(x86)
dim st, 29 ; 4byte整数×29(構造体サイズ 116 / 4 切り上げ)
; cpuDescriptor : D3D12_CPU_DESCRIPTOR_HANDLE (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; DepthBeginningAccess : D3D12_RENDER_PASS_BEGINNING_ACCESS (+4, 24byte) varptr(st)+4 を基点に操作(24byte:入れ子/配列)
; StencilBeginningAccess : D3D12_RENDER_PASS_BEGINNING_ACCESS (+28, 24byte) varptr(st)+28 を基点に操作(24byte:入れ子/配列)
; DepthEndingAccess : D3D12_RENDER_PASS_ENDING_ACCESS (+52, 32byte) varptr(st)+52 を基点に操作(32byte:入れ子/配列)
; StencilEndingAccess : D3D12_RENDER_PASS_ENDING_ACCESS (+84, 32byte) varptr(st)+84 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_RENDER_PASS_DEPTH_STENCIL_DESC サイズ: 168 バイト(x64)
dim st, 42 ; 4byte整数×42(構造体サイズ 168 / 4 切り上げ)
; cpuDescriptor : D3D12_CPU_DESCRIPTOR_HANDLE (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; DepthBeginningAccess : D3D12_RENDER_PASS_BEGINNING_ACCESS (+8, 24byte) varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; StencilBeginningAccess : D3D12_RENDER_PASS_BEGINNING_ACCESS (+32, 24byte) varptr(st)+32 を基点に操作(24byte:入れ子/配列)
; DepthEndingAccess : D3D12_RENDER_PASS_ENDING_ACCESS (+56, 56byte) varptr(st)+56 を基点に操作(56byte:入れ子/配列)
; StencilEndingAccess : D3D12_RENDER_PASS_ENDING_ACCESS (+112, 56byte) varptr(st)+112 を基点に操作(56byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_CPU_DESCRIPTOR_HANDLE
#field intptr ptr
#endstruct
#defstruct global D3D12_RENDER_PASS_BEGINNING_ACCESS
#field int Type
#field byte Anonymous 20
#endstruct
#defstruct global D3D12_RENDER_PASS_ENDING_ACCESS
#field int Type
#field byte Anonymous 48
#endstruct
#defstruct global D3D12_RENDER_PASS_DEPTH_STENCIL_DESC
#field D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor
#field D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess
#field D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess
#field D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess
#field D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess
#endstruct
stdim st, D3D12_RENDER_PASS_DEPTH_STENCIL_DESC ; NSTRUCT 変数を確保