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

D3D12_FEATURE_DATA_D3D12_OPTIONS

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

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

フィールド

フィールドサイズx64x86説明
DoublePrecisionFloatShaderOpsBOOL4+0+0倍精度浮動小数点シェーダー演算に対応するか。
OutputMergerLogicOpBOOL4+4+4出力マージャ段の論理演算に対応するか。
MinPrecisionSupportD3D12_SHADER_MIN_PRECISION_SUPPORT4+8+8シェーダーの最小精度(10/16bit)サポート状況。
TiledResourcesTierD3D12_TILED_RESOURCES_TIER4+12+12タイルドリソースのサポート階層。
ResourceBindingTierD3D12_RESOURCE_BINDING_TIER4+16+16リソースバインディングのサポート階層。
PSSpecifiedStencilRefSupportedBOOL4+20+20ピクセルシェーダーからのステンシル参照値指定に対応するか。
TypedUAVLoadAdditionalFormatsBOOL4+24+24追加フォーマットの型付きUAVロードに対応するか。
ROVsSupportedBOOL4+28+28ラスタライザオーダードビュー(ROV)に対応するか。
ConservativeRasterizationTierD3D12_CONSERVATIVE_RASTERIZATION_TIER4+32+32コンサバティブラスタライゼーションのサポート階層。
MaxGPUVirtualAddressBitsPerResourceDWORD4+36+361リソースあたりのGPU仮想アドレスの最大ビット数。
StandardSwizzle64KBSupportedBOOL4+40+4064KB標準スウィズルテクスチャレイアウトに対応するか。
CrossNodeSharingTierD3D12_CROSS_NODE_SHARING_TIER4+44+44ノード間共有のサポート階層。
CrossAdapterRowMajorTextureSupportedBOOL4+48+48アダプタ間の行優先テクスチャ共有に対応するか。
VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulationBOOL4+52+52GS無しで任意シェーダーからのVP/RT配列インデックス出力に対応するか。
ResourceHeapTierD3D12_RESOURCE_HEAP_TIER4+56+56リソースヒープのサポート階層。

各言語での定義

#include <windows.h>

// D3D12_FEATURE_DATA_D3D12_OPTIONS  (x64 60 / x86 60 バイト)
typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS {
    BOOL DoublePrecisionFloatShaderOps;
    BOOL OutputMergerLogicOp;
    D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport;
    D3D12_TILED_RESOURCES_TIER TiledResourcesTier;
    D3D12_RESOURCE_BINDING_TIER ResourceBindingTier;
    BOOL PSSpecifiedStencilRefSupported;
    BOOL TypedUAVLoadAdditionalFormats;
    BOOL ROVsSupported;
    D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier;
    DWORD MaxGPUVirtualAddressBitsPerResource;
    BOOL StandardSwizzle64KBSupported;
    D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier;
    BOOL CrossAdapterRowMajorTextureSupported;
    BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation;
    D3D12_RESOURCE_HEAP_TIER ResourceHeapTier;
} D3D12_FEATURE_DATA_D3D12_OPTIONS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_FEATURE_DATA_D3D12_OPTIONS
{
    [MarshalAs(UnmanagedType.Bool)] public bool DoublePrecisionFloatShaderOps;
    [MarshalAs(UnmanagedType.Bool)] public bool OutputMergerLogicOp;
    public int MinPrecisionSupport;
    public int TiledResourcesTier;
    public int ResourceBindingTier;
    [MarshalAs(UnmanagedType.Bool)] public bool PSSpecifiedStencilRefSupported;
    [MarshalAs(UnmanagedType.Bool)] public bool TypedUAVLoadAdditionalFormats;
    [MarshalAs(UnmanagedType.Bool)] public bool ROVsSupported;
    public int ConservativeRasterizationTier;
    public uint MaxGPUVirtualAddressBitsPerResource;
    [MarshalAs(UnmanagedType.Bool)] public bool StandardSwizzle64KBSupported;
    public int CrossNodeSharingTier;
    [MarshalAs(UnmanagedType.Bool)] public bool CrossAdapterRowMajorTextureSupported;
    [MarshalAs(UnmanagedType.Bool)] public bool VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation;
    public int ResourceHeapTier;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_FEATURE_DATA_D3D12_OPTIONS
    <MarshalAs(UnmanagedType.Bool)> Public DoublePrecisionFloatShaderOps As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public OutputMergerLogicOp As Boolean
    Public MinPrecisionSupport As Integer
    Public TiledResourcesTier As Integer
    Public ResourceBindingTier As Integer
    <MarshalAs(UnmanagedType.Bool)> Public PSSpecifiedStencilRefSupported As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public TypedUAVLoadAdditionalFormats As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public ROVsSupported As Boolean
    Public ConservativeRasterizationTier As Integer
    Public MaxGPUVirtualAddressBitsPerResource As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public StandardSwizzle64KBSupported As Boolean
    Public CrossNodeSharingTier As Integer
    <MarshalAs(UnmanagedType.Bool)> Public CrossAdapterRowMajorTextureSupported As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation As Boolean
    Public ResourceHeapTier As Integer
End Structure
import ctypes
from ctypes import wintypes

class D3D12_FEATURE_DATA_D3D12_OPTIONS(ctypes.Structure):
    _fields_ = [
        ("DoublePrecisionFloatShaderOps", wintypes.BOOL),
        ("OutputMergerLogicOp", wintypes.BOOL),
        ("MinPrecisionSupport", ctypes.c_int),
        ("TiledResourcesTier", ctypes.c_int),
        ("ResourceBindingTier", ctypes.c_int),
        ("PSSpecifiedStencilRefSupported", wintypes.BOOL),
        ("TypedUAVLoadAdditionalFormats", wintypes.BOOL),
        ("ROVsSupported", wintypes.BOOL),
        ("ConservativeRasterizationTier", ctypes.c_int),
        ("MaxGPUVirtualAddressBitsPerResource", wintypes.DWORD),
        ("StandardSwizzle64KBSupported", wintypes.BOOL),
        ("CrossNodeSharingTier", ctypes.c_int),
        ("CrossAdapterRowMajorTextureSupported", wintypes.BOOL),
        ("VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation", wintypes.BOOL),
        ("ResourceHeapTier", ctypes.c_int),
    ]
#[repr(C)]
pub struct D3D12_FEATURE_DATA_D3D12_OPTIONS {
    pub DoublePrecisionFloatShaderOps: i32,
    pub OutputMergerLogicOp: i32,
    pub MinPrecisionSupport: i32,
    pub TiledResourcesTier: i32,
    pub ResourceBindingTier: i32,
    pub PSSpecifiedStencilRefSupported: i32,
    pub TypedUAVLoadAdditionalFormats: i32,
    pub ROVsSupported: i32,
    pub ConservativeRasterizationTier: i32,
    pub MaxGPUVirtualAddressBitsPerResource: u32,
    pub StandardSwizzle64KBSupported: i32,
    pub CrossNodeSharingTier: i32,
    pub CrossAdapterRowMajorTextureSupported: i32,
    pub VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation: i32,
    pub ResourceHeapTier: i32,
}
import "golang.org/x/sys/windows"

type D3D12_FEATURE_DATA_D3D12_OPTIONS struct {
	DoublePrecisionFloatShaderOps int32
	OutputMergerLogicOp int32
	MinPrecisionSupport int32
	TiledResourcesTier int32
	ResourceBindingTier int32
	PSSpecifiedStencilRefSupported int32
	TypedUAVLoadAdditionalFormats int32
	ROVsSupported int32
	ConservativeRasterizationTier int32
	MaxGPUVirtualAddressBitsPerResource uint32
	StandardSwizzle64KBSupported int32
	CrossNodeSharingTier int32
	CrossAdapterRowMajorTextureSupported int32
	VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation int32
	ResourceHeapTier int32
}
type
  D3D12_FEATURE_DATA_D3D12_OPTIONS = record
    DoublePrecisionFloatShaderOps: BOOL;
    OutputMergerLogicOp: BOOL;
    MinPrecisionSupport: Integer;
    TiledResourcesTier: Integer;
    ResourceBindingTier: Integer;
    PSSpecifiedStencilRefSupported: BOOL;
    TypedUAVLoadAdditionalFormats: BOOL;
    ROVsSupported: BOOL;
    ConservativeRasterizationTier: Integer;
    MaxGPUVirtualAddressBitsPerResource: DWORD;
    StandardSwizzle64KBSupported: BOOL;
    CrossNodeSharingTier: Integer;
    CrossAdapterRowMajorTextureSupported: BOOL;
    VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation: BOOL;
    ResourceHeapTier: Integer;
  end;
const D3D12_FEATURE_DATA_D3D12_OPTIONS = extern struct {
    DoublePrecisionFloatShaderOps: i32,
    OutputMergerLogicOp: i32,
    MinPrecisionSupport: i32,
    TiledResourcesTier: i32,
    ResourceBindingTier: i32,
    PSSpecifiedStencilRefSupported: i32,
    TypedUAVLoadAdditionalFormats: i32,
    ROVsSupported: i32,
    ConservativeRasterizationTier: i32,
    MaxGPUVirtualAddressBitsPerResource: u32,
    StandardSwizzle64KBSupported: i32,
    CrossNodeSharingTier: i32,
    CrossAdapterRowMajorTextureSupported: i32,
    VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation: i32,
    ResourceHeapTier: i32,
};
type
  D3D12_FEATURE_DATA_D3D12_OPTIONS {.bycopy.} = object
    DoublePrecisionFloatShaderOps: int32
    OutputMergerLogicOp: int32
    MinPrecisionSupport: int32
    TiledResourcesTier: int32
    ResourceBindingTier: int32
    PSSpecifiedStencilRefSupported: int32
    TypedUAVLoadAdditionalFormats: int32
    ROVsSupported: int32
    ConservativeRasterizationTier: int32
    MaxGPUVirtualAddressBitsPerResource: uint32
    StandardSwizzle64KBSupported: int32
    CrossNodeSharingTier: int32
    CrossAdapterRowMajorTextureSupported: int32
    VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation: int32
    ResourceHeapTier: int32
struct D3D12_FEATURE_DATA_D3D12_OPTIONS
{
    int DoublePrecisionFloatShaderOps;
    int OutputMergerLogicOp;
    int MinPrecisionSupport;
    int TiledResourcesTier;
    int ResourceBindingTier;
    int PSSpecifiedStencilRefSupported;
    int TypedUAVLoadAdditionalFormats;
    int ROVsSupported;
    int ConservativeRasterizationTier;
    uint MaxGPUVirtualAddressBitsPerResource;
    int StandardSwizzle64KBSupported;
    int CrossNodeSharingTier;
    int CrossAdapterRowMajorTextureSupported;
    int VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation;
    int ResourceHeapTier;
}

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_D3D12_OPTIONS サイズ: 60 バイト(x64)
dim st, 15    ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; DoublePrecisionFloatShaderOps : BOOL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; OutputMergerLogicOp : BOOL (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; MinPrecisionSupport : D3D12_SHADER_MIN_PRECISION_SUPPORT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; TiledResourcesTier : D3D12_TILED_RESOURCES_TIER (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ResourceBindingTier : D3D12_RESOURCE_BINDING_TIER (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; PSSpecifiedStencilRefSupported : BOOL (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; TypedUAVLoadAdditionalFormats : BOOL (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ROVsSupported : BOOL (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ConservativeRasterizationTier : D3D12_CONSERVATIVE_RASTERIZATION_TIER (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; MaxGPUVirtualAddressBitsPerResource : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; StandardSwizzle64KBSupported : BOOL (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; CrossNodeSharingTier : D3D12_CROSS_NODE_SHARING_TIER (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; CrossAdapterRowMajorTextureSupported : BOOL (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation : BOOL (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ResourceHeapTier : D3D12_RESOURCE_HEAP_TIER (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_FEATURE_DATA_D3D12_OPTIONS
    #field bool DoublePrecisionFloatShaderOps
    #field bool OutputMergerLogicOp
    #field int MinPrecisionSupport
    #field int TiledResourcesTier
    #field int ResourceBindingTier
    #field bool PSSpecifiedStencilRefSupported
    #field bool TypedUAVLoadAdditionalFormats
    #field bool ROVsSupported
    #field int ConservativeRasterizationTier
    #field int MaxGPUVirtualAddressBitsPerResource
    #field bool StandardSwizzle64KBSupported
    #field int CrossNodeSharingTier
    #field bool CrossAdapterRowMajorTextureSupported
    #field bool VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation
    #field int ResourceHeapTier
#endstruct

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