ホーム › Graphics.Direct3D12 › D3D12_RENDER_PASS_RENDER_TARGET_DESC
D3D12_RENDER_PASS_RENDER_TARGET_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cpuDescriptor | D3D12_CPU_DESCRIPTOR_HANDLE | 8/4 | +0 | +0 | レンダーターゲットビューのCPUディスクリプタハンドル。 |
| BeginningAccess | D3D12_RENDER_PASS_BEGINNING_ACCESS | 24 | +8 | +4 | レンダーパス開始時のアクセス記述。 |
| EndingAccess | D3D12_RENDER_PASS_ENDING_ACCESS | 56/32 | +32 | +28 | レンダーパス終了時のアクセス記述。 |
各言語での定義
#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_RENDER_TARGET_DESC (x64 88 / x86 60 バイト)
typedef struct D3D12_RENDER_PASS_RENDER_TARGET_DESC {
D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor;
D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess;
D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess;
} D3D12_RENDER_PASS_RENDER_TARGET_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_RENDER_TARGET_DESC
{
public D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor;
public D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess;
public D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess;
}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_RENDER_TARGET_DESC
Public cpuDescriptor As D3D12_CPU_DESCRIPTOR_HANDLE
Public BeginningAccess As D3D12_RENDER_PASS_BEGINNING_ACCESS
Public EndingAccess 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_RENDER_TARGET_DESC(ctypes.Structure):
_fields_ = [
("cpuDescriptor", D3D12_CPU_DESCRIPTOR_HANDLE),
("BeginningAccess", D3D12_RENDER_PASS_BEGINNING_ACCESS),
("EndingAccess", 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_RENDER_TARGET_DESC {
pub cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE,
pub BeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS,
pub EndingAccess: 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_RENDER_TARGET_DESC struct {
cpuDescriptor D3D12_CPU_DESCRIPTOR_HANDLE
BeginningAccess D3D12_RENDER_PASS_BEGINNING_ACCESS
EndingAccess 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_RENDER_TARGET_DESC = record
cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE;
BeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS;
EndingAccess: 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_RENDER_TARGET_DESC = extern struct {
cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE,
BeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS,
EndingAccess: 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_RENDER_TARGET_DESC {.bycopy.} = object
cpuDescriptor: D3D12_CPU_DESCRIPTOR_HANDLE
BeginningAccess: D3D12_RENDER_PASS_BEGINNING_ACCESS
EndingAccess: 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_RENDER_TARGET_DESC
{
D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor;
D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess;
D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess;
}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_RENDER_TARGET_DESC サイズ: 60 バイト(x86)
dim st, 15 ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; cpuDescriptor : D3D12_CPU_DESCRIPTOR_HANDLE (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; BeginningAccess : D3D12_RENDER_PASS_BEGINNING_ACCESS (+4, 24byte) varptr(st)+4 を基点に操作(24byte:入れ子/配列)
; EndingAccess : D3D12_RENDER_PASS_ENDING_ACCESS (+28, 32byte) varptr(st)+28 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_RENDER_PASS_RENDER_TARGET_DESC サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; cpuDescriptor : D3D12_CPU_DESCRIPTOR_HANDLE (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; BeginningAccess : D3D12_RENDER_PASS_BEGINNING_ACCESS (+8, 24byte) varptr(st)+8 を基点に操作(24byte:入れ子/配列)
; EndingAccess : D3D12_RENDER_PASS_ENDING_ACCESS (+32, 56byte) varptr(st)+32 を基点に操作(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_RENDER_TARGET_DESC
#field D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor
#field D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess
#field D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess
#endstruct
stdim st, D3D12_RENDER_PASS_RENDER_TARGET_DESC ; NSTRUCT 変数を確保