ホーム › Graphics.Direct3D12 › D3D12_HEAP_PROPERTIES
D3D12_HEAP_PROPERTIES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Type | D3D12_HEAP_TYPE | 4 | +0 | +0 | ヒープの種別。既定・アップロード・リードバック・カスタムを指定する。 |
| CPUPageProperty | D3D12_CPU_PAGE_PROPERTY | 4 | +4 | +4 | CPUページプロパティ。カスタムヒープ時のみ意味を持つ。 |
| MemoryPoolPreference | D3D12_MEMORY_POOL | 4 | +8 | +8 | メモリプールの優先指定。カスタムヒープ時のみ意味を持つ。 |
| CreationNodeMask | DWORD | 4 | +12 | +12 | ヒープを作成するGPUノードのビットマスク。単一GPUでは0または1。 |
| VisibleNodeMask | DWORD | 4 | +16 | +16 | ヒープが可視となるGPUノードのビットマスク。 |
各言語での定義
#include <windows.h>
// D3D12_HEAP_PROPERTIES (x64 20 / x86 20 バイト)
typedef struct D3D12_HEAP_PROPERTIES {
D3D12_HEAP_TYPE Type;
D3D12_CPU_PAGE_PROPERTY CPUPageProperty;
D3D12_MEMORY_POOL MemoryPoolPreference;
DWORD CreationNodeMask;
DWORD VisibleNodeMask;
} D3D12_HEAP_PROPERTIES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_HEAP_PROPERTIES
{
public int Type;
public int CPUPageProperty;
public int MemoryPoolPreference;
public uint CreationNodeMask;
public uint VisibleNodeMask;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_HEAP_PROPERTIES
Public Type As Integer
Public CPUPageProperty As Integer
Public MemoryPoolPreference As Integer
Public CreationNodeMask As UInteger
Public VisibleNodeMask As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3D12_HEAP_PROPERTIES(ctypes.Structure):
_fields_ = [
("Type", ctypes.c_int),
("CPUPageProperty", ctypes.c_int),
("MemoryPoolPreference", ctypes.c_int),
("CreationNodeMask", wintypes.DWORD),
("VisibleNodeMask", wintypes.DWORD),
]#[repr(C)]
pub struct D3D12_HEAP_PROPERTIES {
pub Type: i32,
pub CPUPageProperty: i32,
pub MemoryPoolPreference: i32,
pub CreationNodeMask: u32,
pub VisibleNodeMask: u32,
}import "golang.org/x/sys/windows"
type D3D12_HEAP_PROPERTIES struct {
Type int32
CPUPageProperty int32
MemoryPoolPreference int32
CreationNodeMask uint32
VisibleNodeMask uint32
}type
D3D12_HEAP_PROPERTIES = record
Type: Integer;
CPUPageProperty: Integer;
MemoryPoolPreference: Integer;
CreationNodeMask: DWORD;
VisibleNodeMask: DWORD;
end;const D3D12_HEAP_PROPERTIES = extern struct {
Type: i32,
CPUPageProperty: i32,
MemoryPoolPreference: i32,
CreationNodeMask: u32,
VisibleNodeMask: u32,
};type
D3D12_HEAP_PROPERTIES {.bycopy.} = object
Type: int32
CPUPageProperty: int32
MemoryPoolPreference: int32
CreationNodeMask: uint32
VisibleNodeMask: uint32struct D3D12_HEAP_PROPERTIES
{
int Type;
int CPUPageProperty;
int MemoryPoolPreference;
uint CreationNodeMask;
uint VisibleNodeMask;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_HEAP_PROPERTIES サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Type : D3D12_HEAP_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; CPUPageProperty : D3D12_CPU_PAGE_PROPERTY (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; MemoryPoolPreference : D3D12_MEMORY_POOL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; CreationNodeMask : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; VisibleNodeMask : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_HEAP_PROPERTIES
#field int Type
#field int CPUPageProperty
#field int MemoryPoolPreference
#field int CreationNodeMask
#field int VisibleNodeMask
#endstruct
stdim st, D3D12_HEAP_PROPERTIES ; NSTRUCT 変数を確保
st->Type = 100
mes "Type=" + st->Type