ホーム › Graphics.Direct3D12 › D3D12_SUBRESOURCE_TILING
D3D12_SUBRESOURCE_TILING
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| WidthInTiles | DWORD | 4 | +0 | +0 | サブリソースの幅(タイル数)。 |
| HeightInTiles | WORD | 2 | +4 | +4 | サブリソースの高さ(タイル数)。 |
| DepthInTiles | WORD | 2 | +6 | +6 | サブリソースの奥行き(タイル数)。 |
| StartTileIndexInOverallResource | DWORD | 4 | +8 | +8 | リソース全体内での開始タイルインデックス。 |
各言語での定義
#include <windows.h>
// D3D12_SUBRESOURCE_TILING (x64 12 / x86 12 バイト)
typedef struct D3D12_SUBRESOURCE_TILING {
DWORD WidthInTiles;
WORD HeightInTiles;
WORD DepthInTiles;
DWORD StartTileIndexInOverallResource;
} D3D12_SUBRESOURCE_TILING;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_SUBRESOURCE_TILING
{
public uint WidthInTiles;
public ushort HeightInTiles;
public ushort DepthInTiles;
public uint StartTileIndexInOverallResource;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_SUBRESOURCE_TILING
Public WidthInTiles As UInteger
Public HeightInTiles As UShort
Public DepthInTiles As UShort
Public StartTileIndexInOverallResource As UInteger
End Structureimport ctypes
from ctypes import wintypes
class D3D12_SUBRESOURCE_TILING(ctypes.Structure):
_fields_ = [
("WidthInTiles", wintypes.DWORD),
("HeightInTiles", ctypes.c_ushort),
("DepthInTiles", ctypes.c_ushort),
("StartTileIndexInOverallResource", wintypes.DWORD),
]#[repr(C)]
pub struct D3D12_SUBRESOURCE_TILING {
pub WidthInTiles: u32,
pub HeightInTiles: u16,
pub DepthInTiles: u16,
pub StartTileIndexInOverallResource: u32,
}import "golang.org/x/sys/windows"
type D3D12_SUBRESOURCE_TILING struct {
WidthInTiles uint32
HeightInTiles uint16
DepthInTiles uint16
StartTileIndexInOverallResource uint32
}type
D3D12_SUBRESOURCE_TILING = record
WidthInTiles: DWORD;
HeightInTiles: Word;
DepthInTiles: Word;
StartTileIndexInOverallResource: DWORD;
end;const D3D12_SUBRESOURCE_TILING = extern struct {
WidthInTiles: u32,
HeightInTiles: u16,
DepthInTiles: u16,
StartTileIndexInOverallResource: u32,
};type
D3D12_SUBRESOURCE_TILING {.bycopy.} = object
WidthInTiles: uint32
HeightInTiles: uint16
DepthInTiles: uint16
StartTileIndexInOverallResource: uint32struct D3D12_SUBRESOURCE_TILING
{
uint WidthInTiles;
ushort HeightInTiles;
ushort DepthInTiles;
uint StartTileIndexInOverallResource;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_SUBRESOURCE_TILING サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; WidthInTiles : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; HeightInTiles : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; DepthInTiles : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; StartTileIndexInOverallResource : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_SUBRESOURCE_TILING
#field int WidthInTiles
#field short HeightInTiles
#field short DepthInTiles
#field int StartTileIndexInOverallResource
#endstruct
stdim st, D3D12_SUBRESOURCE_TILING ; NSTRUCT 変数を確保
st->WidthInTiles = 100
mes "WidthInTiles=" + st->WidthInTiles