DXGI_SAMPLE_DESC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Count | DWORD | 4 | +0 | +0 | ピクセルあたりのマルチサンプル数です。 |
| Quality | DWORD | 4 | +4 | +4 | イメージの品質レベルです。品質が高いほどパフォーマンスは低下します。有効な範囲は 0 から、Direct3D 10 の場合は ID3D10Device::CheckMultisampleQualityLevels、Direct3D 11 の場合は ID3D11Device::CheckMultisampleQualityLevels が返すレベルより 1 小さい値までです。 Direct3D 10.1 および Direct3D 11 では、2 つの特別な品質レベル値を使用できます。これらの品質レベル値の詳細については、「解説」を参照してください。 |
公式ドキュメント
リソースのマルチサンプリング パラメーターを記述します。
解説(Remarks)
この構造体は DXGI_SWAP_CHAIN_DESC1 構造体のメンバーです。
アンチエイリアシングを行わない既定のサンプラー モードでは、カウントは 1、品質レベルは 0 です。
マルチサンプル アンチエイリアシングを使用する場合、バインドされているすべてのレンダー ターゲットと深度バッファーは、同じサンプル数および品質レベルでなければなりません。
|
Direct3D 10.0 と Direct3D 10.1 の相違点、および Direct3D 10.0 と Direct3D 11 の相違点:
Direct3D 10.1 では、D3D10_1.h の D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS 列挙型に、2 つの標準品質レベル Direct3D 11 では、D3D11.h の D3D11_STANDARD_MULTISAMPLE_QUALITY_LEVELS 列挙型に、2 つの標準品質レベル |
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// DXGI_SAMPLE_DESC (x64 8 / x86 8 バイト)
typedef struct DXGI_SAMPLE_DESC {
DWORD Count;
DWORD Quality;
} DXGI_SAMPLE_DESC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXGI_SAMPLE_DESC
{
public uint Count;
public uint Quality;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXGI_SAMPLE_DESC
Public Count As UInteger
Public Quality As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DXGI_SAMPLE_DESC(ctypes.Structure):
_fields_ = [
("Count", wintypes.DWORD),
("Quality", wintypes.DWORD),
]#[repr(C)]
pub struct DXGI_SAMPLE_DESC {
pub Count: u32,
pub Quality: u32,
}import "golang.org/x/sys/windows"
type DXGI_SAMPLE_DESC struct {
Count uint32
Quality uint32
}type
DXGI_SAMPLE_DESC = record
Count: DWORD;
Quality: DWORD;
end;const DXGI_SAMPLE_DESC = extern struct {
Count: u32,
Quality: u32,
};type
DXGI_SAMPLE_DESC {.bycopy.} = object
Count: uint32
Quality: uint32struct DXGI_SAMPLE_DESC
{
uint Count;
uint Quality;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXGI_SAMPLE_DESC サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; Count : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Quality : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DXGI_SAMPLE_DESC
#field int Count
#field int Quality
#endstruct
stdim st, DXGI_SAMPLE_DESC ; NSTRUCT 変数を確保
st->Count = 100
mes "Count=" + st->Count