D3D11_FEATURE_DATA_D3D9_OPTIONS1
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| FullNonPow2TextureSupported | BOOL | 4 | +0 | +0 | ドライバーが「2 のべき乗以外を無条件でサポートする」機能 (nonpowers-of-2-unconditionally) をサポートするかどうかを指定します。この機能の詳細については、機能レベルを参照してください。ランタイムは、Direct3D 10 以上の機能レベルのハードウェアに対して、このメンバーを TRUE に設定します。Direct3D 9.3 以下の機能レベルのハードウェアの場合、ハードウェアとドライバーが「2 のべき乗」機能 (2D テクスチャの幅と高さを 2 のべき乗で指定しなければならない) または「2 のべき乗以外を条件付きでサポートする」機能 (nonpowers-of-2-conditionally) をサポートするときは、ランタイムはこのメンバーを FALSE に設定します。 |
| DepthAsTextureWithLessEqualComparisonFilterSupported | BOOL | 4 | +4 | +4 | ドライバーが、比較フィルタリング モードを「以下 (less than or equal to)」に設定したシャドウ機能をサポートするかどうかを指定します。ランタイムは、Direct3D 10 以上の機能レベルのハードウェアに対して、このメンバーを TRUE に設定します。Direct3D 9.3 以下の機能レベルのハードウェアの場合、ランタイムはハードウェアとドライバーがシャドウ機能をサポートするときのみこのメンバーを TRUE に設定し、それ以外の場合は FALSE に設定します。 |
| SimpleInstancingSupported | BOOL | 4 | +8 | +8 | ハードウェアとドライバーが単純なインスタンス化 (simple instancing) をサポートするかどうかを指定します。ハードウェアとドライバーが単純なインスタンス化をサポートする場合、ランタイムはこのメンバーを TRUE に設定します。 |
| TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported | BOOL | 4 | +12 | +12 | ハードウェアとドライバーが、TextureCube の 1 つの面をレンダー ターゲットとして設定しつつ、同時にバインドされる深度ステンシル サーフェスを (TextureCube ではなく) Texture2D にできる機能をサポートするかどうかを指定します。ハードウェアとドライバーがこの機能をサポートする場合、ランタイムはこのメンバーを TRUE に設定し、それ以外の場合は FALSE に設定します。 ハードウェアとドライバーがこの機能をサポートしない場合、アプリはレンダー ターゲット サーフェスの種類と深度ステンシル サーフェスの種類を一致させる必要があります。Direct3D 9.3 以下の機能レベルのハードウェアでは TextureCube の深度サーフェスが許可されないため、深度バッファリングを有効にしたままシーンを TextureCube にレンダリングする唯一の方法は、まず TextureCube の各面を Texture2D のレンダー ターゲットへ個別にレンダリングし (これであれば Texture2D の深度と一致させられるため)、その結果を TextureCube へコピーすることです。ハードウェアとドライバーがこの機能をサポートする場合、アプリは Texture2D の深度バッファーで深度バッファリングを行いながら、TextureCube の各面に直接レンダリングできます。 Direct3D 10.0 以上の機能レベルのハードウェアでは TextureCube の深度サーフェスが許可されるため、この機能を照会する必要があるのは Direct3D 9.3 以下の機能レベルのハードウェアのみです。 |
公式ドキュメント
解説(Remarks)
D3D11_FEATURE_D3D9_OPTIONS1 列挙値を ID3D11Device::CheckFeatureSupport と共に使用すると、Direct3D 9 の機能オプションのサポート状況をドライバーに照会できます。この方法では、サポートされる Direct3D 9 の機能オプションについて同一の情報を提供する D3D11_FEATURE_D3D9_OPTIONS、D3D11_FEATURE_D3D9_SHADOW_SUPPORT、D3D11_FEATURE_D3D9_SIMPLE_INSTANCING_SUPPORT を使って ID3D11Device::CheckFeatureSupport を複数回呼び出す必要がありません。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// D3D11_FEATURE_DATA_D3D9_OPTIONS1 (x64 16 / x86 16 バイト)
typedef struct D3D11_FEATURE_DATA_D3D9_OPTIONS1 {
BOOL FullNonPow2TextureSupported;
BOOL DepthAsTextureWithLessEqualComparisonFilterSupported;
BOOL SimpleInstancingSupported;
BOOL TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported;
} D3D11_FEATURE_DATA_D3D9_OPTIONS1;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_FEATURE_DATA_D3D9_OPTIONS1
{
[MarshalAs(UnmanagedType.Bool)] public bool FullNonPow2TextureSupported;
[MarshalAs(UnmanagedType.Bool)] public bool DepthAsTextureWithLessEqualComparisonFilterSupported;
[MarshalAs(UnmanagedType.Bool)] public bool SimpleInstancingSupported;
[MarshalAs(UnmanagedType.Bool)] public bool TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_FEATURE_DATA_D3D9_OPTIONS1
<MarshalAs(UnmanagedType.Bool)> Public FullNonPow2TextureSupported As Boolean
<MarshalAs(UnmanagedType.Bool)> Public DepthAsTextureWithLessEqualComparisonFilterSupported As Boolean
<MarshalAs(UnmanagedType.Bool)> Public SimpleInstancingSupported As Boolean
<MarshalAs(UnmanagedType.Bool)> Public TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported As Boolean
End Structureimport ctypes
from ctypes import wintypes
class D3D11_FEATURE_DATA_D3D9_OPTIONS1(ctypes.Structure):
_fields_ = [
("FullNonPow2TextureSupported", wintypes.BOOL),
("DepthAsTextureWithLessEqualComparisonFilterSupported", wintypes.BOOL),
("SimpleInstancingSupported", wintypes.BOOL),
("TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported", wintypes.BOOL),
]#[repr(C)]
pub struct D3D11_FEATURE_DATA_D3D9_OPTIONS1 {
pub FullNonPow2TextureSupported: i32,
pub DepthAsTextureWithLessEqualComparisonFilterSupported: i32,
pub SimpleInstancingSupported: i32,
pub TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported: i32,
}import "golang.org/x/sys/windows"
type D3D11_FEATURE_DATA_D3D9_OPTIONS1 struct {
FullNonPow2TextureSupported int32
DepthAsTextureWithLessEqualComparisonFilterSupported int32
SimpleInstancingSupported int32
TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported int32
}type
D3D11_FEATURE_DATA_D3D9_OPTIONS1 = record
FullNonPow2TextureSupported: BOOL;
DepthAsTextureWithLessEqualComparisonFilterSupported: BOOL;
SimpleInstancingSupported: BOOL;
TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported: BOOL;
end;const D3D11_FEATURE_DATA_D3D9_OPTIONS1 = extern struct {
FullNonPow2TextureSupported: i32,
DepthAsTextureWithLessEqualComparisonFilterSupported: i32,
SimpleInstancingSupported: i32,
TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported: i32,
};type
D3D11_FEATURE_DATA_D3D9_OPTIONS1 {.bycopy.} = object
FullNonPow2TextureSupported: int32
DepthAsTextureWithLessEqualComparisonFilterSupported: int32
SimpleInstancingSupported: int32
TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported: int32struct D3D11_FEATURE_DATA_D3D9_OPTIONS1
{
int FullNonPow2TextureSupported;
int DepthAsTextureWithLessEqualComparisonFilterSupported;
int SimpleInstancingSupported;
int TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_FEATURE_DATA_D3D9_OPTIONS1 サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; FullNonPow2TextureSupported : BOOL (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DepthAsTextureWithLessEqualComparisonFilterSupported : BOOL (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; SimpleInstancingSupported : BOOL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported : BOOL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_FEATURE_DATA_D3D9_OPTIONS1
#field bool FullNonPow2TextureSupported
#field bool DepthAsTextureWithLessEqualComparisonFilterSupported
#field bool SimpleInstancingSupported
#field bool TextureCubeFaceRenderTargetWithNonCubeDepthStencilSupported
#endstruct
stdim st, D3D11_FEATURE_DATA_D3D9_OPTIONS1 ; NSTRUCT 変数を確保
st->FullNonPow2TextureSupported = 100
mes "FullNonPow2TextureSupported=" + st->FullNonPow2TextureSupported