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

D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO

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

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

フィールド

フィールドサイズx64x86説明
FormatDXGI_FORMAT4+0+0問い合わせるリソースのDXGIフォーマット。入力値。
DimensionD3D12_RESOURCE_DIMENSION4+4+4問い合わせるリソースの次元。入力値。
DestHeapPropertiesD3D12_HEAP_PROPERTIES20+8+8配置先ヒープのプロパティ。入力値。
SupportedBOOL4+28+28指定条件で配置リソースがサポートされるか。出力値。

各言語での定義

#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;

// D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO  (x64 32 / x86 32 バイト)
typedef struct D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO {
    DXGI_FORMAT Format;
    D3D12_RESOURCE_DIMENSION Dimension;
    D3D12_HEAP_PROPERTIES DestHeapProperties;
    BOOL Supported;
} D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO;
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;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO
{
    public int Format;
    public int Dimension;
    public D3D12_HEAP_PROPERTIES DestHeapProperties;
    [MarshalAs(UnmanagedType.Bool)] public bool Supported;
}
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 Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO
    Public Format As Integer
    Public Dimension As Integer
    Public DestHeapProperties As D3D12_HEAP_PROPERTIES
    <MarshalAs(UnmanagedType.Bool)> Public Supported As Boolean
End Structure
import 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),
    ]

class D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO(ctypes.Structure):
    _fields_ = [
        ("Format", ctypes.c_int),
        ("Dimension", ctypes.c_int),
        ("DestHeapProperties", D3D12_HEAP_PROPERTIES),
        ("Supported", wintypes.BOOL),
    ]
#[repr(C)]
pub struct D3D12_HEAP_PROPERTIES {
    pub Type: i32,
    pub CPUPageProperty: i32,
    pub MemoryPoolPreference: i32,
    pub CreationNodeMask: u32,
    pub VisibleNodeMask: u32,
}

#[repr(C)]
pub struct D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO {
    pub Format: i32,
    pub Dimension: i32,
    pub DestHeapProperties: D3D12_HEAP_PROPERTIES,
    pub Supported: i32,
}
import "golang.org/x/sys/windows"

type D3D12_HEAP_PROPERTIES struct {
	Type int32
	CPUPageProperty int32
	MemoryPoolPreference int32
	CreationNodeMask uint32
	VisibleNodeMask uint32
}

type D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO struct {
	Format int32
	Dimension int32
	DestHeapProperties D3D12_HEAP_PROPERTIES
	Supported int32
}
type
  D3D12_HEAP_PROPERTIES = record
    Type: Integer;
    CPUPageProperty: Integer;
    MemoryPoolPreference: Integer;
    CreationNodeMask: DWORD;
    VisibleNodeMask: DWORD;
  end;

  D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO = record
    Format: Integer;
    Dimension: Integer;
    DestHeapProperties: D3D12_HEAP_PROPERTIES;
    Supported: BOOL;
  end;
const D3D12_HEAP_PROPERTIES = extern struct {
    Type: i32,
    CPUPageProperty: i32,
    MemoryPoolPreference: i32,
    CreationNodeMask: u32,
    VisibleNodeMask: u32,
};

const D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO = extern struct {
    Format: i32,
    Dimension: i32,
    DestHeapProperties: D3D12_HEAP_PROPERTIES,
    Supported: i32,
};
type
  D3D12_HEAP_PROPERTIES {.bycopy.} = object
    Type: int32
    CPUPageProperty: int32
    MemoryPoolPreference: int32
    CreationNodeMask: uint32
    VisibleNodeMask: uint32

  D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO {.bycopy.} = object
    Format: int32
    Dimension: int32
    DestHeapProperties: D3D12_HEAP_PROPERTIES
    Supported: int32
struct D3D12_HEAP_PROPERTIES
{
    int Type;
    int CPUPageProperty;
    int MemoryPoolPreference;
    uint CreationNodeMask;
    uint VisibleNodeMask;
}

struct D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO
{
    int Format;
    int Dimension;
    D3D12_HEAP_PROPERTIES DestHeapProperties;
    int Supported;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Format : DXGI_FORMAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Dimension : D3D12_RESOURCE_DIMENSION (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; DestHeapProperties : D3D12_HEAP_PROPERTIES (+8, 20byte)  varptr(st)+8 を基点に操作(20byte:入れ子/配列)
; Supported : BOOL (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D3D12_HEAP_PROPERTIES
    #field int Type
    #field int CPUPageProperty
    #field int MemoryPoolPreference
    #field int CreationNodeMask
    #field int VisibleNodeMask
#endstruct

#defstruct global D3D12_FEATURE_DATA_PLACED_RESOURCE_SUPPORT_INFO
    #field int Format
    #field int Dimension
    #field D3D12_HEAP_PROPERTIES DestHeapProperties
    #field bool Supported
#endstruct

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