D3D11_TILE_REGION_SIZE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NumTiles | DWORD | 4 | +0 | +0 | タイル領域内のタイル数です。 |
| bUseBox | BOOL | 4 | +4 | +4 | ランタイムが領域の定義に Width、Height、Depth メンバーを使用するかどうかを指定します。 TRUE の場合、ランタイムは領域の定義に Width、Height、Depth メンバーを使用します。 FALSE の場合、ランタイムは Width、Height、Depth メンバーを無視し、NumTiles メンバーを使用してリソース内のタイルを x、次に y、次に z の順に(該当する場合)線形にたどり、さらにサブリソース順にミップマップ/配列へと続けて処理します。たとえば、リソース全体を一度にマップする場合にこの方法を使用します。 bUseBox に TRUE と FALSE のどちらを指定した場合でも、リソース内での領域の開始位置は、この構造体とは別のパラメーターとして D3D11_TILED_RESOURCE_COORDINATE 構造体を使用し、x、y、z 座標で指定します。 領域に非標準のタイリングでパックされたミップマップが含まれる場合、bUseBox は FALSE でなければなりません。これは、タイルの寸法が標準ではなく、アプリはパックされた領域が消費するタイル数(配列スライスごと)しか把握できないためです。この場合、対応する(別途指定する)開始位置パラメーターでは、x をタイルのフラットな範囲へのオフセットとして使用し、y 座標と z 座標はいずれも 0 でなければなりません。 |
| Width | DWORD | 4 | +8 | +8 | タイル領域の幅(タイル単位)です。バッファーおよび 1D、2D、3D テクスチャーで使用されます。 |
| Height | WORD | 2 | +12 | +12 | タイル領域の高さ(タイル単位)です。2D および 3D テクスチャーで使用されます。 |
| Depth | WORD | 2 | +14 | +14 | タイル領域の深さ(タイル単位)です。3D テクスチャーまたは配列で使用されます。配列の場合は、同じミップマップ サイズの次のスライスへ深さ方向にジャンプして進むために使用されます。複数のミップマップがある場合、これはサブリソースのカウント空間上では連続していません。 |
公式ドキュメント
タイル領域のサイズを記述します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// D3D11_TILE_REGION_SIZE (x64 16 / x86 16 バイト)
typedef struct D3D11_TILE_REGION_SIZE {
DWORD NumTiles;
BOOL bUseBox;
DWORD Width;
WORD Height;
WORD Depth;
} D3D11_TILE_REGION_SIZE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_TILE_REGION_SIZE
{
public uint NumTiles;
[MarshalAs(UnmanagedType.Bool)] public bool bUseBox;
public uint Width;
public ushort Height;
public ushort Depth;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_TILE_REGION_SIZE
Public NumTiles As UInteger
<MarshalAs(UnmanagedType.Bool)> Public bUseBox As Boolean
Public Width As UInteger
Public Height As UShort
Public Depth As UShort
End Structureimport ctypes
from ctypes import wintypes
class D3D11_TILE_REGION_SIZE(ctypes.Structure):
_fields_ = [
("NumTiles", wintypes.DWORD),
("bUseBox", wintypes.BOOL),
("Width", wintypes.DWORD),
("Height", ctypes.c_ushort),
("Depth", ctypes.c_ushort),
]#[repr(C)]
pub struct D3D11_TILE_REGION_SIZE {
pub NumTiles: u32,
pub bUseBox: i32,
pub Width: u32,
pub Height: u16,
pub Depth: u16,
}import "golang.org/x/sys/windows"
type D3D11_TILE_REGION_SIZE struct {
NumTiles uint32
bUseBox int32
Width uint32
Height uint16
Depth uint16
}type
D3D11_TILE_REGION_SIZE = record
NumTiles: DWORD;
bUseBox: BOOL;
Width: DWORD;
Height: Word;
Depth: Word;
end;const D3D11_TILE_REGION_SIZE = extern struct {
NumTiles: u32,
bUseBox: i32,
Width: u32,
Height: u16,
Depth: u16,
};type
D3D11_TILE_REGION_SIZE {.bycopy.} = object
NumTiles: uint32
bUseBox: int32
Width: uint32
Height: uint16
Depth: uint16struct D3D11_TILE_REGION_SIZE
{
uint NumTiles;
int bUseBox;
uint Width;
ushort Height;
ushort Depth;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D11_TILE_REGION_SIZE サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; NumTiles : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; bUseBox : BOOL (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Width : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Height : WORD (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; Depth : WORD (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D11_TILE_REGION_SIZE
#field int NumTiles
#field bool bUseBox
#field int Width
#field short Height
#field short Depth
#endstruct
stdim st, D3D11_TILE_REGION_SIZE ; NSTRUCT 変数を確保
st->NumTiles = 100
mes "NumTiles=" + st->NumTiles